Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering the Nmap Scripting Engine

You're reading from   Mastering the Nmap Scripting Engine Master the Nmap Scripting Engine and the art of developing NSE scripts

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781782168317
Length 244 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Paulino Calderon Paulino Calderon
Author Profile Icon Paulino Calderon
Paulino Calderon
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Mastering the Nmap Scripting Engine
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
1. Introduction to the Nmap Scripting Engine FREE CHAPTER 2. Lua Fundamentals 3. NSE Data Files 4. Exploring the Nmap Scripting Engine API and Libraries 5. Enhancing Version Detection 6. Developing Brute-force Password-auditing Scripts 7. Formatting the Script Output 8. Working with Network Sockets and Binary Data 9. Parallelism 10. Vulnerability Detection and Exploitation Scan Phases
NSE Script Template Script Categories
Nmap Options Mind Map
References
Index

Quick notes about Lua


Now we will cover other concepts in Lua. If you are familiar with other scripting languages, you will find this section very useful because it aims to get you familiar with topics such as comments, array indexes, semantics, and data types.

Comments

A comment can be anything between two hyphens and the end of the line:

--This is a comment

Comment blocks are also supported. They are delimited by the --[[ and ]] characters:

--[[
This is a multi-line 
comment block.
]]

Dummy assignments

There are occasions when you don't need all the information returned by a function; in Lua, you can use dummy assignments to discard a return value. The operator is _ (underscore). For example, in the following code line, we discard the first two return values of string.find and store only the third value:

local _, _, item = string.find(<string>, <pattern with capture>) 

Indexes

Indexes start at one, not zero:

z={"a","b","c"}
z[1]="b" --This assignment will change the content of the table...
lock icon The rest of the chapter is locked
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering the Nmap Scripting Engine
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime
Modal Close icon
Modal Close icon