关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

简单强大容易安装的tcp ping工具 hping3

发布时间:2020-02-21 11:06:37

安装:

yum install hping3

测试:

hping3 -S  154.209.11.2  -p 80


[root@yMIEDC1004673 ~]# hping3 -S  www.qq.com  -p 80

HPING www.qq.com (eth0 59.151.129.125): S set, 40 headers + 0 data bytes

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=0 win=29200 rtt=8.3 ms

DUP! len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=0 win=29200 rtt=17.1 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=1 win=29200 rtt=8.2 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=2 win=29200 rtt=8.4 ms

DUP! len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=2 win=29200 rtt=17.0 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=3 win=29200 rtt=8.5 ms

DUP! len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=3 win=29200 rtt=16.7 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=4 win=29200 rtt=8.5 ms

DUP! len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=4 win=29200 rtt=16.7 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=5 win=29200 rtt=8.4 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=6 win=29200 rtt=8.7 ms

DUP! len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=6 win=29200 rtt=16.6 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=7 win=29200 rtt=8.1 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=8 win=29200 rtt=10.5 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=9 win=29200 rtt=8.3 ms

DUP! len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=9 win=29200 rtt=16.6 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=10 win=29200 rtt=8.3 ms

DUP! len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=10 win=29200 rtt=17.1 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=11 win=29200 rtt=8.4 ms

DUP! len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=11 win=29200 rtt=16.8 ms

DUP! len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=9 win=29200 rtt=2020.7 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=12 win=29200 rtt=8.3 ms

DUP! len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=12 win=29200 rtt=16.5 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=13 win=29200 rtt=8.4 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=14 win=29200 rtt=8.3 ms

DUP! len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=13 win=29200 rtt=1022.8 ms

len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=15 win=29200 rtt=8.3 ms

DUP! len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=9 win=29200 rtt=6051.8 ms

DUP! len=46 ip=59.151.129.125 ttl=58 DF id=0 sport=80 flags=SA seq=14 win=29200 rtt=1064.4 ms

^C

--- www.qq.com hping statistic ---

16 packets transmitted, 29 packets received, -81% packet loss

round-trip min/avg/max = 8.1/360.2/6051.8 ms

[root@yMIEDC1004673 ~]# hping3 --help

usage: hping host [options]

  -h  --help      show this help

  -v  --version   show version

  -c  --count     packet count

  -i  --interval  wait (uX for X microseconds, for example -i u1000)

      --fast      alias for -i u10000 (10 packets for second)

      --faster    alias for -i u1000 (100 packets for second)

      --flood   sent packets as fast as possible. Don't show replies.

  -n  --numeric   numeric output

  -q  --quiet     quiet

  -I  --interface interface name (otherwise default routing interface)

  -V  --verbose   verbose mode

  -D  --debug     debugging info

  -z  --bind      bind ctrl+z to ttl           (default to dst port)

  -Z  --unbind    unbind ctrl+z

      --beep      beep for every matching packet received

Mode

  default mode     TCP

  -0  --rawip      RAW IP mode

  -1  --icmp       ICMP mode

  -2  --udp        UDP mode

  -8  --scan       SCAN mode.

                   Example: hping --scan 1-30,70-90 -S www.target.host

  -9  --listen     listen mode

IP

  -a  --spoof      spoof source address

  --rand-dest      random destionation address mode. see the man.

  --rand-source    random source address mode. see the man.

  -t  --ttl        ttl (default 64)

  -N  --id         id (default random)

  -W  --winid      use win* id byte ordering

  -r  --rel        relativize id field          (to estimate host traffic)

  -f  --frag       split packets in more frag.  (may pass weak acl)

  -x  --morefrag   set more fragments flag

  -y  --dontfrag   set dont fragment flag

  -g  --fragoff    set the fragment offset

  -m  --mtu        set virtual mtu, implies --frag if packet size > mtu

  -o  --tos        type of service (default 0x00), try --tos help

  -G  --rroute     includes RECORD_ROUTE option and display the route buffer

  --lsrr           loose source routing and record route

  --ssrr           strict source routing and record route

  -H  --ipproto    set the IP protocol field, only in RAW IP mode

ICMP

  -C  --icmptype   icmp type (default echo request)

  -K  --icmpcode   icmp code (default 0)

      --force-icmp send all icmp types (default send only supported types)

      --icmp-gw    set gateway address for ICMP redirect (default 0.0.0.0)

      --icmp-ts    Alias for --icmp --icmptype 13 (ICMP timestamp)

      --icmp-addr  Alias for --icmp --icmptype 17 (ICMP address subnet mask)

      --icmp-help  display help for others icmp options

UDP/TCP

  -s  --baseport   base source port             (default random)

  -p  --destport   [+][+]<port> destination port(default 0) ctrl+z inc/dec

  -k  --keep       keep still source port

  -w  --win        winsize (default 64)

  -O  --tcpoff     set fake tcp data offset     (instead of tcphdrlen / 4)

  -Q  --seqnum     shows only tcp sequence number

  -b  --badcksum   (try to) send packets with a bad IP checksum

                   many systems will fix the IP checksum sending the packet

                   so you'll get bad UDP/TCP checksum instead.

  -M  --setseq     set TCP sequence number

  -L  --setack     set TCP ack

  -F  --fin        set FIN flag

  -S  --syn        set SYN flag

  -R  --rst        set RST flag

  -P  --push       set PUSH flag

  -A  --ack        set ACK flag

  -U  --urg        set URG flag

  -X  --xmas       set X unused flag (0x40)

  -Y  --ymas       set Y unused flag (0x80)

  --tcpexitcode    use last tcp->th_flags as exit code

  --tcp-timestamp  enable the TCP timestamp option to guess the HZ/uptime

Common

  -d  --data       data size                    (default is 0)

  -E  --file       data from file

  -e  --sign       add 'signature'

  -j  --dump       dump packets in hex

  -J  --print      dump printable characters

  -B  --safe       enable 'safe' protocol

  -u  --end        tell you when --file reached EOF and prevent rewind

  -T  --traceroute traceroute mode              (implies --bind and --ttl 1)

  --tr-stop        Exit when receive the first not ICMP in traceroute mode

  --tr-keep-ttl    Keep the source TTL fixed, useful to monitor just one hop

  --tr-no-rtt    Don't calculate/show RTT information in traceroute mode

ARS packet description (new, unstable)

  --apd-send       Send the packet described with APD (see docs/APD.txt)



/template/Home/Zkeys/PC/Static