> For the complete documentation index, see [llms.txt](https://ghoulsec.gitbook.io/Toolbase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ghoulsec.gitbook.io/Toolbase/network-scanning-enumaration-and-vulnerability-detection-tools/nmap/nmap-scripting-engine.md).

# Nmap Scripting Engine

#### Perform a Script Scan Using Default Scripts (`-sC`)

**Explanation:** This runs a script scan using Nmap's default set of scripts, equivalent to `--script=default`.

```bash
nmap -sC <target>
```

#### Run Specific Scripts (`--script <filename>|<category>|<directory>/|<expression>[,...]`)

**Explanation:** This option allows you to run specific scripts by filename, category, or directory. You can use expressions to select scripts more precisely.

```bash
nmap --script "http-*" <target>
```

#### Provide Arguments to Scripts (`--script-args <n1>=<v1>,<n2>=<v2>,...`)

**Explanation:** This allows you to pass arguments to NSE scripts in the form of name=value pairs.

```bash
nmap --script-args "user=foo,pass=bar" --script http-brute <target>
```

#### Load Arguments from a File (`--script-args-file <filename>`)

**Explanation:** This loads arguments to scripts from a file instead of passing them directly on the command line.

```bash
nmap --script-args-file /path/to/args.txt <target>
```

#### Show Help for Scripts (`--script-help <filename>|<category>|<directory>|<expression>|all[,...]`)

**Explanation:** This shows help for specific scripts or categories, providing details like their descriptions and usage.

```bash
nmap --script-help default <target>
```

#### Trace Script Activity (`--script-trace`)

**Explanation:** This option prints detailed communication data for scripts, including both incoming and outgoing packets.

```bash
nmap --script-trace -sC <target>
```

#### Update the Script Database (`--script-updatedb`)

**Explanation:** This updates the Nmap script database, which is necessary if you add, remove, or modify NSE scripts.

```bash
nmap --script-updatedb
```
