O'Reilly logo

Mastering the Nmap Scripting Engine by Paulino Calderón Pale

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Working with Network Sockets and Binary Data

Most NSE scripts need to communicate to other hosts to read or write data. Lua supports native network I/O operations, but there are several advantages to using the interfaces and libraries provided by the Nmap Scripting Engine (NSE). NSE sockets can be programmed as blocking or non-blocking I/O operations, and they support a connect-style method (when a client opens a connection, sends or receives data, and closes the connection) and low-level raw packet handling via a packet capture interface.

Nsock (http://sock-raw.org/nmap-ncrack/nsock.html) is an Nmap library designed to help developers handle parallelizable network I/O operations. It is used by the service detection engine, in DNS operations ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required