专业做网站的软件,郑州的网站建设公司,如何搜索asp网站,十大效果图网站背景
现网DNS服务器发现CPU突增#xff0c;发现有可能是客户恶意发起的随机子域名扫描#xff0c;对服务器进行抓包分析#xff0c;记录下当时的操作。
抓包
执行命令 tcpdump -iany port 53 and host $ip -nnv -w $ip.pcap进行抓包导出到本地#xff0c;使用Wireshark进…背景
现网DNS服务器发现CPU突增发现有可能是客户恶意发起的随机子域名扫描对服务器进行抓包分析记录下当时的操作。
抓包
执行命令 tcpdump -iany port 53 and host $ip -nnv -w $ip.pcap进行抓包导出到本地使用Wireshark进行打开分析
使用sz ip.pcap命令导出到本地
分析
Wireshark有自带的统计功能非常好用这里使用如下
1、先找出请求量最大的客户端IP 2、根据客户端IP找出请求量大的域名有哪些 1.模糊匹配域名 使用命令 ip.src ip dns.qry.name contains 域名这个是模糊匹配域名 2.精确匹配域名 ip.src ip dns.qry.name 域名
处理
找出域名后可以利用iptables对域名进行限频或者封禁 封禁 iptables -I INPUT -p udp --dport 53 -m string --hex-string ipt|03|aol|03|com --algo bm --icase --to 1480 -j DROP iptables -I INPUT -p udp --dport 53 -m string --hex-string |2a 2e 62 79 64 2a| --algo bm --icase -j DROP 限频 iptables -I INPUT -p udp --dport 53 -m string --hex-string |2a 2e 62 79 64 2a| --algo bm --icase -m limit --limit 1000/s --limit-burst 100 -j ACCEPT
更多命令
1、dns.flags.response dns.flags.response 的值为 0 时 表示该数据包是一个 DNS 查询
dns.flags.response 的值为 1 时 表示该数据包是一个 DNS 响应 2、包含9.146.178.132这个地址的 ip.addr 9.146.178.132
3、指定目标地址 ip.dst 221.182.227.3
4、指定请求方法 ip.addr 113.31.104.71 and http.request.method POST
5、根据http协议过滤包内容 http.request.method POST and ip.src ! 11.142.163.186 and http contains vspRegistrantUpload
6、过滤数据包内容包含的字符串 http.request.method POST and ip.src ! 11.142.163.186 and frame contains cnRegistrantQuery
7、过滤时间 http.date Tue, 15 Nov 2022 07:05:36 GMT http.date Tue, 15 Nov 2022 07:05:37 GMT