> For the complete documentation index, see [llms.txt](https://cajac.gitbook.io/ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cajac.gitbook.io/ctf-notes/enum/web-discovery/nmap-http-nse-scripts.md).

# Nmap HTTP NSE Scripts

The NSE scripts are located in the /usr/share/nmap/scripts directory.

## HTTP Discovery

To run all discovery scripts on common HTTP ports

```bash
nmap -v -p 80,443,8080 --script "http-* and discovery" $TARGET_IP
```

## HTTP Enumeration

To run basic enumeration on common HTTP ports

```bash
nmap -v -p 80,443,8080 --script http-enum $TARGET_IP
```

And specifically for Wordpress

```bash
nmap -v -p 80,443,8080 --script http-wordpress-enum $TARGET_IP
```

## HTTP Vulnerabilities

To run all vulnerability scripts on common HTTP ports

```bash
nmap -v -p 80,443,8080 -sV --script vuln $TARGET_IP
```

## List of HTTP Scripts <a href="#references" id="references"></a>

Nmap scripts are stored in the directory `/usr/share/nmap/scripts`. List of HTTP-related NSE scripts:

<table><thead><tr><th width="215">Name</th><th width="534">Description</th></tr></thead><tbody><tr><td><a href="https://nmap.org/nsedoc/scripts/http-auth.html">http-auth</a></td><td>Retrieves the authentication scheme and realm of a web service that requires authentication.</td></tr><tr><td><a href="https://nmap.org/nsedoc/scripts/http-backup-finder.html">http-backup-finder</a></td><td>Spiders a website and attempts to identify backup copies of discovered files. It does so by requesting a number of different combinations of the filename (eg. index.bak, index.html~, copy of index.html).</td></tr><tr><td><a href="https://nmap.org/nsedoc/scripts/http-comments-displayer.html">http-comments-displayer</a></td><td>Extracts and outputs HTML and JavaScript comments from HTTP responses.</td></tr><tr><td><a href="https://nmap.org/nsedoc/scripts/http-enum.html">http-enum</a></td><td>Enumerates directories used by popular web applications and servers.</td></tr><tr><td><a href="https://nmap.org/nsedoc/scripts/http-git.html">http-git</a></td><td>Checks for a Git repository found in a website's document root /.git/) and retrieves as much repo information as possible, including language/framework, remotes, last commit message, and repository description.</td></tr><tr><td><a href="https://nmap.org/nsedoc/scripts/http-methods.html">http-methods</a></td><td>Finds out what options are supported by an HTTP server by sending an OPTIONS request.</td></tr><tr><td><a href="https://nmap.org/nsedoc/scripts/http-robots.txt.html">http-robots.txt</a></td><td>Checks for disallowed entries in <code>/robots.txt</code> on a web server.</td></tr><tr><td><a href="https://nmap.org/nsedoc/scripts/http-security-headers.html">http-security-headers</a></td><td>Checks for the HTTP response headers related to security given in OWASP Secure Headers Project.</td></tr><tr><td><a href="https://nmap.org/nsedoc/scripts/http-vhosts.html">http-vhosts</a></td><td>Searches for web virtual hostnames by making a large number of HEAD requests against http servers using common hostnames.</td></tr><tr><td><a href="https://nmap.org/nsedoc/scripts/http-waf-detect.html">http-waf-detect</a></td><td>Attempts to determine whether a web server is protected by an IPS (Intrusion Prevention System), IDS (Intrusion Detection System) or WAF (Web Application Firewall) by probing the web server with malicious payloads and detecting changes in the response code and body.</td></tr><tr><td><a href="https://nmap.org/nsedoc/scripts/http-wordpress-enum.html">http-wordpress-enum</a></td><td>Enumerates themes and plugins of Wordpress installations.</td></tr></tbody></table>

## Script Help <a href="#references" id="references"></a>

You can get help about a specific NSE script with

```bash
nmap --script-help http-enum
```

To get help about several scripts you can use wildcards such as

```bash
nmap --script-help *http*
```

Or you can get help about all scripts in a specific category

```bash
nmap --script-help discovery
```

## Resources <a href="#references" id="references"></a>

NSEDoc Reference Portal: <https://nmap.org/nsedoc/index.html>

NSE Categories: <https://nmap.org/nsedoc/categories/>

NSE Scripts: <https://nmap.org/nsedoc/scripts/>
