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

Examples of version detection scripts

Now we will briefly cover a few examples of different NSE version scripts to familiarize ourselves with the structure and required components.

NSE script – modbus-discover

The modbus-discover script was written by Alexander Rudakov to retrieve device information through the modbus protocol. Modbus is very popular among Supervisory Control And Data Acquisition (SCADA) systems. The script attempts to discover valid Slave IDs (SIDs) and retrieve additional device information:

action = function(host, port) -- If false, stop after first sid. local aggressive = stdnse.get_script_args('modbus-discover.aggressive') local opts = {timeout=2000} local results = {} for sid = 1, 246 do stdnse.print_debug(3, "Sending command ...

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