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

Manipulating raw packets

The bin and packet NSE libraries must be mentioned now because they support methods that are useful when manipulating raw packets and generally when working with network I/O operations. In this section, we will learn about binary data strings, handy conversions supported by the libraries, and raw packet and frame generation.

Packing and unpacking binary data

Once you start working with network I/O operations, you'll quickly realize the need to encode binary data strings correctly. NSE has the bin library (http://nmap.org/nsedoc/lib/bin.html) that helps us pack and unpack formatted binary data strings. This library contains only the pack() and unpack() methods. We will learn how flexible and useful they are.

The following ...

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