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

Defining an Nmap script – script headers


Each Nmap script must be created with certain required variables defined at the beginning of the script. Any Nmap prerequisites that are needed for successful execution, definitions of how the script is categorized (for example, whether or not it is intrusive, safe, contains an exploit, and so on), and the license are also among the things necessary in the header.

The preceding screenshot illustrates the various sections necessary for an Nmap script, each of which are critical to the successful execution of the program. Let's walk through these elements in order to determine what the author of the script is doing.

First, several variables (defined by the local prefix) are defined. Several requirements are made in order to ensure that each of the Nmap elements are included appropriately.

Next, a longer variable—the description—is created. This is a multiline Lua variable, which is encapsulated in [[ and ]] brackets. This area is supposed to include a...