Configure fiddler to use proxy - proxy

Is there way to configure such chain MyApp->Fiddler->Web Proxy*->Target Server?
*Web Proxy is one from this list.
P.S. I know how to configure MyApp->Fiddler->Target Server but I need to test some functional associated with situations when user login from unusual location (for example from Africa)

Fiddler can chain to any upstream proxy. By default, it chains to the proxy that Internet Explorer was configured to use when Fiddler started. But you can also manually set the upstream proxy in Fiddler by clicking Tools > Fiddler Options > Gateway.

Related

Fiddler not capturing some connections

I'm trying to use Fiddler version 5.0.20202.18177 (latest as of writing) to determine the URLs used by various online / web installers.
This works fine in most cases. For example, with SpotifySetup.exe:
However, this does not work in some cases. For example, with DropboxInstaller.exe and bitdefender_online.exe:
I have ensured that:
HTTPS decryption is set up for all processes:
All types of connections are being captured:
Windows' proxies are set as expected.
All Windows 10 AppContainer Loopback exemptions are in place:
Running Fiddler as administrator doesn't make a difference.
I would have guessed that the executables simply aren't utilising the proxy but, as far as I'm aware, if the proxy is set at the Windows level then they can't override that?
A program can use of the proxy defined in the Windows Internet settings but it also can ignore those settings and directly connect to the Internet.
The proxy settings are only used automatically for programs that use an HTTP client provided by Microsoft (e.g. WinHTTP for C/C++ or a Dot.net Http client implementation).
All other programs that use their own HTTP client can query the Windows proxy settings and apply them but this is optionally. From a Windows perspective those programs just open TCP connections, what protocol is used on the connection is unknown to Windows hence Windows could not enforce that a proxy is used even if it would try to do so.
By default even programs that come with Windows like the command-line too curl ignore the Windows proxy settings.
Dropbox for example has their own proxy settings within the Dropbox client. There you have to configure Fiddler as proxy.
Bitdefender also seem to have it's own proxy settings where you have to configure Fiddler.
After my discussion with Robert, I ended up abandoning Fiddler, setting up a VirtualBox VM running pfSense Community Edition (free) + Squid3 with HTTPS Interception and Access Logging, installing the pfSense's root CA certificate in my test Windows VM, and changing my test Windows VM's default gateway to the LAN IP address of the pfSense which worked.
In the case of the Dropbox example, it was initially logging TCP_TUNNEL_ABORTED/200 client.dropbox.com:443 so I added client.dropbox.com to the whitelist in the ACLs then it worked and I could see the full EXE URL:

How can I record JMeter scripts behind company's proxy auto config (PAC) file?

The Internet Options settings are managed by my company's system administrator.
The Proxy is set to use automatic configuration script (http://proxypac.abcd.com/proxyrouting). I cannot disable this.
I cannot change the proxy to localhost. The above PAC script will override no matter what I try to change.
The IT security does not allow me to install Chrome Blazemeter plugin, or install Badboy, or use Fiddler, or be able to manually change the proxy.
The company's proxy host is proxy.abcd.com and port is 8080, but I don't know how this info will help if the browser is reading the PAC file.
Is there any option for me to record JMeter scripts in the above scenario?
Is there any way for me to create GUI scripts with plenty of data and dynamic values coming back from the server without recording (if recording is not an option in my case)?
You can use a browser which doesn't use operating system proxy settings, a good example is Mozilla Firefox. You need to configure Firefox to use JMeter as the proxy
Once done you can configure JMeter to use your company proxy server by putting the following lines to system.properties file:
http.proxyHost=proxy.abcd.com
https.proxyHost=proxy.abcd.com
http.proxyPort=8080
https.proxyPort=8080
These PAC files don't do any magic, they're normal JavaScript files which are being interpreted by browsers to determine which proxy should be used for which URL. For certain URLs you might not even need to use the proxy. So I would recommend checking whether you really need the proxy for accessing the application you're trying to record, it might be the case you don't need this step #2

How to run Charles Proxy over Tor?

Following situation:
intercepting web traffic with Charles Proxy works fine if i set the browsers http/https proxy to the port Charles is configured for (127.0.0.1:8888)
surfing over anonymously over Tor works also fine if i set the browsers socks proxy to the one which Tor is configured for (127.0.0.1:9150)
Now i want to chain both proxies in the way, that i can intercept the web traffic of my browser with Charles while being anonymously over the Tor network. So i set my browsers http/https proxy to Charles and in Charles i set up the "external Proxies" to Tor.
But somehow this doesn't work. Do i have some misconceptions? Thanks for help!
TL;DR:
Open command line (C:\Windows\System32\cmd.exe) and type this command in the console window:
"C:\TorBrowserBundle\Browser\TorBrowser\Tor\tor.exe" --HTTPTunnelPort 8118. Adjust path according to where your Tor Browser Bundle is located.
In Charles go to menu Proxy→External Proxy Settings
Select Use external proxy servers checkbox at the top
Clear Web Proxy (HTTP) and SOCKS Proxy checkboxes on the left side
Select Secure Web Proxy (HTTPS) on the left side
On the right side under Secure Web Proxy Server enter 127.0.0.1 and 8118
At the bottom select Always bypass external proxies for localhost checkbox
Click OK to save changes
Try opening https://google.com/ in the web browser configured to use Charles (better in Incognito window to make sure that your Google account settings do not interfere with Google language detection by geo-location). You should see localized Google page in some random language.
Explanations
Tor provides SOCKS proxy out of the box. By default Tor uses port 9050. You mentioned port 9150. This is default port used by Tor Browser Bundle. So I assume you use Tor Browser Bundle. But specifying SOCKS Proxy settings in External Proxy Settings in Charles won't allow you to open websites via https:// links. If you take a look at the Charles documentation, you might notice that only non-HTTPS traffic is being sent via SOCKS proxy. Quote (emphasis mine):
If you have a SOCKS proxy Charles will use it for all non-HTTP(S) traffic such as for Port Forwarding.
So in order to chain Charles via Tor, you must use non-SOCKS proxy.
By the way, I was unable to open http:// links via Charles when specified Tor as SOCKS proxy and disabled Secure Web Proxy (HTTPS). No idea why.

How to use direct connection applications behind a kerberos proxy

I have a corporate proxy using Squid and kerberos for authentication, the proxy is configured for standard use, I.E allow http, https, a few others and block everything else. Now, there are many applications that support basic proxy authentication, but do not support Kerberos based authentication and many others that connect directly to the internet. I used Proxifier before the upgrade to kerberos to make my applications use the proxy, but I cannot do so now. I then installed an application called PX to create a proxy that connects to kerberos, but the proxy it creates is a simple HTTP Proxy and proxifier doesn't work correctly with it. Anyone has a setup for a situation like this?. I use Windows 10 and I obviously don't have access to the server where squid is configured. The application I need to connect to the internet uses standard https ports, it's not a torrent application nor anything that uses the ports blocked by squid. Thanks in advance.
Ok, for this particular case I've found the following setup to solve 99% of my problems.
First get Px here https://github.com/genotrance/px
Next get Fiddler: http://www.getfiddler.com/dl/Fiddler4BetaSetup.exe
Configure PX with your user and your domain and run it. By default it creates a running proxy on 127.0.0.1:3128
Configure your sistem proxy to use the proxy supplied by PX.
Execute fiddler, it should create ANOTHER proxy at 127.0.0.1:8888
Use this proxy in your apps. Proxifier should work as well.
Why use fiddler and not the direct 127.0.0.1:3128?, PX creates a pure http proxy and fiddler allows to tunnel https and connect request through it.
Any requests will pass through fiddler which will redirect them to the PX proxy which will redirect them to the squid proxy (So expect very slow speeds).
In the end since you're just redirecting your apps towards your proxy, if your proxy bans using regex expressions or direct IP connections some apps will NOT work, and in these cases using TOR or a VPN is the only real solution. Hope it helps someone avoid all the headaches I went through.

Selenium: Can I tunnel through an *External* HTTP/SOCKS proxy over Firefox?

I know Selenium Server acts AS a proxy. But I want to know if I can instruct a test to connect through to either a SOCKS or plain http proxy, eg: Tuenneling through an external Proxy. (It's so hard to search for because the word proxy just shows how Selenium works, not if it supports this feature....)
You can use -DsocksProxyHost=socks.******.*** -DsocksProxyPort=1080 while running it .
or
In the MANual , you can find this..
-proxyInjectionMode: puts you into proxy injection mode, a mode
where the selenium server acts as a proxy server for all content
going to the test application. Under this mode, multiple domains
can be visited, and the following additional flags are supported:
or
set the settings mentioned above in the system variables..
Yenjoy!

Resources