Nmap Development mailing list archives

Re: [NSE] Draft - targets-sniffer.nse


From: Henri Doreau <henri.doreau () greenbone net>
Date: Sat, 26 Mar 2011 17:13:37 +0100

2011/3/26 Nick Nikolaou <nikolasnikolaou1 () gmail com>:
Hey guys,

I made some changes to the script:

1. Added support for Djalal's interface patch. The user can now select the
interface using -e. If an interface is not specified the script falls back
to eth0. If that doesn't work it prints an error message.

2. The script now gets the local IP address using the get_interface_info()
function and makes sure that it's never added to newtargets.

3. Since nmap checks for duplicates when adding the IP addresses to
newtargets, there no reason for the script to do it.

4. The script now prints an error message when not ran as root.

Thanks for your feedback.

Hi Nick,

thanks for working on this script! Here is some feedback after I have
quickly read the code.

- I am not so fan of having code out of functions, you can hardly know
when it will exactly be executed...  You should refactor this and
initialize things from whithin the rule/action functions.

- The indentation makes it difficult to read!

I still couldn't get the socket to timeout properly which seems to be the
main problem at the moment. I'm also having some trouble getting the IP
addresses using the packet library.

As Kris and I already suggested, you should have a look at
firewalk.nse, ipidseq.nse, path-mtu.nse, qscan.nse or
sniffer-detect.nse that make use of the packet library to build packet
objects from pcap (look for packet.Packet:new()). These scripts might
help you to fix both problems.


Once again, I appreciate any feedback.


Cheers,
Nick

Regards.

-- 
Henri Doreau |  Greenbone Networks GmbH  |  http://www.greenbone.net
Neuer Graben 17, 49074 Osnabrueck, Germany | AG Osnabrueck, HR B 202460
Executive Directors: Lukas Grunwald, Dr. Jan-Oliver Wagner
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: