Nmap Development mailing list archives

Re: [nse] moving broadcast support to separate scripts


From: Patrik Karlsson <patrik () cqure net>
Date: Tue, 2 Nov 2010 09:23:33 +0100


On 2 nov 2010, at 02.39, David Fifield wrote:

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

*SIGH* Sorry for that! I've attached the correct files to this e-mail.

Attachment: broadcast-dns-service-discovery.nse
Description:

Attachment: dns-service-discovery.nse
Description:

Attachment: dnssd.lua
Description:



//Patrik

--
Patrik Karlsson
http://www.cqure.net
http://www.twitter.com/nevdull77





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

Current thread: