Lua is a dynamically interpreted scripting language characterized as fast, flexible, portable, small, and yet very powerful. It has been chosen for these very reasons by a variety of well-recognized projects in many industries, including information security. Nmap Scripting Engine (NSE) uses Lua to allow users to easily extend the capabilities of Nmap by writing scripts that have access to the information collected by the tool.
Entire books can be written about Lua and its wonderful flexibility and amazing features. This chapter will merely introduce you to the basics of what you need to know to start working on your own NSE scripts. If you would like to dig deeper into Lua after reading this chapter, I highly recommend checking out their online documentation at http://www.lua.org/docs.html, or supporting the project by buying one of their official books at http://www.lua.org/donations.html#books.
In this book, we will work with Lua 5.2 as this is the version included...