Book Image

NMAP Essentials

By : David Shaw
Book Image

NMAP Essentials

By: David Shaw

Overview of this book

Table of Contents (17 chapters)
Nmap Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Anatomy of an Nmap script


An Nmap script is comprised of several unique sections, each of which define different areas for the script to execute, or for Nmap to interpret expected output. There are several primary areas that we must always include in any script we create, in order to ensure that the script will run effectively (and that Nmap will be able to understand how to interpret the data).

Although Nmap scripts are written in Lua, an interpreted programming language, it's important to remember that these scripts are not stand-alone executables that can be run on their own. Rather than running a script with Nmap as a requirement, it's better to think of Nmap scripts as simply sets of instructions for a unique Nmap programming language.

An Nmap script is comprised of three unique sections:

  • The head: This section of an Nmap script includes documentation and categorization for the script so that Nmap and the NSE database can successfully categorize the script into the appropriate areas.

  • ...