子域枚举/发现🛠️
另一方面,这一步可能是最简单但至关重要的。查找子域只是 Bug Bounties 中的一个常见步骤,但找到比其他子域更多的子域才是使我们在竞争中脱颖而出的原因。
查找更多子域✅的好处:
-
广泛的攻击面。 -
一些工具可以帮助您找到内部子域。 -
您可能会发现配置错误的子域揭示了一些高权限门户或类似的东西。
提示: 在执行侦查时,永远不要依赖单一工具。
注意: 您必须在linux/WSL/WSL2/VPS中安装Go & Python语言,以便您可以运行所有工具而不会受到任何干扰。
实用方法🛠️
创建一个单独的目录命名子域,并将以下命令的所有输出存储在其中。
1. 子查找器
在正常模式下运行 subfinder:
subfinder -d target.com -o subfinder.txt
对于在文件上运行:
subfinder -dL domains.txt -o subfinder.txt
在 Recursive 模式下运行:
subfinder -d target.com -all-recursive-o subf_rec.txt
对于在文件上运行:
subfinder -dL domains.txt -all -recursive -o subf_rec.txt
通常,递归模式是为了稍微多地突破限制以查找更多资源,但有时它实际上会给出较少的 no。的子域。所以,我建议同时使用它们。
运行这两个选项后,运行命令对子域进行排序:
sort -u subfinder.txt subfrec.txt -o subf_final.txt
2. 子列表3r
要运行的命令:
python3 sublist3r.py -d target.com -o sublist3r.txt
要在 domains.txt 文件上运行的脚本:
创建 bash 脚本 :sublist3r_bulk.sh
#!/bin/bashwhileread -r domain; doecho"[*] Running Sublist3r on $domain" python3 sublist3r.py -d "$domain" -o "${domain}_sublist3r.txt"done < domains.txt
运行脚本:
chmod +x sublist3r_bulk.sh./sublist3r_bulk.sh
3. Findomain
要运行的命令:
findomain --quiet -t target.com | tee findomain.txt
要在 domains.txt 文件上运行的脚本:
创建 bash 脚本findomain_bulk.sh
#!/bin/bashwhileread -r domain; doecho"[*] Running Findomain on $domain" findomain --quiet -t "$domain" | tee"${domain}_findomain.txt"done < domains.txt
运行脚本:
chmod +x findomain_bulk.sh./findomain_bulk.sh
4. 资产查找器
要运行的命令:
assetfinder -subs-only target.com | tee assetfinder.txt
要在 domains.txt 文件上运行的脚本:
创建 bash 脚本 :assetfinder_bulk.sh
#!/bin/bashwhileread -r domain; doecho"[*] Running Assetfinder on $domain" assetfinder -subs-only "$domain" | tee"${domain}_assetfinder.txt"done < domains.txt
运行脚本:
chmod +x assetfinder_bulk.sh./assetfinder_bulk.sh
5. BBOT 公司
就个人而言,这是我最喜欢的收集子域的工具,因为它为您提供了集成 API 密钥的选项列表,从而可以找到更多资产。
要运行的命令:
无 API 配置
bbot -t target.com -p subdomain-enum -o bbot.txt
如何配置 API
您可以按照 BBOT GitHub 官方仓库使用 BBOT 配置 API。
我使用自己的小脚本使用 API 密钥运行 bbot,因为即使在 bbot.yaml 文件中配置了密钥后,我也遇到了一些问题。
下面是小脚本的样子:
创建 bbot.sh 文件:
# for running on single targetnano bbot-single.sh# for running on a filenano bbot-multiple.sh
在文件中复制以下脚本(添加API密钥后,只需在“=”号后添加API密钥)并按ctrl+o和ctrl+x
对于在单个目标 (bbot-single.sh) 上运行:
#!/bin/bashbbot -t target.com -p subdomain-enum -c modules.github_codesearch.api_key= modules.github_org.api_key= modules.github_workflows.api_key= modules.virustotal.api_key= modules.securitytrails.api_key= modules.censys.api_id= modules.censys.api_secret= modules.zoomeye.api_key= modules.bevigil.api_key= modules.binaryedge.api_key= -o bbot.txt
对于在 domains.txt (bbot-multiple.sh) 上运行时:
#!/bin/bashcat domains.txt | whileread domain; dobbot -t "$domain" -p subdomain-enum -c modules.github_codesearch.api_key= modules.github_org.api_key= modules.github_workflows.api_key= modules.virustotal.api_key= modules.securitytrails.api_key= modules.censys.api_id= modules.censys.api_secret= modules.zoomeye.api_key= modules.bevigil.api_key= modules.binaryedge.api_key= -o bbot-subs/"$domain"done
向文件添加权限:
chmod +x bbot-single.shchmod +x bbot-multiple.sh
运行脚本
配置 API 是一个耗时的过程,但相信我,它会在整个过程中对您有很大帮助。另外,如果您想添加更多的 API 密钥,可以在此处查找 Module Config 选项表。
6. 囤积
对于 VPS 用户,与本地计算机相比,此工具的运行速度要快得多。但该工具对于侦察来说非常强大。
为了使其噪音更小、速度更快,我更喜欢在被动模式下运行它。
amass enum -passive -d target.com -o file.txt
要在 domains.txt 文件上运行的脚本:
创建 bash 脚本 :amass_bulk.sh
#!/bin/bashwhileread -r domain; doecho"[*] Running Amass on $domain" amass enum -passive -d "$domain" -o "${domain}_amass.txt"done < domains.txt
运行脚本:
chmod +x amass_bulk.sh./amass_bulk.sh
7. Github 子域
该工具需要 Github API 密钥才能更精确地运行,因此我建议您这样做。
github-subdomains -d target.com -t YourAPIKEY -o subs.txt
要在 domains.txt 文件上运行的脚本:
创建 bash 脚本 :github_subdomains_bulk.sh
#!/bin/bashAPI_KEY="YourAPIKEY"whileread -r domain; doecho"[*] Running GitHub Subdomains on $domain" github-subdomains -d "$domain" -t "$API_KEY" -o "${domain}_github_subs.txt"done < domains.txt
运行脚本:
chmod +x github_subdomains_bulk.sh./github_subdomains_bulk.sh
现在您有 7 个包含子域的文件。将它们全部排序到一个文件中:
sort -u * -o allsubs.txt
注意:在运行该命令之前,请确保您的 subdomains 目录仅包含上述命令的输出文件。并且仅在对子域进行排序时在子域目录中运行此命令。
我期待着分享我在探索不断发展的网络安全和漏洞赏金世界时所学到的知识。让我们来猎杀一些虫子吧!
感谢您阅读此博客!!
原文始发于微信公众号(安全狗的自我修养):如何找到更多漏洞赏金的子域?深入了解 Recon
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论