Summary

Lua is a dynamically typed language that is perfect for quick scripting. It is very light, memory-safe, and offers useful functions for collaborative multitasking, pattern matching, data modelling, and string handling. Nmap uses Lua to power its scripting engine called NSE. In this chapter, I tried to provide the fundamentals of Lua for those who are not familiar with the language. I covered topics such as string manipulation, flow control structures, data types, and even special quirks in the language.

I firmly believe that, to truly master NSE, one must be able to debug and create NSE scripts. Those who do will have an invaluable tool at their disposal. In the next chapter, we will go deep into the core of NSE to learn its libraries, ...

Get Mastering the Nmap Scripting Engine 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.