How do it…

Perform the following steps:

  1. Open a text editor and define three sections, Head, Rule, and Action, as shown in the following screenshot:

  1. Let's start with the Head section. The following are the parameters which are to be mentioned in the Head section with the following code:
-- Headdescription = [[Sample script to check whether default apache files are present]]author = "Jetty"license = "Same as Nmap--See http://nmap.org/book/man-legal.html"categories = {"default", "safe"}-- Rule-- Action
  1. Now, let's define the libraries required for the script to function by using the following code:
local shortport = require "shortport"

Get Network Scanning Cookbook 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.