3
votes

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!

1

1 Answers

1
votes

TL;DR:

  1. 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.
  2. In Charles go to menu Proxy→External Proxy Settings
  3. Select Use external proxy servers checkbox at the top
  4. Clear Web Proxy (HTTP) and SOCKS Proxy checkboxes on the left side
  5. Select Secure Web Proxy (HTTPS) on the left side
  6. On the right side under Secure Web Proxy Server enter 127.0.0.1 and 8118
  7. At the bottom select Always bypass external proxies for localhost checkbox
  8. Click OK to save changes
  9. 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.