作者:Joe Vest (@joevest) 和 Andrew Chiles (@andrewchiles)
域名选择是渗透测试尤其是红队行动准备中的重要环节。通常,那些先前用于合法用途且已被正确分类的域名,只需几美元即可购买。这类域名可以帮助团队绕过基于信誉的Web过滤器和网络出口限制,用于钓鱼和C2相关任务。
这款基于Python的工具旨在快速查询Expireddomains.net搜索引擎,寻找已过期/可用的、具有先前使用历史的域名。然后,它可以选择性地针对Symantec Site Review(BlueCoat)、IBM X-Force和Cisco Talos等服务进行域名声誉查询。主要工具输出为带时间戳的HTML表格样式报告。
更新历史和发布说明请参见CHANGELOG。
安装Python依赖
pip3 install -r requirements.txt
可选 - 安装额外的OCR支持依赖
Debian/Ubuntu:apt-get install tesseract-ocr python3-pil
MAC OSX:brew install tesseract
pipenv --python 3.7
pipenv install
可选 - 安装额外的OCR支持依赖
apt-get install tesseract-ocr python3-pil构建镜像
docker build -t domainhunter .
使用参数运行
docker run -it domainhunter [args]
usage: domainhunter.py [-h] [-a] [-k KEYWORD] [-c] [-f FILENAME] [--ocr]
[-r MAXRESULTS] [-s SINGLE] [-t {0,1,2,3,4,5}]
[-w MAXWIDTH] [-V]
查找过期域名、域名分类和Archive.org历史记录,以确定适合C2和钓鱼域名的候选。
可选参数:
-h, --help 显示此帮助信息并退出
-a, --alexa 将结果过滤到Alexa列表
-k KEYWORD, --keyword KEYWORD
用于细化搜索结果的关键字
-c, --check 执行域名声誉检查
-f FILENAME, --filename FILENAME
指定包含待检查域名列表(每行一个)的输入文件
--ocr 在遇到验证码时执行OCR
-r MAXRESULTS, --maxresults MAXRESULTS
查询最新过期/删除域名时返回的结果数量
-s SINGLE, --single SINGLE
对单个域名/IP执行详细的声誉检查
-t {0,1,2,3,4,5}, --timing {0,1,2,3,4,5}
调整请求时间以避免验证码。最慢(0)=90-120秒,默认(3)=10-20秒,最快(5)=无延迟
-w MAXWIDTH, --maxwidth MAXWIDTH
文本表格的宽度
-V, --version 显示程序的版本号并退出
示例:
./domainhunter.py -k apples -c --ocr -t5
./domainhunter.py --check --ocr -t3
./domainhunter.py --single mydomain.com
./domainhunter.py --keyword tech --check --ocr --timing 5 --alexa
./domainhunter.py --filename inputlist.txt --ocr --timing 5
使用默认设置检查最近100个域名并检查声誉
python3 ./domainhunter.py
搜索最近过期的1000个域名,但不检查声誉
python3 ./domainhunter.py -r 1000
对单个域名执行所有声誉检查
python3 ./domainhunter.py -s mydomain.com
[*] Downloading malware domain list from http://mirror1.malwaredomains.com/files/justdomains
[*] Fetching domain reputation for: mydomain.com
[*] BlueCoat: mydomain.com
[+] mydomain.com: Technology/Internet
[*] IBM xForce: mydomain.com
[+] mydomain.com: Communication Services, Software as a Service, Cloud, (Score: 1)
[*] Cisco Talos: mydomain.com
[+] mydomain.com: Web Hosting (Score: Neutral)
以最快速度并启用OCR处理验证码,对域名列表执行所有声誉检查
python3 ./domainhunter.py -f <domainslist.txt> -t 5 --ocr
使用关键字“dog”搜索可用域名,最大结果数为25,并检查声誉
python3 ./domainhunter.py -k dog -r 25 -c
____ ___ __ __ _ ___ _ _ _ _ _ _ _ _ _____ _____ ____
| _ \ / _ \| \/ | / \ |_ _| \ | | | | | | | | | \ | |_ _| ____| _ \
| | | | | | | |\/| | / _ \ | || \| | | |_| | | | | \| | | | | _| | |_) |
| |_| | |_| | | | |/ ___ \ | || |\ | | _ | |_| | |\ | | | | |___| _ <
|____/ \___/|_| |_/_/ \_\___|_| \_| |_| |_|\___/|_| \_| |_| |_____|_| \_\
Expired Domains Reputation Checker
Authors: @joevest and @andrewchiles
DISCLAIMER: This is for educational purposes only!
It is designed to promote education and the improvement of computer/cyber security.
The authors or employers are not liable for any illegal act or misuse performed by any user of this tool.
If you plan to use this content for illegal purpose, don't. Have a nice day :)
[*] 正在从 http://mirror1.malwaredomains.com/files/justdomains 下载恶意域名列表
[*] 正在获取包含 "dog" 的过期或删除域名
[*] https://www.expireddomains.net/domain-name-search/?q=dog
[*] 正在对8个域名执行声誉检查。
[*] BlueCoat: doginmysuitcase.com
[+] doginmysuitcase.com: Travel
[*] IBM xForce: doginmysuitcase.com
[+] doginmysuitcase.com: Not found.
[*] Cisco Talos: doginmysuitcase.com
[+] doginmysuitcase.com: Uncategorized