Nmap Development mailing list archives

Re: [PATCH] Reset nping's default tcp flags in ProbeMode


From: "Luis MartinGarcia." <luis.mgarc () gmail com>
Date: Sat, 01 Jun 2013 12:45:58 +0200

Also, thanks, David, for reporting the bug in the first place ;-)

Regards,

Luis MartinGarcia.

On 06/01/2013 12:42 PM, Luis MartinGarcia. wrote:
Hi Josh,

You are absolutely right. The code in ProbeMode.cc is buggy and your
patch fixes the issue. Thanks for submitting the patch. I've just
applied it.

Best regards,

Luis MartinGarcia.

PS: I've also checked the nping's current experimental dev branch
(nmap-exp/luis/nmap-npingchanges) but the bug doesn't exist there, so no
need to apply it for that branch.

PS2: The bug was introduced in r26631, when changes from the nmap-os6
branch were merged into trunk. The bug was introduced in r25628, when
libnetutil/TCPHeader.cc was modified to make it set default TCP field
values.

Author: luis
Date: Thu Aug  4 10:51:37 2011
New Revision: 25628

Log:
Make TCPHeader set default header values

Modified:
   nmap-exp/luis/nmap-os6/libnetutil/TCPHeader.cc
   nmap-exp/luis/nmap-os6/libnetutil/TCPHeader.h


On 05/31/2013 12:24 AM, Josh Hunt wrote:
[resending from subscribed mail]

I'm not sure what the appropriate procedure is to submit a patch to nmap,
but the following seems to resolve the issue David found (reported in
thread "nping --tcp sends syn no matter what --flags option i set").

It appears that libnetutil's TCPHeader defaults to setting the tcp flags
to TCP_DEFAULT_FLAGS, which is defined as:

#define TCP_DEFAULT_FLAGS 0x02

I can resubmit if there's a formal patch submission process that I'm not
following.

Reported-by: David Young <dayoung () akamai com>
Signed-off-by: Josh Hunt <johunt () akamai com>

--- nping/ProbeMode.cc.orig 2013-05-30 20:22:24.000000000 +0000
+++ nping/ProbeMode.cc 2013-05-30 20:18:02.000000000 +0000
@@ -799,6 +799,7 @@
   t.setOffset();
   t.setWindow( o.getTCPWindow() );
   t.setUrgPointer(0);
+  t.setFlags(0);

   /* Flags */
   if( o.getFlagTCP(FLAG_CWR) == 1 )  t.setCWR();
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/
.


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


Current thread: