Nmap Development mailing list archives

Re: [nse] moving broadcast support to separate scripts


From: David Fifield <david () bamsoftware com>
Date: Mon, 1 Nov 2010 19:39:15 -0600

On Sat, Oct 30, 2010 at 04:37:15PM +0200, Patrik Karlsson wrote:
Hi all,

I've started splitting the broadcast/multicast scripts in order to be able to run them separately.
So far, I've done the dns-service-discovery and I'm working on the upnp scripts right now.
I largely underestimated the job as I thought I would only copy the common code to a library and split the script 
logic.
I wasn't happy with the result as the library turned out ugly as hell, so I re-wrote some parts and structured it 
using the same convention I've used in the past.

I'm attaching the new library and the two scripts and would appreciate *a lot* if we could get them commited really 
soon so I can finally cross this of my list.
In order to test it you need a device responding to mDNS like a printer, Mac or any linux distribution running Avahi 
Daemon.
for multicast do:
sudo ./nmap -sU -p 5353 --script broadcast-dns-service-discovery

for unicast do:
sudo ./nmap -sU -p 5353 --script dns-service-discovery <ip>

There must be some error in the files you sent. They are referring to a
dnssd library that wasn't attached.

$ sudo ./nmap --datadir . --script=broadcast-dns-service-discovery -sU -p 5353  -d
NSE: failed to initialize the script engine:
./nse_main.lua:372: ./scripts/broadcast-dns-service-discovery.nse:46: module 'dnssd' not found:

I tried renaming mdns.lua to dnssd.lua, but got the error

NSE: broadcast-dns-service-discovery threw an error!
./nselib/strict.lua:65: variable 'Helper' is not declared
stack traceback:
        [C]: in function 'error'
        ./nselib/strict.lua:69: in function <./nselib/strict.lua:60>
        ./nselib/strict.lua:65: in function <./nselib/strict.lua:60>
        ./scripts/broadcast-dns-service-discovery.nse:51: in function <./scripts/broadcast-dns-service-discovery.nse:50>
        (tail call): ?

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: