Detecting whether a proxy is HTTP or SOCKS












0















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





























    0















    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



























      0












      0








      0


      2






      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
















      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.







      proxy c# socks-proxy http-proxy






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 19 '13 at 11:31









      Jawa

      3,15982435




      3,15982435










      asked Aug 19 '13 at 10:57









      yasmuruyasmuru

      10113




      10113






















          2 Answers
          2






          active

          oldest

          votes


















          0














          Try this little python script:



          $ cat get_version.py 
          #!/usr/bin/python

          import struct
          import socket
          import sys


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

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





          share|improve this answer































            0














            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 192.168.3.40



            Starting Nmap 6.40 ( http://nmap.org ) at 2016-02-23 10:46 CST
            Nmap scan report for 192.168.3.40
            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 http://nmap.org/submit/ .
            Nmap done: 1 IP address (1 host up) scanned in 7.45 seconds




            https://nmap.org/book/man-version-detection.html






            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "3"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f633639%2fdetecting-whether-a-proxy-is-http-or-socks%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              Try this little python script:



              $ cat get_version.py 
              #!/usr/bin/python

              import struct
              import socket
              import sys


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

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





              share|improve this answer




























                0














                Try this little python script:



                $ cat get_version.py 
                #!/usr/bin/python

                import struct
                import socket
                import sys


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

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





                share|improve this answer


























                  0












                  0








                  0







                  Try this little python script:



                  $ cat get_version.py 
                  #!/usr/bin/python

                  import struct
                  import socket
                  import sys


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

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





                  share|improve this answer













                  Try this little python script:



                  $ cat get_version.py 
                  #!/usr/bin/python

                  import struct
                  import socket
                  import sys


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

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






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 31 '13 at 22:38









                  innocent-worldinnocent-world

                  1412




                  1412

























                      0














                      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 192.168.3.40



                      Starting Nmap 6.40 ( http://nmap.org ) at 2016-02-23 10:46 CST
                      Nmap scan report for 192.168.3.40
                      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 http://nmap.org/submit/ .
                      Nmap done: 1 IP address (1 host up) scanned in 7.45 seconds




                      https://nmap.org/book/man-version-detection.html






                      share|improve this answer




























                        0














                        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 192.168.3.40



                        Starting Nmap 6.40 ( http://nmap.org ) at 2016-02-23 10:46 CST
                        Nmap scan report for 192.168.3.40
                        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 http://nmap.org/submit/ .
                        Nmap done: 1 IP address (1 host up) scanned in 7.45 seconds




                        https://nmap.org/book/man-version-detection.html






                        share|improve this answer


























                          0












                          0








                          0







                          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 192.168.3.40



                          Starting Nmap 6.40 ( http://nmap.org ) at 2016-02-23 10:46 CST
                          Nmap scan report for 192.168.3.40
                          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 http://nmap.org/submit/ .
                          Nmap done: 1 IP address (1 host up) scanned in 7.45 seconds




                          https://nmap.org/book/man-version-detection.html






                          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 192.168.3.40



                          Starting Nmap 6.40 ( http://nmap.org ) at 2016-02-23 10:46 CST
                          Nmap scan report for 192.168.3.40
                          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 http://nmap.org/submit/ .
                          Nmap done: 1 IP address (1 host up) scanned in 7.45 seconds




                          https://nmap.org/book/man-version-detection.html







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Feb 23 '16 at 17:04









                          maniacmaniac

                          761




                          761






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Super User!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f633639%2fdetecting-whether-a-proxy-is-http-or-socks%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                              Mangá

                              Eduardo VII do Reino Unido