How to telnet via proxy authentication?

You could do what the browser does, i.e. connect to the proxy,

$ telnet proxy-server 3128

and talk to it. If there was no authentication, a simple GET request (followed by two newlines (Enter)) with a full hostname and protocol, e.g.

GET http://www.google.com/ HTTP/1.1

should suffice. Since you need authentication, you need to provide your username and password base64-encoded in a Proxy-Authentication header, e.g.

GET http://www.google.com/ HTTP/1.1
Proxy-Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

To create the base64 string, you could use echo -n username:password | openssl base64


You can use Proxychains for this.

First install proxychains, using the command:

$ apt-get install proxychains

Then configure your proxy settings in /etc/proxychains.conf file.

Add at last, these lines for HTTP and HTTPS proxy.

http    proxy-ip   proxy-port    username        password
https   proxy-ip   proxy-port    username        password

Now you can do telnet by using the following command:

$ proxychains telnet www.google.com 80