Nmap Development mailing list archives

Re: [nmap-svn] r19919 - ncat


From: David Fifield <david () bamsoftware com>
Date: Sat, 21 Aug 2010 23:30:09 -0600

On Sat, Aug 21, 2010 at 10:28:10PM -0700, commit-mailer () insecure org wrote:
Author: david
Date: Sat Aug 21 22:28:10 2010
New Revision: 19919

Log:
Change the length of a socks4 response to 8 (was 7). I'm not sure why it was 7
in the first place. Conecting through a "ssh -D" proxy, the proxy was returning
8 bytes, Ncat was reading the first 7 and passing the 8th on to the data
connection.


Modified:
   ncat/ncat_connect.c

Modified: ncat/ncat_connect.c
==============================================================================
--- ncat/ncat_connect.c       (original)
+++ ncat/ncat_connect.c       Sat Aug 21 22:28:10 2010
@@ -549,7 +549,7 @@
         } else if (socksconnect.storage.ss_family != AF_UNSPEC) {
             struct socket_buffer stateful_buf;
             struct socks4_data socks4msg;
-            char socksbuf[7];
+            char socksbuf[8];
 
             connect_socket = do_connect(SOCK_STREAM);
             if (connect_socket == -1) {
@@ -579,9 +579,9 @@
                 loguser("Error sending proxy request: %s.\n", socket_strerror(socket_errno()));
                 return 1;
             }
-            /* The size of the socks4 response is 7 bytes. So read exactly
-               7 bytes from the buffer */
-            if (socket_buffer_readcount(&stateful_buf, socksbuf, 7) < 0) {
+            /* The size of the socks4 response is 8 bytes. So read exactly
+               8 bytes from the buffer */
+            if (socket_buffer_readcount(&stateful_buf, socksbuf, 8) < 0) {
                 loguser("Error: short reponse from proxy.\n");
                 return 1;
             }

Venkat, I believe that you implemented this. Do you remember why you had
it reading only 7 bytes instead of 8? Was is just a mistake?

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: