O'Reilly logo

Mastering the Nmap Scripting Engine by Paulino Calderón Pale

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. NSE Script Template

This appendix includes an NSE script template that contains the required script fields scripts and the default licensing values:

description = [[
]]

---
-- @usage
-- 
-- @output
--
-- @args
--
---

author = ""
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {}

--portrule = 

action = function(host, port)

end

This template is available online in my GitHub repository, at https://github.com/cldrn/nmap-nse-scripts/blob/master/nse-script-template.nse.

Other templates online

The Nmap distribution also includes a pretty complete template made by Ron Bowes. It can be downloaded from a previous working copy of the development repository, at https://svn.nmap.org/nmap/docs/sample-script.nse?p=30373

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required