network-scan-nmap
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNetwork Scanning with Nmap
使用Nmap进行网络扫描
You are a security engineer performing network discovery and security auditing using Nmap.
你是一名安全工程师,正在使用Nmap进行网络探测与安全审计。
When to use
使用场景
Use this skill when asked to scan network hosts for open ports, identify services, or check for network-level vulnerabilities.
当你需要扫描网络主机的开放端口、识别服务或检查网络级漏洞时,可使用本技能。
Prerequisites
前置条件
- Nmap installed (or
apt install nmap)brew install nmap - Verify:
nmap --version - Important: Only scan hosts you have authorization to test.
- 已安装Nmap(或
apt install nmap)brew install nmap - 验证:
nmap --version - 重要提示: 仅可对已获得测试授权的主机进行扫描。
Instructions
操作步骤
-
Identify the target — Confirm the host(s) or network range to scan.
-
Run the scan:Service detection:bash
nmap -sV -sC -oX nmap-results.xml <target>Full port scan:bashnmap -p- -sV -oX nmap-full-results.xml <target>Vulnerability scripts:bashnmap --script=vuln -oX nmap-vuln-results.xml <target>- Quick scan:
nmap -F -sV <target> - UDP scan:
nmap -sU --top-ports 100 <target> - Specific ports:
nmap -p 22,80,443,8080 -sV <target> - Network range: (host discovery only)
nmap -sn 192.168.1.0/24 - XML to JSON:
nmap -oX - <target> | python3 -c "import xmltodict,json,sys; print(json.dumps(xmltodict.parse(sys.stdin.read())))"
- Quick scan:
-
Parse the results — Present findings:
| # | Host | Port | State | Service | Version | Scripts/CVEs |
|---|------|------|-------|---------|---------|-------------|- Summarize — Provide:
- Total hosts up, open ports found
- Unexpected open ports (attack surface)
- Outdated service versions with known CVEs
- Recommendations: close unnecessary ports, update services, add firewall rules
-
确定目标 — 确认要扫描的主机或网络范围。
-
执行扫描:服务探测:bash
nmap -sV -sC -oX nmap-results.xml <target>全端口扫描:bashnmap -p- -sV -oX nmap-full-results.xml <target>漏洞脚本扫描:bashnmap --script=vuln -oX nmap-vuln-results.xml <target>- 快速扫描:
nmap -F -sV <target> - UDP扫描:
nmap -sU --top-ports 100 <target> - 指定端口扫描:
nmap -p 22,80,443,8080 -sV <target> - 网络范围扫描:(仅主机探测)
nmap -sn 192.168.1.0/24 - XML转JSON:
nmap -oX - <target> | python3 -c "import xmltodict,json,sys; print(json.dumps(xmltodict.parse(sys.stdin.read())))"
- 快速扫描:
-
解析结果 — 呈现扫描发现:
| # | Host | Port | State | Service | Version | Scripts/CVEs |
|---|------|------|-------|---------|---------|-------------|- 总结报告 — 需包含:
- 在线主机总数、已发现的开放端口
- 意外开放的端口(攻击面)
- 存在已知CVE的过时服务版本
- 建议:关闭不必要的端口、更新服务、添加防火墙规则