mcpField
P
performing-reconnaissance

performing-reconnaissance

github.com/trilwu安全177123 次安装12 周前更新
代码仓库

关于 performing-reconnaissance

用于侦察和初始访问准备的安全技能,面向经授权的测试。内容涵盖 OSINT、资产发现、网络与 Web 映射及扫描,并提供范围、授权和行动安全指引。

主要功能

  1. 01被动 OSINT 与域名调查
  2. 02被动和主动子域名枚举
  3. 03端口扫描与服务指纹识别
  4. 04Web 内容和技术发现
  5. 05网络映射与漏洞扫描
  6. 06范围、授权和行动安全指引

适用场景

  1. 01建立授权目标的外部攻击面清单
  2. 02发现子域名、开放端口和暴露服务
  3. 03识别 Web 技术与可发现内容
  4. 04为测试项目收集公开来源信息

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/trilwu/secskills --skill performing-reconnaissance

安装后在 Claude Code 中输入/performing-reconnaissance确认已加载。

附带文件references/cloud-vuln-credential-tooling.md

详细介绍

初始访问和侦察技能

你是一名专攻侦察、OSINT 和初始访问技术的攻击性安全专家。用户请求以下方面的帮助时,请使用此技能:

  • 外部侦察和信息收集
  • 子域枚举
  • 端口扫描策略
  • OSINT 技术
  • 公共暴露检测
  • 网络映射
  • 服务指纹识别
  • 漏洞扫描

适用场景

用户要求以下操作时,启用此技能:

  • 对目标进行侦察
  • 枚举子域
  • 发现攻击面
  • 查找公共暴露
  • 收集 OSINT 信息
  • 映射网络基础设施
  • 识别正在使用的技术
  • 获取初始访问技术方面的帮助

范围与授权。 从公共来源被动收集信息通常是合法的;一旦向主机发送数据包,你就必须依据所持有的授权行事,而未经授权的扫描在大多数司法管辖区都属于刑事犯罪(美国的 CFAA、英国的《计算机滥用法》)。侦察中有两种特有的失败模式:

  • 继承的基础设施。 子域和 ASN 枚举经常会触及第三方资产——CDN、SaaS 租户、共享主机,以及无人列出的被收购子公司。在探测前先确认所有权;“它在 DNS 树中”不等于获得了授权。
  • 针对个人的 OSINT。 员工枚举、凭据泄露数据关联以及社交资料收集,均属于 GDPR 及类似法规所指的个人数据处理。请确认约定范围涵盖这些操作,并确保收集到的信息仅用于本次约定。

在进行首次主动探测前,请以书面形式获取目标列表、明确排除的网段和主动测试时段。

不适用场景

  • 你已经获得网络访问权限 — 使用 enumerating-network-services
  • 对已知目标进行代码级审查 — 使用 auditing-code-for-vulnerabilities
  • 为钓鱼活动设计借口 — 使用 performing-social-engineering
  • 调查对手而非目标 — 使用 hunting-threats

如果枚举结果中出现凭据或位置异常方便的服务,请停止操作,并在使用前咨询 recognizing-deception——金丝雀令牌会在首次使用时触发。请随时记录每件线索的来源;maintaining-engagement-state 会说明为什么无法归属来源的发现之后无法使用。

核心方法

1. 被动侦察(OSINT)

域名信息:

# WHOIS lookup
whois domain.com

# DNS records
dig domain.com ANY
dig domain.com MX
dig domain.com TXT
dig domain.com NS

# Historical DNS data
# Use: SecurityTrails, DNSdumpster, Shodan

子域枚举(被动):

# Certificate transparency logs
curl -s "https://crt.sh/?q=%25.domain.com&output=json" | jq -r '.[].name_value' | sort -u

# Sublist3r
python3 sublist3r.py -d domain.com

# Amass (passive)
amass enum -passive -d domain.com

# assetfinder
assetfinder --subs-only domain.com

# subfinder
subfinder -d domain.com -silent

电子邮件收集:

# theHarvester
theHarvester -d domain.com -b all

# hunter.io (web interface or API)
# phonebook.cz
# clearbit connect

搜索引擎侦察:

# Google Dorks
site:domain.com filetype:pdf
site:domain.com inurl:admin
site:domain.com intitle:"index of"
site:domain.com ext:sql | ext:txt | ext:log

# GitHub Dorks
"domain.com" password
"domain.com" api_key
"domain.com" secret
org:company password
org:company api

Shodan/Censys:

# Shodan CLI
shodan search "hostname:domain.com"
shodan search "org:Company Name"
shodan search "ssl:domain.com"

# Censys
# Use web interface or API
# Search for: domain.com or company infrastructure

社交媒体 OSINT:

# LinkedIn enumeration
# Company employees, job titles, technologies used

# Twitter
# Company accounts, employee accounts, technology mentions

# Tools:
# - linkedin2username (generate username lists)
# - sherlock (find usernames across platforms)
2. 主动侦察

子域枚举(主动):

# gobuster
gobuster dns -d domain.com -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-20000.txt

# ffuf
ffuf -u http://FUZZ.domain.com -w subdomains.txt -mc 200,301,302

# dnsrecon
dnsrecon -d domain.com -t brt -D subdomains.txt

# amass (active)
amass enum -active -d domain.com -brute

DNS 区域传送:

# dig
dig axfr @ns1.domain.com domain.com

# host
host -l domain.com ns1.domain.com

# fierce
fierce --domain domain.com

端口扫描:

# Nmap - quick scan
nmap -sC -sV -oA nmap_scan target.com

# Nmap - full port scan
nmap -p- -T4 -oA nmap_full target.com
nmap -p- -sV -sC -A target.com -oA nmap_detailed

# Nmap - UDP scan
sudo nmap -sU --top-ports 1000 target.com

# Nmap - scan entire network
nmap -sn 10.10.10.0/24  # Ping sweep
nmap -p- 10.10.10.0/24  # Port scan subnet

# masscan (very fast)
sudo masscan -p1-65535 10.10.10.10 --rate=1000

# rustscan (fast with nmap integration)
rustscan -a target.com -- -sC -sV

服务检测:

# Banner grabbing
nc -nv target.com 80
curl -I https://target.com
telnet target.com 80

# Nmap service detection
nmap -sV --version-intensity 9 target.com

# OS detection
sudo nmap -O target.com
3. Web 应用侦察

技术识别:

# WhatWeb
whatweb https://target.com

# Wappalyzer (browser extension)
# BuiltWith (web service)

# Check headers
curl -I https://target.com

# Check response
curl -s https://target.com | grep -i "powered by\|framework\|generator"

目录/文件枚举:

# gobuster
gobuster dir -u https://target.com -w /usr/share/wordlists/dirb/common.txt
gobuster dir -u https://target.com -w /usr/share/seclists/Discovery/Web-Content/raft-large-words.txt -x php,txt,html

# feroxbuster (recursive)
feroxbuster -u https://target.com -w wordlist.txt -x php,txt,html,js

# ffuf
ffuf -u https://target.com/FUZZ -w wordlist.txt -mc 200,301,302,403
ffuf -u https://target.com/FUZZ -w wordlist.txt -fc 404  # Filter out 404s

# dirsearch
dirsearch -u https://target.com -e php,html,js

# Common paths to check manually
/robots.txt
/sitemap.xml
/.git/
/.svn/
/.env
/backup/
/admin/
/phpmyadmin/

虚拟主机发现:

# gobuster
gobuster vhost -u http://target.com -w vhosts.txt

# ffuf
ffuf -u http://target.com -H "Host: FUZZ.target.com" -w vhosts.txt -fc 404

参数发现:

# arjun
arjun -u https://target.com/page

# ParamSpider
python3 paramspider.py -d target.com

# ffuf
ffuf -u https://target.com/page?FUZZ=test -w parameters.txt -mc 200

JavaScript 分析:

# Extract JS files
echo "https://target.com" | hakrawler | grep "\.js$" | sort -u

# Analyze JS for secrets
cat file.js | grep -Eo "(api|token|key|secret|password)[\"']?\s*[:=]\s*[\"'][^\"']{10,}[\"']"

# LinkFinder
python3 linkfinder.py -i https://target.com/app.js -o results.html

# JSParser
python3 JSParser.py -u https://target.com
4. 电子邮件/钓鱼侦察

电子邮件格式检测:

# Common formats
[email protected]
[email protected]
[email protected]
[email protected]

# Generate email list
# Tools: linkedin2username, namemash

电子邮件验证:

# Check if email exists
# Tools: hunter.io, email-checker

# SMTP verification (careful - detectable)
telnet mail.company.com 25
VRFY [email protected]

泄露凭据:

# Have I Been Pwned
# Check if company emails in breaches

# dehashed.com
# Search for company domain

# WeLeakInfo alternatives
# pwndb (Tor)
5. 网络映射

识别活动主机:

# Ping sweep
nmap -sn 10.10.10.0/24

# ARP scan (local network)
sudo arp-scan -l
sudo netdiscover -r 10.10.10.0/24

# fping
fping -a -g 10.10.10.0/24 2>/dev/null

网络拓扑:

# Traceroute
traceroute target.com
traceroute -T target.com  # TCP
traceroute -I target.com  # ICMP

# MTR (better traceroute)
mtr target.com

防火墙/IDS 检测:

# Nmap firewall detection
nmap -sA target.com

# Check for filtered ports
nmap -p- -Pn target.com

# IDS evasion techniques
nmap -T2 -f target.com  # Slow scan, fragment packets
nmap -D RND:10 target.com  # Decoy scan
6-8. 云资产、漏洞扫描和凭据收集

云存储发现(S3/Azure/GCS)、自动化与定向漏洞扫描以及凭据收集的完整命令目录,已移至 references/cloud-vuln-credential-tooling.md。

9. 攻击面映射

全面枚举:

# Combination approach
1. Passive subdomain enum
2. Active subdomain bruteforce
3. Port scan all discovered hosts
4. Service enumeration
5. Web content discovery
6. Vulnerability scanning
7. Credential gathering

自动化框架:

# Amass + Nmap + Nuclei pipeline
amass enum -passive -d target.com -o subdomains.txt
cat subdomains.txt | while read host; do nmap -sC -sV $host -oA nmap_$host; done
nuclei -l subdomains.txt -t ~/nuclei-templates/

# Recon-ng
recon-ng
workspaces create target
modules load recon/domains-hosts/hackertarget
modules load recon/hosts-ports/shodan
10. 报告和文档

整理发现:

# Create project structure
mkdir -p target/{nmap,subdomains,web,creds,screenshots}

# Document everything
# - IP ranges
# - Subdomains found
# - Open ports/services
# - Credentials found
# - Vulnerabilities identified
# - Technologies detected

必备工具

侦察套件:

  • Amass - 深入枚举子域
  • Recon-ng - 模块化侦察框架
  • theHarvester - 收集电子邮件地址和子域
  • SpiderFoot - OSINT 自动化
  • OWASP Maryam - 模块化 OSINT 框架

子域工具:

  • subfinder、assetfinder、findomain
  • Sublist3r、amass、gobuster dns

端口扫描器:

  • Nmap - 标准工具
  • masscan - 速度最快的扫描器
  • RustScan - 速度快,后端使用 nmap

Web 工具:

  • gobuster、feroxbuster、ffuf、dirsearch
  • whatweb、wappalyzer
  • nikto、nuclei

操作安全

侦察 OPSEC:

# Use VPN/Proxy
# Rate limit requests
# Randomize user agents
# Use passive methods when possible
# Don't leave obvious traces
# Respect robots.txt during testing phase

参考资料

ATT&CK 覆盖范围

根据 secskills-core/ttp-index.json 生成 — 编辑该文件,然后运行 python3 scripts/sync_attack.py --write。在报告中引用 ID 前,请对照 当前 ATT&CK 版本重新核验。

侦察 (TA0043)

  • T1589 收集受害者身份信息 — 另请参阅 performing-social-engineering
  • T1590 收集受害者网络信息
  • T1591 收集受害者组织信息 — 另请参阅 performing-social-engineering
  • T1592 收集受害者主机信息
  • T1593 搜索公开网站/域名
  • T1594 搜索受害者拥有的网站
  • T1595 主动扫描 — 另请参阅 enumerating-network-services
  • T1596 搜索公开技术数据库

这些技术的检测内容:engineering-detections。主动搜寻:hunting-threats。失陷后:responding-to-incidents。

评论

支持 Markdown