跳转至

被动信息收集

OSCP 认证考试不考察被动信息收集能力。

whois 查询

Bash
1
2
3
4
5
6
# 查询特定域名或 IP
whois xxx.com
whois 1.1.1.1

# 通过 bash 循环查询主机host信息
for i in {1..3};do host ns$i.xxx.com; done

Google 搜索

Bash
1
2
3
4
5
site:xxx.com filetype:php
intitle:index.of.etc

# exploit-db 可查找更多 Google hack 语法
https://www.exploit-db.com/google-hacking-database

网络空间测绘平台

Bash
1
2
3
4
# shodan
https://www.shodan.io/

# 当然还有国内的一些其他平台:fofa、huter等等

gitleaks 工具

gitleaks 用来扫描 Git 仓库中的敏感信息泄露,比如:密码、Token、API Key、私钥、云凭证等。

Bash
1
2
3
4
5
6
7
8
# 工具 URL
https://github.com/gitleaks/gitleaks

# 扫描指定目录代码
gitleaks detect --source /path/to/code

# 扫描远程仓库代码
gitleaks detect --repo-url https://github.com/xxx/yyy.git

theHarvester 工具

theHarvester 是一款被动信息收集(OSINT)工具,用于从公开数据源收集目标的子域名、邮箱、IP 等信息。

Bash
1
2
3
4
5
6
7
8
# 工具 URL
https://github.com/laramies/theHarvester

# 通过 Google 收集指定域名敏感信息
theHarvester -d xxx.com -b google   # 还支持:bing,yahoo,duckduckgo

# -all 指定所有平台
theHarvester -d xxx.com -b all