nmap
ネットワーク
書き方
nmap [-sV] -p <ports> <target>相手の機械でどのポートが答えるかを走査します。`-sS` と `-O` は root が必要で、自分のものでない機械を走査すると相手の記録に攻撃として残り、国によっては違法なので自分の網だけに留めます。
よく使うオプション
| オプション | 意味 |
|---|---|
| -p 22,80,443 / -p- | Specific ports / all 65535 of them. |
| --top-ports 100 | The hundred most common ports, a good first pass. |
| -sS | SYN scan: fast and quiet, but needs root. |
| -sT | Full TCP connect scan, the fallback when you are not root. |
| -sV | Ask each open port what software and version it is. |
| -sn | Host discovery only, no port scan. |
| -Pn | Assume the host is up, for targets that ignore ping. |
| -oN <file> / -oX <file> | Save plain-text / XML output. |
例
nmap -p 22,80,443 192.168.1.10Check three ports on one machine.
nmap -sn 192.168.1.0/24List which addresses on the LAN are answering.
sudo nmap -sS -sV --top-ports 100 10.0.0.5Fast scan with service detection.
つながらないとき、どこまで行けたのかを絞ります — 名前が引けないのか、経路がないのか、ポートが閉じているのか。
読み方
- 角括弧 [ ] は省いてよい部分です。
- 三点 … は複数並べられるという意味です。
- オプションは大文字小文字を区別します — -r と -R が別物のコマンドもあります。
よくある質問
Q. nmap は何をしますか。
相手の機械でどのポートが答えるかを走査します。`-sS` と `-O` は root が必要で、自分のものでない機械を走査すると相手の記録に攻撃として残り、国によっては違法なので自分の網だけに留めます。
Q. どう打ちますか。
nmap [-sV] -p <ports> <target> — 角括弧は省いてよい部分です。
Q. よく使うオプションはいくつですか。
ここにまとめたのは8個です。全部は man nmap にあります。このコマンドはネットワークの仲間です。
関連するコマンド
man ページ: man nmap