Back to course

Nmap Scripting Engine (NSE) Basics

Cyber Security Mastery: From Zero to Hero

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

  1. Vulnerability Detection: Checking if a server is vulnerable to a specific, known exploit.
  2. Brute Force: Attempting to guess weak credentials on services like FTP or SSH.
  3. Service Enumeration: Performing deep queries against specific services (e.g., listing SMB shares).
  4. 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