Nmap Development mailing list archives

Re: [NSE patch] port or service not matching ports


From: Sven Klemm <sven () c3d2 de>
Date: Fri, 04 Jan 2008 16:54:47 +0100

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sven Klemm wrote:
Hi everyone,

the port_or_service function in the shortport library does not match
ports because the port variable passed to portnumber is shadowed by
the variable passed during portrule check. The attached patch fixes
this behaviour.

You can verify the bug with the following lua code:

sven@pinealgland:code/nmap/nselib> lua
Lua 5.1.2  Copyright (C) 1994-2007 Lua.org, PUC-Rio
require 'shortport'
print(
shortport.port_or_service(80,{})({},{protocol='tcp',state='open',number=80})
)
false


The function returned by port_or_service does not return true for port
80 even though it has been created for port 80. With the patch
applied the port_or_service function correctly returns the expected
results for numerical ports.

Cheers,
Sven

- --
Sven Klemm
http://cthulhu.c3d2.de/~sven/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHflbHevlgTHEIT4YRAuE5AJ954LXz/lBDQhEmXwzK7PtIqaPHegCfYud0
GBvPq7ex/nELoXrNfBBGq7k=
=RsOd
-----END PGP SIGNATURE-----

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


Current thread: