Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Based on the long search in net I came to know that SOCKS uses a handshake protocol to inform the proxy software about the connection that the client is trying to make, and then acts as transparently as possible, whereas an HTTP proxy may interpret and rewrite headers. And we can use both as well.

What I want to know is, how can we find if the proxy is HTTP, SOCKS4, SOCKS4a or SOCKS5? Is there any way to find out? And I can guess that we can't differ it based on port number because there are lot of port numbers available for each of the types. Please help me to differ the proxy based on HTTP or SOCKS.

share|improve this question

Try this little python script:

$ cat 

import struct
import socket
import sys

        server = sys.argv[1]
        port = sys.argv[2]
        print "Usage: server port"

        sen = struct.pack('BBB', 0x05, 0x01, 0x00)
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect(( server , int( port )  ))
        data = s.recv(2)
        version, auth = struct.unpack('BB', data)
        print 'server : port  is  ', server, ':', port, '; varsion: ', version
except Exception as e:
        print e
share|improve this answer

You could try using the tool 'nmap' to attempt to detect the version of the service on that port.

For instance: nmap -sV -p{port} {server}

In the below sample, you can see that it's a HTTP (versus SOCKS) proxy:

my-desktop ~ # nmap -sV -p8080

Starting Nmap 6.40 ( ) at 2016-02-23 10:46 CST Nmap scan report for Host is up (0.00036s latency). PORT STATE SERVICE VERSION 8080/tcp open http-proxy Squid http proxy 3.3.8

Service detection performed. Please report any incorrect results at . Nmap done: 1 IP address (1 host up) scanned in 7.45 seconds

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .