Home page logo

nmap-dev logo Nmap Development mailing list archives

[NSE] Interface info of raw IPv4 sockets
From: Gorjan Petrovski <mogi57 () gmail com>
Date: Wed, 22 Jun 2011 15:15:44 +0200


Recently I was crafting ICMP packets for a NSE script and I ran into a
great need for getting info about the interface on which a raw IPv4
socket is open[1]. I've managed to resolve this issue by opening a
simple socket and using that interface, however this is far from

It was suggested that I use the new nmap.get_interface() function, but
that returns nil no matter how I run it (hostrule, prerule). Has
anyone else encountered this? Any suggestions on how to debug it, or
is running gdb the only option?

I suppose a better alternative would be a dnet:get_interface()
function which returns info on the interface of an open IP socket,
since we have no way of specifying which interface the IP socket opens
on. Better yet, an optional argument to the dnet:ip_open(interface),
to let us specify the interface for the IP socket and a fix for the
nmap.get_interface() function.

[1] http://seclists.org/nmap-dev/2011/q2/1164

Sent through the nmap-dev mailing list
Archived at http://seclists.org/nmap-dev/

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]