Search code examples
c#networkingnetsh

Using ICS to redirect users?


I made a network using netsh and ICS. But i want to be able to redirect each request to my website.

Like This:

Computer A requests the website www.Google.com.

Host responds with my_website.

Is this possible in any way?

Answers are much appreciated.


Solution

  • Use the sharp-pcap wrapper (http://sourceforge.net/projects/sharppcap/) to detect web requests and inject a 307 status HTTP response informing the originator of the request that the website they requested has moved to the location of your website.

    The way this works:

    1) I open my browser and navigate to http://www.google.com

    2) My browser sends a request to the server of the website requesting / (i.e. index)

    3) On the ICS pc my request is picked up and a response, redirecting me to http://www.yourwebsite.com is sent instead.

    4) My browser receives the response and then tries to load http://www.yourwebsite.com instead

    5) When your code picks up requests to http://www.yourwebsite.com, it allows the packets to flow normally