You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nmap is known for its ability to send and receive raw packets. NSE is known for enabling script authors to succinctly craft powerful networking scripts. But trying to send and receive raw packets in NSE is fraught with problems:
Limited support for raw network packets depending on platform. Windows does not support this, but does support raw Ethernet frames, so we ought to make a mostly-transparent overlay for this via the ip_open() function.
Packet crafting routines are duplicated between Lua (nselib/packet.lua and scattered throughout various scripts) and C++ (libnetutil, which has no Lua bindings). It's been a TODO item for a while to see about unifying these by binding libnetutil to Lua.
Scripts which want to receive replies to their raw packets must manage coroutines (worker threads) and pcap handles in a specific way. We could probably consolidate a lot of duplicate code that has been written for this purpose into a library. A possible interface would be to define startup and teardown functions, a packet filter, a timeout, and a received-packet handler function, then call some sort of run() function to start the whole thing.
Stretch goal: extend Nsock's pcap support to allow pcap WRITE requests via pcap_inject() or pcap_sendpacket(). Then we can use that in most layer-2 cases where we use libdnet currently. Not sure what the caveats would be in that case; would have to compare code behind pcap_inject() and libdnet's eth_send().
The text was updated successfully, but these errors were encountered:
Nmap is known for its ability to send and receive raw packets. NSE is known for enabling script authors to succinctly craft powerful networking scripts. But trying to send and receive raw packets in NSE is fraught with problems:
ip_open()
function.nselib/packet.lua
and scattered throughout various scripts) and C++ (libnetutil
, which has no Lua bindings). It's been a TODO item for a while to see about unifying these by binding libnetutil to Lua.run()
function to start the whole thing.Stretch goal: extend Nsock's pcap support to allow pcap WRITE requests via
pcap_inject()
orpcap_sendpacket()
. Then we can use that in most layer-2 cases where we use libdnet currently. Not sure what the caveats would be in that case; would have to compare code behindpcap_inject()
and libdnet'seth_send()
.The text was updated successfully, but these errors were encountered: