Mastering the Nmap Scripting Engine
eBook - ePub

Mastering the Nmap Scripting Engine

Paulino Calderon Pale

Condividi libro
  1. 244 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Mastering the Nmap Scripting Engine

Paulino Calderon Pale

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Mastering the Nmap Scripting Engine è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Mastering the Nmap Scripting Engine di Paulino Calderon Pale in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Cyber Security. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2015
ISBN
9781782168317

Mastering the Nmap Scripting Engine


Table of Contents

Mastering the Nmap Scripting Engine
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introduction to the Nmap Scripting Engine
Installing Nmap
Building Nmap from source code
Keeping Nmap up to date
Running NSE scripts
Script categories
NSE script selection
Selecting by script name or category
Selecting by filename or folder
Advanced script selection with expressions
NSE script arguments
Loading script arguments from a file
Forcing the execution of NSE scripts
Debugging NSE scripts
Scan phases and NSE
NSE script rules
Applications of NSE scripts
Information-gathering
Collecting UPNP information
Finding all hostnames resolving to the same IP address
Advanced host discovery
Discovering hosts with broadcast pings
Listening to your LAN to discover targets
Password auditing
Brute-forcing MySQL passwords
Brute-forcing SMTP passwords
Vulnerability scanning
Detecting insecure MySQL server configurations
Detecting web servers vulnerable to slow denial-of-service attacks
Detecting SSL servers vulnerable to CVE-2014-3566
Setting up a development environment
Halcyon IDE
Adding new scripts
Summary
2. Lua Fundamentals
Quick notes about Lua
Comments
Dummy assignments
Indexes
Semantics
Coercion
Safe language
Booleans
Flow control structures
Conditional statements – if-then, else, and elseif
Loops – while
Loops – repeat
Loops – for
Data types
String handling
Character classes
Magic characters
Patterns
Captures
Repetition operators
Concatenation
Finding substrings
String repetition
String length
Formatting strings
Splitting and joining strings
Common data structures
Tables
Arrays
Linked lists
Sets
Queues
Custom data structures
http-enum database
http-default-accounts
I/O operations
Modes
Opening a file
Reading a file
Writing a file
Closing a file
Coroutines
Creating a coroutine
Executing a coroutine
Determining the running coroutine
Getting the status of a coroutine
Yielding a coroutine
Metatables and metamethods
Arithmetic metamethods
Relational metamethods
Summary
3. NSE Data Files
Locating your data directory
Data directory search order
Username and password lists used in brute-force attacks
Username dictionaries
Password dictionaries
Web application auditing data files
http-fingerprints.lua
http-sql-errors.lst
http-web-files-extensions.lst
http-devframework-fingerprints.lua
http-folders.txt
vhosts-default.lst
wp-plugins.lst
DBMS-auditing data files
mysql-cis.audit
oracle-default-accounts.lst
oracle-sids
Java Debug Wire Protocol data files
JDWPExecCmd.java
JDWPSystemInfo.class
Other NSE data files
mygroupnames.db
rtsp-urls.txt
snmpcommunities.lst
ssl-ciphers
ssl-fingerprints
ike-fingerprints.lua
tftplist.txt
Other Nmap data files
Summary
4. Exploring the Nmap Scripting Engine API and Libraries
Understanding the structure of an NSE script
Other NSE script fields
Author
License
Dependencies
A sample NSE script
Exploring environment variables
Accessing the Nmap API
NSE arguments
Host table
Port table
Exception handling in NSE scripts
The NSE registry
Writing NSE libraries
Extending the functionality of an NSE library
NSE modules in C/C++
Exploring other popular NSE libraries
stdnse
openssl
target
shortport
creds
vulns
http
Summary
5. Enhancing Version Detection
Understanding version detection mode in NSE
Phases of version detection
Adjusting the rarity level of a version scan
Updating the version probes database
Taking a closer look at the file format
Excluding scanned ports from version detection
Using fallbacks to match other version probes
Getting to know post-processors
Nmap Scripting Engine
SSL
Writing your own version detection scripts
Defining the category of a version detection script
Defining the portrule of a version detection script
Updating the port version information
Setting the match confidence level
Examples of version detection scripts
NSE script – modbus-discover
NSE script – ventrilo-info
NSE script – rpc-grind
Summary
6. Developing Brute-force Password-auditing Scripts
Working with the brute NSE library
Selecting a brute mode
Implementing the Driver class
Passing library and user options
Returning valid accounts via Account objects
Handling execution errors gracefully with the Error class
Reading usernames and password lists with the unpwdb NSE library
Managing user credentials found during scans
Writing an NSE script to launch password-auditing attacks against the MikroTik RouterOS API
Summary
7. Formatting the Script Output
Output formats and Nmap Scripting Engine
XML structured output
Implementing structured output in your scripts
Printing verbosity messages
Including debugging information
The weakness of the grepable format
NSE script output in the HTML report
Summary
8. Working with Network Sockets and Binary Data
Work...

Indice dei contenuti