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

Hi,

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
perfect.

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

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


Current thread: