The Nmap scripts are written in Lua language
Location: /usr/share/nmap/scripts
Update Scripts: sudo nmap --script-updatedb
Help Menu: nmap --script-help <script-name>
NSE Reference Portal - Nmap Scripting Engine documentation
Usage and Examples | Nmap Network Scanning
Nmap Default Script Scan
Nmap Script Scan
Banner Grabbing
This scan is similar to service version scan but Nmap does not filter the information that it does not consider important
FTP Enumeration
FTP runs on port 21
ls -lah /usr/share/nmap/scripts | grep -e “ftp-” (List only ftp scripts)
Common Scripts
- ftp-anon : Check if anonymous login is available for FTP connection
- ftp-brute : Brute force connection using FTP (Not recommended use tool like Hydra)
- ftp-syst : Shows system information
- ftp-proftpd-backdoor, ftp-vsftpd-backdoor : Check if an backdoor connection to the system is possible (Intrusive scripts directly interacts with the system)
- ftp-vuln-cve2010-4221 : Checks for vulnerability (Always search what the vulnerability is applicable for before using. This one only applies to proftpd)
DNS Enumeration
Recommended to use SecLists when wordlist is needed.
”Zonetransfer.me” can be used to test and practice DNS attacks
Common Scripts
- dns-zone-transfer : Tries to perform zone transfer (copy dns details from one server to another. Only works on misconfigured servers)
- dns-brute : Brute force the dns to gather information (Recommended over zone transfer)
SMTP Enumeration
SMTP runs on port 25
ls -lah /usr/share/nmap/scripts | grep -e “smtp-” (List only smtp scripts)
Common Scripts
- smtp-commands : Lists all the supported SMTP commands (VRFY, EXPN can be exploited to enumerate usernames)
- smtp-enum-users : Enumerate users on the system
- smtp-open-relay : Check if open relay is enabled which can be used to bypass authentication
HTTP Enumeration
HTTP runs on port 80. HTTPS runs on port 443
ls -lah /usr/share/nmap/scripts | grep -e “http-” (List only http scripts)
Common Scripts
- http-methods : Returns the methods that are running of the server
- http-enum : Enumerate hidden directories on the server (Similar to dirbuster/gobuster)
- http-waf-detect : Detect web application firewall
- http-waf-fingerprint : Identify the version/ type of firewall running
http-waf-detect will return an payload when run on browser will return the firewall name
SMB (Service Message Block) Enumeration
SMB runs on port 445
ls -lah /usr/share/nmap/scripts | grep -e “smb-” (List only SMB scripts)
Common Scripts
- smb-os-discovery : Find the OS running on the system
- smb-enum-shares : List all the shares (Shared folders/ drives, etc.) on the system along with their permissions
- smb-enum-users : Find users on the system
- smb-protocols : Returns the version of the SMB protocol running on the system
- smb-vuln-ms17-010 : Eternal blue remote execution exploit
MySQL Enumeration
MySQL runs on port 3306
Common Scripts
- mysql-info : Returns information about the server
- mysql-enum : Try to guess usernames from the service
- mysql-empty-password : Checks if any user ha empty password
- mysql-brute : Try to brute force users on the system
NFS (Network File Share) Enumeration
Port 111 with have RPCBind Server which converts the RPC Address to Universal Address ls -lah /usr/share/nmap/scripts | grep -e “nfs-”
Common Scripts
- nfs-ls : Returns files on NTS
- nfs-showmount : Show the Mounted Directories on NTS
- nfs-statsfs : Return information about the NFS File System
Vulnerability Scan (External Scripts)
GitHub - vulnersCom/nmap-vulners: NSE script based on Vulners.com API