Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Fiddler to sniff Visual Studio 2013 requests (proxy firewall)

I am having issues with Visual Studio 2013 and our corporate proxy (signin does not work, updates do not work, visual studio gallery does not work, nuget and git fail ). All of these are doing http or https requests. (e.g. http://visualstudiogallery.msdn.microsoft.com/ ). In VS2013 I just get spinning progress bars or messages about no network connection.

No problem with the browser, (chrome, IE, firefox) since they all understand proxies (407 rejections and then responding with credentials).

So I want to figure out why VS2013 does not work. But I cannot see any traffic when I tell fiddler2 to watch the DEVENV.EXE process (or all processes).

BTW, I have tried some changes to the web.config (devenv.exe.config) file to make sure it goes to the proxy (I saw this in stack builder) but it is not working for me. See the additions to the section below:

    <system.net>                 <defaultProxy useDefaultCredentials="true" enabled="true">                  <proxy proxyaddress="http://gw6.OURSITE.com:3128" />                 </defaultProxy>       <settings>         <ipv6 enabled="true"/>         <servicePointManager expect100Continue="false" />        </settings>     </system.net> 

Update

Eric, I took your suggestion and just stuffed it into the C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config file.

What I put in was:

  <system.net>     <defaultProxy useDefaultCredentials="true" enabled="true">       <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />     </defaultProxy>   </system.net> 

What I found was that VS2013 is not sending a user-agent string. It does know about #407 naks and it replies with credentials, but the gateway still wants a user agent:

HTTP/1.1 200 OK Cache-Control: no-cache Pragma: no-cache Content-Type: text/html; charset=utf-8 Proxy-Connection: close Connection: close Content-Length: 1341  <html>     <head>         <title>Access Policy Denied: No User-Agent Specified</title>         <meta name="description" content="Web Access Policy">     </head>     <body> 
like image 694
Dr.YSG Avatar asked Jan 10 '14 16:01

Dr.YSG


People also ask

Does Fiddler act as a proxy?

Fiddler Classic and fiddler Everywhere are special-purpose proxy server tools for debugging web traffic from applications like browsers. They're used to capture and record this web traffic and then forward it onto a web server.

How do I enable Fiddler proxy?

Set Remote Machine Proxy SettingsStart Fiddler Classic on the Fiddler server (the machine that will capture the traffic). Click Tools > Options. Ensure Allow remote clients to connect is checked. On the other machine, set the proxy settings to the machine name of the Fiddler server at port 8888.

Can Fiddler capture desktop application traffic?

To capture traffic with Fiddler, make sure to install the latest version of Fiddler. Once installed, launch the application and proceed with the following: Disable capturing traffic using the File | Capture Traffic menu. Remove all sessions (select all items in the list, press the Delete key)


1 Answers

If you want to look at the traffic with Fiddler, you probably want to go the route of changing the machine.config file so that all .NET applications will send traffic through Fiddler. This helps ensure that you capture data from processes running in services, etc.

Open machine.config in the folder C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config. Note that if you are debugging a 64bit service (like ASP.NET) you will want to look in the Framework64 folder instead of the Framework folder. Similarly, if you are using a .NET version prior to 4.0, you will need to adjust the version part of the path.

Add the following XML block as a peer to the existing system.net element, replacing any existing defaultProxy element if present:

<!-- The following section is to force use of Fiddler for all applications, including those running in service accounts -->  <system.net>  <defaultProxy                  enabled = "true"                  useDefaultCredentials = "true">  <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" usesystemdefault="false" />  </defaultProxy>  </system.net> 

Ref http://fiddler2.com/blog/blog/2013/01/08/capturing-traffic-from-.net-services-with-fiddler

Note: You can use Fiddler to inject a User-Agent header on outbound requests if you like. Also, in the latest version of Fiddler, you can File > Import > Packet Capture to collect HTTP traffic out of .cap files captured using Microsoft NetMon or Microsoft Message Analyzer.

like image 200
EricLaw Avatar answered Oct 10 '22 09:10

EricLaw