Use PuTTY behind a Proxy

8

6

I would like to use PuTTY behind a Proxy, but every time I try to access PuTTY, I get a black window with one green square and not able to input any kind of data...

enter image description hereenter image description here

What do I need to do to get access to my server using PuTTY? I can connect with my iPad, so no issues connecting to the server...

EDIT:
This is what my netstat looks like:
enter image description here

Michiel

Posted 2011-10-28T12:44:59.013

Reputation: 213

@billc.cn - any easy way to verify if the connect extension is enabled or not? – d-b – 2015-11-24T12:40:59.813

@user23122 A proxy that supoorts HTTPS would have it enabled, but it may still limit connecting to ports other than 443. – billc.cn – 2015-11-25T11:23:33.817

I'm behind a http, without s, proxy. How do I determine it in this case? – d-b – 2015-11-25T12:14:46.650

I was going to localhost (the machine at the other end of the proxy chain) and even though Exclude hosts was empty, I did need to check Consider proxying local host in case that's anyone else' issue as well – Hashbrown – 2019-08-31T06:45:49.187

You HTTP proxy must have the connect command enabled to use non-http protocols. – billc.cn – 2011-10-28T13:31:18.097

Do I get you right. It works with your iPad over the same proxy? – gabe – 2011-10-28T13:36:57.623

@gabe, no, my iPad is using the 3G connection, so no Proxy. – Michiel – 2011-10-28T13:41:15.870

1@billc.cn, what do you mean? – Michiel – 2011-10-28T13:41:32.627

A HTTP proxy by default can only relay http traffic. However, an extension in the standard (the CONNECT verb) allows the proxy server to connect to arbitrary port with arbitrary protocol. Because there's a risk that this connect feature is misused, it's not enabled on all HTTP proxies. You have to check with your admin if connect is allowed or ask for a SOCKS proxy. – billc.cn – 2011-10-28T15:22:47.333

Answers

6

This is most likely not the answer you want, but if your network admin has correctly configured the proxy, then you can't connect through it.

I am guessing they don't want to allow non-http(s) traffic, so there won't be much you can do about it. You could try running your ssh server on port 80 or port 443 and see if they allow you to connect to it that way.

freedenizen

Posted 2011-10-28T12:44:59.013

Reputation: 509

What about this? http://meinit.nl/using-putty-and-an-http-proxy-to-ssh-anywhere-through-firewalls Is this onto something that will work?

– Gabriel Staples – 2016-09-20T02:53:57.553

Is port forwarding from port 443 to port 22 in your home router the same as "running your ssh server on port...443?" – Gabriel Staples – 2016-09-21T15:06:39.533

Indeed. I checked with our IT-department. They don't allow non-http traffic. Too bad! – Michiel – 2011-10-29T12:10:55.197

0

I assume you are sure about the HTTP Proxy Setting and the Port

If not try with 8080 and the ip address instead of the dns name of the proxy

It could be a problem with putty not using the proxy you need to

  1. Load your saved session
  2. Set the Proxy
  3. Save your session

gabe

Posted 2011-10-28T12:44:59.013

Reputation: 311

It's the proxy address used by Google Chrome and predefined by the system settings (it's a companies laptop). I get an error if I do what you said... Proxy-error: Unable to resolve proxy host name – Michiel – 2011-10-28T13:29:42.313

often proxies have port 8080 are you sure its 80? – gabe – 2011-10-28T13:34:34.617

mine is 8080. But even with this setting configured, I get an the same error... – Michiel – 2011-10-28T13:42:35.010

I added some additional information. Maybe it will help – Michiel – 2011-10-28T13:49:16.517

-1

Check out https://github.com/Arno0x/PowerShellScripts

Specifically proxyTunnel.ps1

Tunnel in a "tunnel" scenario...

Update: If you edit the script you can use it with "oneclick" (right click > run with powershell), what you have to edit are 3 lines (4, if localhost is not suitable):

[String]$bindIP = "127.0.0.1", #localhost
[Int]$bindPort = 5555, #local port
[String]$destHost = "destination.host.name", #or IP address
[Int]$destPort = 443 #destination port

After script startup powershell will listen on port 5555, so you can configure putty to connect to localhost:5555, and powershell will proxy the packets to the destination. Of course you will have to experiment with ports, connection types, not all might allowed through the proxy.

In my case there is a squid proxy with kerberos authentication only, but powershell does the job just fine. At the destination I have a mikrotik router with ssh configured to port 443, but any other ssh server would work.

One thing I noticed so far (I discovered the script only yesterday) is that it will not revert to the listening state, so putty will not reconnect upon disconnect.

Of course, powershell is a Windows thing, so works only there...

István Máté

Posted 2011-10-28T12:44:59.013

Reputation: 1

2Can you provide more specifics about this PowerShell script for everyone else that doesn't understand the script itself? You can just edit your answer to provide that clarification. – Ramhound – 2016-12-06T15:19:08.370