Book Image

Mastering the Nmap Scripting Engine

By : Paulino Calderon
Book Image

Mastering the Nmap Scripting Engine

By: Paulino Calderon

Overview of this book

Table of Contents (23 chapters)
Mastering the Nmap Scripting Engine
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Scan Phases
Script Categories
Nmap Options Mind Map
References
Index

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 prints a debug message:

    stdnse.debug2("This is a debug message shown for debugging level 2 or higher")
  • stdnse.verbose: This prints a formatted verbosity message:

    stdnse.verbose1("not running for lack of privileges.")
  • stdnse.strjoin: This joins a string...