0

for network issue reasons I need to tunnel to Charles.

More specifically, Windows laptop:
- Connected to VPN to test environments - Can connect to public Web - Can not connect to office wifi - Can run Charles or such (can install SW, have admin but can't control network layer)

Linux computer: - Can connect to public Web - Can install anything

Idea: Setup Proxy on Android phone to go to Linux. Tunnel Linux to Charles Proxy on Windows. Windows session can then connect to corporate network which is behind VPN.

Issue: Charles listens for incoming proxy connections. I cannot connect phone directly to it. Can I setup SSH on the Linux to link the two? How?

maxweber
  • 576
  • 1
  • 5
  • 12
  • The alternative approach I tried was using adb forward. It quickly became complex. Need to have a server-server shim on the android as the app wants to go to server but adb to phone acts as client. Then needed a proxy on windows laptop as adb connects locally. Got complex as then needed to support redirects, session cookie hostname rewrites, and other such mess. So, maybe the proxy approach will work and/or work better. – maxweber Feb 02 '15 at 15:14
  • For those wishing to editorialize on the security aspects, please note the corp opened a public IP for one vendor but refuses to do it for the full-time workers. So, that security issue is already open elsewhere. It may be possible to configure Charles to only go to specific internal IP, not sure. – maxweber Feb 02 '15 at 15:17
  • One problem I can see is Linux->[public Web]->windows on VPN will not be allowed an incoming server connection. Charles will require that. Is there some way to setup ssh locally on the windows so it CONNECT connects out to the SSH on the linux [on the public net] and hooks Charles up locally that way. Not sure if anyone every did this. – maxweber Feb 02 '15 at 16:22

1 Answers1

0

Very late answer but I managed to achieve this. I had a server that is publicly available and a laptop with Charles installed. I used SSH tunneling to forward the port on the server to my mac. Therefor I could use my Android phone to connect to this proxy using the public ip of my server. If this is what you wanted to accomplish it can be done using the following command:

ssh -R 9000:localhost:3000 user@example.com

In this case port 9000 is the server port that forwards to the localhost on the laptop on port 3000.

However there are a few things you might run into. the following setting should be in your sshd config file on your server.

GatewayPorts yes

And make sure your firewall or anything alike does not block the connection.

Hope this helps someone.

source: http://blog.trackets.com/2014/05/17/ssh-tunnel-local-and-remote-port-forwarding-explained-with-examples.html

Vuong Pham
  • 1,852
  • 1
  • 8
  • 6