此工具为蓝队、安全运营中心(SOC)、研究人员和公司提供检测其域名活跃变异的能力,从而阻止这些域名被用于欺诈活动(如钓鱼和短信钓鱼)。
为此,TypoDetect 允许使用 IANA 网站上发布的最新版 TLD(顶级域名)、验证区块链 DNS 中的去中心化域名以及 DoH 服务(基于 HTTPS 的 DNS)中的恶意软件报告。
为了方便用户,TypoDetect 默认以 JSON 格式返回报告,也可根据用户选择以 TXT 格式返回,并在屏幕上显示生成的变异摘要、活跃域名以及检测到的恶意软件或去中心化域名报告。
克隆此仓库:
git clone https://github.com/Telefonica/typodetect
运行安装脚本:
python3 pip install -r requirements.txt
在 TypoDetect 目录内:
python3 typodetect.py -h
usage: typodetect.py [-h] [-u UPDATE] [-t N_THREADS] [-d DOH_SERVER] [-o OUTPUT] domain
positional arguments:
domain specify domain to process
optional arguments:
-h, --help show this help message and exit
-u UPDATE, --update UPDATE
(Y/N) for update TLD's database (default:N)
-t N_THREADS, --threads N_THREADS
Number of threads for processing (default:5)
-d DOH_SERVER, --doh DOH_SERVER
Section DoH for use: [1] ElevenPaths (default) [2] Cloudfare
-o OUTPUT, --output OUTPUT
JSON or TXT, options of filetype (default:JSON)
执行简单分析:
python3 typodetect.py <domain>
更新 IANA 数据库并分析:
python3 typodetect.py -u y <domain>
使用更多线程分析:
python3 typodetect.py -t <number of threads> <domain>
使用不同的 DoH(目前仅支持 ElevenPaths 或 CloudFare)
python3 typodetect.py -d 2 <domain>
生成 TXT 报告
python3 typodetect.py -o TXT <domain>
在 reports 目录中,报告文件默认以 JSON 格式保存,文件名为分析的域名和日期,例如:
elevenpaths.com2021-01-26T18:20:10.34568.json
JSON 报告对每个检测到的活跃变异具有以下结构:
{ id:
"report_DoH" : <string>
"domain": <string>
"A": [ip1, ip2, ...]
"MX": [mx1, mx2, ...]
}
各字段包含以下信息:
id: Integer id of mutation
"report_DoH": "" - Domain of Descentralised DNS
"Malware" - Domain reported as dangerous for DoH
"Good" - Domain reported as good for DoH
"domain": Mutation detected as active.
"A": IP's address of A type in DNS of the mutation.
"MX": IP's or CNAME of MX type in DNS of the mutation.