Wednesday 15 August 2012

c# - Intercepting webpage requests through Wireless Hosted Network -


Good evening,

I have created a wireless hosted network on my Windows 8 laptop, through the following 2 batch commands from: "Netswwa wlan set hostnamenetwork mode = ssid = test key = 12345678" and "Netswala hosted hosted hosting hosting"

Later, a device (Android-based mobile phone) successfully connected Is able to host this wireless hosted network on my laptop There has also been created an HTTPPL sensor on port # 1234, which can successfully access the device to be used in the web browser:

  http://192.168.138.1:1234   

However, how will the host (IE my laptop) intercept and redirect webpage requests? That is, how will a NATP running on my laptop be notified when an app tries to reach a webpage like google.com or facebook.com, and then sending the device to its webpage instead of another webpage Redirects to?

I have tried the following:

  httpHTMLener listener = new HTTP Author (); Listener.refixes.Add ("http: // +: 80 /"); Listener.Start (); Console.WriteLine ("Start"); While (true) {var c = listener.GetContext (); Console.WriteLine ("Connection"); String response = " gt; body> my web page. & Lt; / lb; / body> & lt; / html & gt;"; // redirect device to this byte [] b = encoding.utf8 Getbacks (feedback); C.Response.ContentLength64 = b.Length; C.Response.OutputStream.Write (B, 0, B. Line); C.response.OutputStream.Close (); }   

However, the program running on my laptop does not lift anything while using the device to access any webpage (Easy-to-google.com) Sorry, if I asked the question again and again, I could not find it anywhere!

Set up your own DNS server to work on it The problem is that your laptop is google Creates a DNS query for .com and receives an IP that points to Google's server and does not belong to you.

Or, if you want to redirect only a few sites - add entries to them in your host file.

No comments:

Post a Comment