Extending Nmap Capabilities
The Nmap Scripting Engine (NSE) allows users to write and execute simple scripts (written in the Lua programming language) to automate a huge variety of networking tasks beyond basic discovery.
NSE Use Cases
- Vulnerability Detection: Checking if a server is vulnerable to a specific, known exploit.
- Brute Force: Attempting to guess weak credentials on services like FTP or SSH.
- Service Enumeration: Performing deep queries against specific services (e.g., listing SMB shares).
- Infection Detection: Checking web servers for signs of compromise.
Running Scripts (--script)
Scripts are categorized. You can run individual scripts, or all scripts within a category (e.g., vuln, auth, dos).
Example: Running basic vulnerability checks and safe scripts (default category):
bash nmap -sV -sC 192.168.1.100
or
nmap -sV --script default 192.168.1.100