DNSWatch 是一个基于 Python 的工具,可让您嗅探和分析网络上的 DNS(域名系统)流量。它侦听 DNS 请求和响应并提供对 DNS 活动的深入了解。
![图片[1]-DNSWatch:DNS 流量嗅探器和分析器-IT熊技术站](https://www.cutrui.cn/wp-content/uploads/2023/08/image-89-1024x586.png)
特征
- 嗅探并分析 DNS 请求和响应
- 显示 DNS 请求及其相应的源和目标 IP 地址
- 用于详细数据包检查的可选详细模式
- 将结果保存到指定的输出文件
- 通过指定目标 IP 地址来过滤 DNS 流量
- 将 DNS 请求保存在数据库中以供进一步分析(可选)
- 分析 DNS 类型(可选)
- 支持 DNS over HTTPS (DoH)(可选)
要求
- Python 3.7+
- scapy 2.4.5 或更高版本
- colorama 0.4.4 或更高版本
安装
- 克隆此存储库:
git clone https://github.com/HalilDeniz/DNSWatch.git
- 安装所需的依赖项:
pip install -r requirements.txt
用法
python dnswatch.py -i <interface> [-v] [-o <output_file>] [-k <target_ip>] [--analyze-dns-types] [--doh]
-i
,--interface
:指定网络接口(例如eth0)。-v
,--verbose
:使用此标志可获得更详细的输出。-o
,--output
: 指定保存结果的文件名。-t
,--target-ip
:指定要监控的具体目标IP地址。-adt
,--analyze-dns-types
:分析 DNS 类型。--doh
:使用 DNS over HTTPS (DoH) 来解析 DNS 请求。-fd
,--target-domains
:按指定域过滤 DNS 请求。-d
,--database
:为 DNS 请求启用数据库存储。
按Ctrl+C
停止嗅探过程。
例子
- 嗅探接口“eth0”上的 DNS 流量:
python dnswatch.py -i eth0
- 嗅探接口“eth0”上的 DNS 流量并将结果保存到文件中:
python dnswatch.py -i eth0 -o dns_results.txt
- 嗅探接口“eth0”上的 DNS 流量并过滤涉及特定目标 IP 的请求/响应:
python dnswatch.py -i eth0 -t 192.168.1.100
- 嗅探接口“eth0”上的 DNS 流量并启用 DNS 类型分析:
python dnswatch.py -i eth0 --analyze-dns-types
- 使用 DNS over HTTPS (DoH) 嗅探接口“eth0”上的 DNS 流量:
python dnswatch.py -i eth0 --doh
- 嗅探接口“wlan0”上的 DNS 流量并启用数据库存储
python3 dnswatch.py -i wlan0 --database
项目地址
DNSWatch:【GitHub】
© 版权声明
THE END
暂无评论内容