brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: nmap script-help explains an NSE script before you run it

Nmap
~/tips/tip-nmap-script-help-before-run

nmap --script-help ssh2-enum-algos

Read what a script does and which categories it belongs to.

nmap comes with a large set of scripts, and their names don’t always say how gentle they are. I read the description first, which takes a few seconds:

nmap --script-help ssh2-enum-algos

It prints the script name, its categories and its description. Nothing is scanned. Wildcards work, which is handy for browsing a family of scripts:

nmap --script-help "http-*"

You can also combine names and categories in an expression:

nmap --script-help "ssl-* and safe"

The categories are the thing to look at. safe and discovery are the friendly ones. intrusive, brute, dos and exploit mean the script may hammer a service, try passwords, or crash it. Quote the pattern so your shell doesn’t expand the asterisk against files in the current folder.

A category label is a hint, and scripts are not sandboxed. The nmap documentation says some scripts in the default set are intrusive too, so -sC shouldn’t be run against a network without permission. If a script comes from somewhere other than the nmap project, read its source before you run it, especially with sudo.

Further reading: NSE usage and examples

More Nmap tips nmap --packet-trace -p 22,80 192.0.2.10 nmap -p 22,80,443 -oG scan.gnmap 192.0.2.0/24 nmap -sV 192.0.2.10 sudo nmap -sU -p 53,67,123,161 192.0.2.10 nmap -sL 192.0.2.0/28 All Nmap tips (12) All topics

Link