Search code examples
c#httpfiddler

Hide Http(s) traffic made by my application from Fiddler


I have application which uses http to obtain data from my server like this:

HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requestString);
req.Timeout = 200 * 1000;
req.Headers.Add(String.Format("deleteme: {0}", content));
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
Stream resStream = resp.GetResponseStream();
StreamReader read = new StreamReader(resStream);
html = read.ReadToEnd();

Everything works fine, but how can I hide my requests from Fiddler (something similar to Wireshark)? I want to prevent users to see it.


Solution

  • Fiddler works by registering itself as the http proxy in Windows.

    You can disable your application from using the default proxy by setting a specific proxy (like in the code below "no proxy") anywhere in your application before making web requests:

    HttpWebRequest.DefaultWebProxy = new WebProxy();
    

    Note that this will also prevent your application from using a configured proxy when one is set-up for legitimate reasons.

    This will hide the requests from Fiddler or any other tool that traces web requests by registering itself as http proxy. This will not prevent tracing the request with other tools that operate on a different level in the stack (like Wireshark)

    Security by obscurity does not really work. If you want to make it impossible to read the data transferred, use actual encryption.