Recon Nmap 标志

Recon Nmap

组织
AgentSecOps
recon-nmap

使用 Nmap 进行网络侦察和安全审计,包括端口扫描、服务枚举和漏洞检测。适用于:(1)开展经授权的网络侦察和资产发现;(2)枚举网络服务并识别运行版本;(3)通过 NSE 脚本检测安全漏洞;(4)绘制网络拓扑并识别防火墙规则;(5)开展合规扫描以进行安全评估;(6)验证网络分段和访问控制。

Add to TypingMind

概览

发布者AgentSecOps
代码仓库SecOpsAgentKit
技能名称recon-nmap
星标数
225
复刻数
44
附带文件
4
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 4 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 AgentSecOps 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Recon Nmap AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/AgentSecOps/SecOpsAgentKit/tree/main/skills/offsec/recon-nmap
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AgentSecOps/SecOpsAgentKit.git /tmp/SecOpsAgentKit
mkdir -p .claude/skills
cp -r /tmp/SecOpsAgentKit/skills/offsec/recon-nmap .claude/skills/recon-nmap
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Recon Nmap,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Recon Nmap。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Recon Nmap 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Nmap Network Reconnaissance

Overview

Nmap (Network Mapper) is the industry-standard tool for network discovery, security auditing, and vulnerability assessment. This skill provides structured workflows for authorized reconnaissance operations including port scanning, service enumeration, OS fingerprinting, and vulnerability detection using Nmap Scripting Engine (NSE).

IMPORTANT: Network scanning may be disruptive and must only be conducted with proper authorization. Always ensure written permission before scanning networks or systems you do not own.

Quick Start

Basic host discovery and port scanning:

bash
# Quick scan of common ports
nmap -F <target-ip>

# Scan top 1000 ports with service detection
nmap -sV <target-ip>

# Comprehensive scan with OS detection and default scripts
nmap -A <target-ip>

Core Workflow

Network Reconnaissance Workflow

Progress: [ ] 1. Verify authorization and scope [ ] 2. Perform host discovery and asset enumeration [ ] 3. Conduct port scanning on live hosts [ ] 4. Enumerate services and versions [ ] 5. Perform OS fingerprinting and detection [ ] 6. Run NSE scripts for vulnerability detection [ ] 7. Document findings and generate reports [ ] 8. Validate results and identify false positives

Work through each step systematically. Check off completed items.

1. Authorization Verification

CRITICAL: Before any scanning activities:

  • Confirm written authorization from network owner
  • Review scope document for in-scope IP ranges and domains
  • Verify scanning windows and rate-limiting requirements
  • Document emergency contact for accidental disruption
  • Confirm blacklisted hosts (production databases, critical infrastructure)

2. Host Discovery

Identify live hosts in target network:

bash
# Ping sweep (ICMP echo)
nmap -sn <target-network>/24

# ARP scan (local network only, faster and more reliable)
nmap -sn -PR <target-network>/24

# TCP SYN ping (when ICMP blocked)
nmap -sn -PS22,80,443 <target-network>/24

# UDP ping (for hosts blocking TCP)
nmap -sn -PU53,161 <target-network>/24

# Disable ping, assume all hosts alive
nmap -Pn <target-network>/24

Host discovery techniques:

  • ICMP Echo (-PE): Standard ping, often blocked
  • TCP SYN (-PS): Half-open connection to specified ports
  • TCP ACK (-PA): Sends ACK packets, useful for stateful firewalls
  • UDP (-PU): Sends UDP packets to specified ports
  • ARP (-PR): Layer 2 discovery, only works on local network

Output live hosts to file for subsequent scanning:

bash
nmap -sn <target-network>/24 -oG - | awk '/Up$/{print $2}' > live_hosts.txt

3. Port Scanning

Scan discovered hosts for open ports:

bash
# Fast scan (top 100 ports)
nmap -F -iL live_hosts.txt

# Top 1000 ports (default)
nmap -iL live_hosts.txt

# Scan all 65535 ports
nmap -p- -iL live_hosts.txt

# Scan specific ports
nmap -p 22,80,443,3389,8080 -iL live_hosts.txt

# Scan port ranges
nmap -p 1-1024,3000-9000 -iL live_hosts.txt

Scan techniques:

  • TCP SYN Scan (-sS): Default, stealthy half-open scan (requires root)

    bash
    sudo nmap -sS <target-ip>
  • TCP Connect Scan (-sT): Full TCP connection (no root required)

    bash
    nmap -sT <target-ip>
  • UDP Scan (-sU): Scan UDP ports (slow but critical)

    bash
    sudo nmap -sU -p 53,161,500 <target-ip>
  • Version Detection (-sV): Probe services for version information

    bash
    nmap -sV <target-ip>
  • Aggressive Scan (-A): Enable OS detection, version detection, script scanning, traceroute

    bash
    sudo nmap -A <target-ip>

Timing and performance:

bash
# Paranoid (0) - Extremely slow, IDS evasion
nmap -T0 <target-ip>

# Sneaky (1) - Very slow, IDS evasion
nmap -T1 <target-ip>

# Polite (2) - Slows down to use less bandwidth
nmap -T2 <target-ip>

# Normal (3) - Default timing
nmap -T3 <target-ip>

# Aggressive (4) - Faster, assumes reliable network
nmap -T4 <target-ip>

# Insane (5) - Very fast, may miss results
nmap -T5 <target-ip>

Rate limiting for safety:

bash
# Limit to 100 packets/second
nmap --max-rate 100 <target-ip>

# Minimum 10 packets/second
nmap --min-rate 10 <target-ip>

# Scan with delays to avoid detection
nmap --scan-delay 1s <target-ip>

4. Service Enumeration

Identify services and extract version information:

bash
# Service version detection
nmap -sV <target-ip>

# Aggressive version detection (more probes)
nmap -sV --version-intensity 5 <target-ip>

# Light version detection (fewer probes, faster)
nmap -sV --version-intensity 0 <target-ip>

# Specific service enumeration
nmap -sV -p 80,443 --script=http-headers,http-title <target-ip>

Service-specific enumeration:

bash
# SMB enumeration
nmap -p 445 --script=smb-os-discovery,smb-security-mode <target-ip>

# SSH enumeration
nmap -p 22 --script=ssh-hostkey,ssh-auth-methods <target-ip>

# DNS enumeration
nmap -p 53 --script=dns-nsid,dns-recursion <target-ip>

# HTTP/HTTPS enumeration
nmap -p 80,443 --script=http-methods,http-robots.txt,http-title <target-ip>

# Database enumeration
nmap -p 3306 --script=mysql-info <target-ip>
nmap -p 5432 --script=pgsql-brute <target-ip>
nmap -p 1433 --script=ms-sql-info <target-ip>

5. Operating System Detection

Identify target operating systems:

bash
# OS detection
sudo nmap -O <target-ip>

# Aggressive OS detection with version scanning
sudo nmap -A <target-ip>

# Limit OS detection to promising targets
sudo nmap -O --osscan-limit <target-ip>

# Guess OS aggressively
sudo nmap -O --osscan-guess <target-ip>

OS fingerprinting indicators:

  • TCP/IP stack characteristics
  • Open port patterns
  • Service banners and versions
  • TTL values and TCP window sizes

6. NSE Script Scanning

Nmap Scripting Engine for advanced reconnaissance and vulnerability detection:

bash
# Run default NSE scripts
nmap -sC <target-ip>

# Run all scripts in category
nmap --script=vuln <target-ip>
nmap --script=exploit <target-ip>
nmap --script=discovery <target-ip>

# Run specific script
nmap --script=http-sql-injection <target-ip>

# Multiple scripts
nmap --script=smb-vuln-ms17-010,smb-vuln-cve-2017-7494 <target-ip>

# Script with arguments
nmap --script=http-brute --script-args http-brute.path=/admin <target-ip>

NSE script categories:

  • auth: Authentication testing
  • broadcast: Network broadcast/multicast discovery
  • brute: Brute-force password auditing
  • default: Default safe scripts (-sC)
  • discovery: Network and service discovery
  • dos: Denial of service testing (use with caution)
  • exploit: Exploitation attempts (authorized only)
  • external: External resource queries (WHOIS, etc.)
  • fuzzer: Fuzzing attacks
  • intrusive: Intrusive scanning (may crash services)
  • malware: Malware detection
  • safe: Safe scripts unlikely to crash services
  • version: Version detection enhancement
  • vuln: Vulnerability detection

Common vulnerability detection scripts:

bash
# Check for EternalBlue (MS17-010)
nmap -p 445 --script=smb-vuln-ms17-010 <target-ip>

# Heartbleed detection
nmap -p 443 --script=ssl-heartbleed <target-ip>

# Shellshock detection
nmap --script=http-shellshock --script-args uri=/cgi-bin/test.sh <target-ip>

# Check for weak SSL/TLS
nmap -p 443 --script=ssl-enum-ciphers <target-ip>

# SQL injection testing
nmap -p 80 --script=http-sql-injection <target-ip>

# Check for anonymous FTP
nmap -p 21 --script=ftp-anon <target-ip>

7. Output and Reporting

Generate reports in multiple formats:

bash
# Normal output to screen and file
nmap <target-ip> -oN scan_results.txt

# XML output (for parsing/import)
nmap <target-ip> -oX scan_results.xml

# Grepable output (for easy parsing)
nmap <target-ip> -oG scan_results.gnmap

# All formats
nmap <target-ip> -oA scan_results

# Script kiddie output (for fun)
nmap <target-ip> -oS scan_results.skid

Convert and process results:

bash
# Convert XML to HTML report
xsltproc /usr/share/nmap/nmap.xsl scan_results.xml -o report.html

# Parse XML with Python
python3 -c "import xml.etree.ElementTree as ET; tree = ET.parse('scan_results.xml'); root = tree.getroot(); [print(host.find('address').get('addr')) for host in root.findall('host')]"

# Extract open ports from grepable output
grep 'Ports:' scan_results.gnmap | awk '{print $2, $5}'

8. Firewall and IDS Evasion

Techniques to evade detection (authorized testing only):

bash
# Fragment packets
sudo nmap -f <target-ip>

# Use decoys
sudo nmap -D RND:10 <target-ip>
sudo nmap -D decoy1,decoy2,ME,decoy3 <target-ip>

# Spoof source IP (requires raw packet privileges)
sudo nmap -S <spoofed-ip> -e <interface> <target-ip>

# Randomize target order
nmap --randomize-hosts -iL targets.txt

# Use proxy
nmap --proxies http://proxy:8080 <target-ip>

# Idle scan (zombie host required)
sudo nmap -sI <zombie-host> <target-ip>

Security Considerations

Authorization & Legal Compliance

  • Written Permission: Obtain explicit authorization before scanning any network
  • Scope Definition: Only scan explicitly authorized IP ranges and ports
  • Disruption Risk: Some scans (DOS, exploit scripts) can crash services
  • Privacy: Service enumeration may expose sensitive information
  • Log Traces: Scanning activities are typically logged by firewalls and IDS

Operational Security

  • Rate Limiting: Use --max-rate to avoid overwhelming targets
  • Timing: Schedule scans during approved maintenance windows
  • Bandwidth: Consider network impact, especially for large scans
  • Noise: Aggressive scans are easily detected by security monitoring
  • False Positives: Validate findings before reporting vulnerabilities

Audit Logging

Document all reconnaissance activities:

  • Scan start and end timestamps
  • Source IP address and scanner hostname
  • Target IP ranges and ports scanned
  • Nmap command-line arguments used
  • Number of hosts discovered and ports found
  • Vulnerabilities identified via NSE scripts
  • Any service disruptions or anomalies

Compliance

  • PTES: Reconnaissance phase of Penetration Testing Execution Standard
  • OWASP: ASVS verification requirements for network security
  • MITRE ATT&CK: T1046 (Network Service Scanning)
  • PCI-DSS 11.2: External and internal vulnerability scanning
  • ISO 27001: A.12.6 Technical vulnerability management

Common Patterns

Pattern 1: External Perimeter Assessment

bash
# Phase 1: Identify live hosts
nmap -sn -PE -PS80,443 -PA3389 <external-network>/24 -oG - | awk '/Up$/{print $2}' > external_hosts.txt

# Phase 2: Scan common external services
nmap -Pn -sV -p 21,22,25,53,80,110,143,443,587,993,995,3389,8080,8443 -iL external_hosts.txt -oA external_scan

# Phase 3: Vulnerability detection
nmap -Pn -sV --script=vuln -p 21,22,25,80,443,3389,8080,8443 -iL external_hosts.txt -oA external_vulns

# Phase 4: SSL/TLS security audit
nmap -Pn -p 443,8443 --script=ssl-enum-ciphers,ssl-cert -iL external_hosts.txt -oA ssl_audit

Pattern 2: Internal Network Mapping

bash
# Phase 1: Fast host discovery
nmap -sn -PR <internal-network>/24 -oG - | awk '/Up$/{print $2}' > internal_hosts.txt

# Phase 2: Comprehensive port scan
nmap -sV -p- -T4 -iL internal_hosts.txt -oA internal_full_scan

# Phase 3: OS fingerprinting
sudo nmap -O -iL internal_hosts.txt -oA internal_os_detection

# Phase 4: Service enumeration
nmap -sV --script=default,discovery -iL internal_hosts.txt -oA internal_services

Pattern 3: Web Application Discovery

bash
# Identify web servers
nmap -p 80,443,8000,8080,8443 --open -oG - <target-network>/24 | grep 'open' | awk '{print $2}' > web_servers.txt

# Enumerate web technologies
nmap -sV -p 80,443,8080,8443 --script=http-enum,http-headers,http-methods,http-title,http-server-header -iL web_servers.txt -oA web_enum

# Check for common web vulnerabilities
nmap -p 80,443 --script=http-sql-injection,http-csrf,http-vuln-cve2017-5638 -iL web_servers.txt -oA web_vulns

Pattern 4: SMB/CIFS Security Audit

bash
# Enumerate SMB hosts
nmap -p 445 --open <target-network>/24 -oG - | grep 'open' | awk '{print $2}' > smb_hosts.txt

# SMB version and configuration
nmap -p 445 --script=smb-protocols,smb-security-mode,smb-os-discovery -iL smb_hosts.txt -oA smb_enum

# Check for SMB vulnerabilities
nmap -p 445 --script=smb-vuln* -iL smb_hosts.txt -oA smb_vulns

# Enumerate shares (authentication may be required)
nmap -p 445 --script=smb-enum-shares,smb-enum-users -iL smb_hosts.txt -oA smb_shares

Pattern 5: Database Server Discovery

bash
# Scan for common database ports
nmap -sV -p 1433,1521,3306,5432,5984,6379,9200,27017 <target-network>/24 -oA database_scan

# MySQL enumeration
nmap -p 3306 --script=mysql-info,mysql-databases,mysql-variables <target-ip>

# PostgreSQL enumeration
nmap -p 5432 --script=pgsql-brute <target-ip>

# MongoDB enumeration
nmap -p 27017 --script=mongodb-info,mongodb-databases <target-ip>

# Redis enumeration
nmap -p 6379 --script=redis-info <target-ip>

Integration Points

CI/CD Integration

Automated security scanning in pipelines:

bash
#!/bin/bash
# ci_network_scan.sh - Continuous network security validation

TARGET_NETWORK="$1"
OUTPUT_DIR="scan_results/$(date +%Y%m%d_%H%M%S)"

mkdir -p "$OUTPUT_DIR"

# Quick security scan
nmap -Pn -sV --script=vuln -p 21,22,25,80,443,3389,8080 \
  "$TARGET_NETWORK" -oA "$OUTPUT_DIR/security_scan"

# Parse results for critical findings
if grep -i "VULNERABLE" "$OUTPUT_DIR/security_scan.nmap"; then
  echo "CRITICAL: Vulnerabilities detected!"
  exit 1
fi

echo "Security scan completed successfully"
exit 0

Security Tools Integration

  • Metasploit Integration: Import Nmap XML with db_import
  • Vulnerability Scanners: Feed Nmap results to Nessus, OpenVAS, Qualys
  • SIEM Integration: Parse Nmap output for security monitoring
  • Asset Management: Update CMDB with discovered hosts and services
  • Shodan/Censys: Validate external exposure findings

MITRE ATT&CK Mapping

Map Nmap reconnaissance to ATT&CK framework:

  • Reconnaissance: T1595 (Active Scanning)
    • T1595.001 (Scanning IP Blocks)
    • T1595.002 (Vulnerability Scanning)
  • Discovery: T1046 (Network Service Scanning)
  • Discovery: T1040 (Network Sniffing)
  • Credential Access: T1110 (Brute Force) - when using NSE brute scripts

Troubleshooting

Issue: No Results Despite Hosts Being Online

Causes:

  • ICMP blocked by firewall
  • Host-based firewall dropping probes
  • Network ACLs filtering traffic

Solutions:

bash
# Skip ping, assume all hosts up
nmap -Pn <target-ip>

# Try TCP ping instead of ICMP
nmap -PS80,443 -PA3389 <target-ip>

# Try multiple discovery techniques
nmap -PE -PS22,80,443 -PA3389 -PU53,161 <target-ip>

Issue: Scan Too Slow

Solutions:

bash
# Increase timing template
nmap -T4 <target-ip>

# Scan fewer ports
nmap -F <target-ip>  # Top 100 ports
nmap --top-ports 1000 <target-ip>

# Parallelize by splitting targets
nmap -T4 192.168.1.1-50 &
nmap -T4 192.168.1.51-100 &
nmap -T4 192.168.1.101-150 &
wait

# Use masscan for very fast port scanning
masscan -p 1-65535 --rate 10000 <target-network>/24

Issue: False Positives in Vulnerability Scripts

Solutions:

  • Manually verify findings with specific exploit tools
  • Check service version against CVE databases
  • Use --version-intensity 9 for more accurate version detection
  • Run vulnerability-specific NSE scripts instead of broad categories
  • Cross-reference with authenticated vulnerability scanners

Issue: Getting Blocked by Firewall/IDS

Solutions:

bash
# Slow down scan
nmap -T1 --scan-delay 1s <target-ip>

# Fragment packets
sudo nmap -f <target-ip>

# Randomize scan order
nmap --randomize-hosts -iL targets.txt

# Use source port 53 (often allowed)
nmap -g 53 <target-ip>

# Split into smaller scans over time
nmap -p 1-1000 <target-ip>
# Wait several hours
nmap -p 1001-2000 <target-ip>

Defensive Considerations

Organizations can detect Nmap scanning by:

  • Network IDS: Signature detection of scan patterns (vertical/horizontal sweeps)
  • Firewall Logs: Multiple connection attempts from single source
  • Port Scan Detection: Monitoring for SYN packets without completion
  • Honeypots: Triggering alerts when accessing decoy services
  • Traffic Analysis: Unusual packet patterns (fragmentation, timing anomalies)

Enhance defensive posture:

  • Deploy network intrusion detection systems (Snort, Suricata)
  • Enable firewall logging and monitor for scan patterns
  • Use port knocking or service hiding for sensitive services
  • Implement rate limiting on border firewalls
  • Deploy honeypots to detect and track reconnaissance

References

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Recon Nmap AI 技能有什么作用?

使用 Nmap 进行网络侦察和安全审计,包括端口扫描、服务枚举和漏洞检测。适用于:(1)开展经授权的网络侦察和资产发现;(2)枚举网络服务并识别运行版本;(3)通过 NSE 脚本检测安全漏洞;(4)绘制网络拓扑并识别防火墙规则;(5)开展合规扫描以进行安全评估;(6)验证网络分段和访问控制。

为什么在 TypingMind 中使用 Recon Nmap?

因为您只需安装一次,就能搭配任何模型使用。Recon Nmap 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Recon Nmap?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/AgentSecOps/SecOpsAgentKit/tree/main/skills/offsec/recon-nmap。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Recon Nmap?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Recon Nmap 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Recon Nmap 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Recon Nmap AI 技能免费吗?

AgentSecOps 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇