Results 1 to 5 of 5
  1. #1
    flamery01's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0

    Small app to block certain http calls

    Hi guys,

    I need to make a patch that when running, will block all requests to a specific URL. Has anyone done that before if so would love a code snippet!

    I know I can just add it to the hosts file, or even make a program to add it to add it to the hosts file automatically but there is certain times when access is needed, so I only want to block it when my patch is running and unblock it when the patch is closed.

    Any pointers or help?

    thanks

  2. #2
    MikeRohsoft's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    Los Santos
    Posts
    797
    Reputation
    593
    Thanks
    26,314
    This will block IP 192.169.0.10
    Code:
    netsh advfirewall firewall add rule name="IP Block" dir=out interface=any action=block remoteip=192.169.0.10/32

  3. #3
    flamery01's Avatar
    Join Date
    Jun 2017
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0
    thanks for that code.

    After more investigation I think I will write to the hosts file, then delete the entry again when my application is closed. Reason being the above code I suspect will only work for people with windows firewall enabled and I cant find any other way to block packets inside c# or c++

  4. #4
    xxxjmxxx's Avatar
    Join Date
    Aug 2017
    Gender
    male
    Posts
    109
    Reputation
    53
    Thanks
    22
    My Mood
    Cool
    Ok. Now you have me curious. What are you trying to do? What is the real purpose of the app (not just a repeat of what you already described)?

    To me it would be easier to grab an old and cheap managed lan switch and create an access list for each port and just move the connection to the port with the corresponding access list you need at the time. Clip. Unclip. You’re done.

  5. #5
    MikeRohsoft's Avatar
    Join Date
    May 2013
    Gender
    male
    Location
    Los Santos
    Posts
    797
    Reputation
    593
    Thanks
    26,314
    i also don't understand it otherwise.
    You can of course write an Integerated Proxy or DNS Server to your Application and set the OS Proxy-Settings, but i don't understand myself where is the Problem with Windows Firewall or /etc/hosts file

Similar Threads

  1. Kik (the messaging app) launches its own ICO called kin...
    By Allura in forum Cryptocurrency Talk
    Replies: 0
    Last Post: 09-15-2017, 05:24 AM
  2. [Help] Minecraft Macros Mod Bypassing Server Blocking Certain Functions
    By vtgbop in forum General Game Hacking
    Replies: 1
    Last Post: 08-21-2015, 02:29 PM
  3. [Info] ID block so called Kita is blocking people Id in SF
    By [P]ro in forum Soldier Front General
    Replies: 1
    Last Post: 12-06-2011, 07:27 AM
  4. Block Calling App For Android Help
    By Drtro in forum General
    Replies: 1
    Last Post: 04-19-2011, 07:55 PM
  5. Replies: 26
    Last Post: 02-08-2010, 06:25 AM