2011/3/26 Nick Nikolaou <nikolasnikolaou1 () gmail com>:
I made some changes to the script:
1. Added support for Djalal's interface patch. The user can now select
interface using -e. If an interface is not specified the script falls
to eth0. If that doesn't work it prints an error message.
2. The script now gets the local IP address using the
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.
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.
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