Exploring other popular NSE libraries

Let's briefly review some of the most common libraries that you will likely need during the development of your own scripts. There are 107 available libraries at the moment, but the following libraries must be remembered at all times when developing your own scripts in order to improve their quality.

stdnse

This library contains miscellaneous functions useful for NSE development. It has functions related to timing, parallelism, output formatting, and string handling.

The functions that you will most likely need in a script are as follows:

  • stdnse.get_script_args: This gets script arguments passed via the --script-args option:
    local threads = stdnse.get_script_args(SCRIPT_NAME..".threads") or 3
  • stdnse.debug: This ...

Get Mastering the Nmap Scripting Engine now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.