<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      hping3

      【原理基礎(chǔ)】 
        Hping是一個命令行下使用的TCP/IP數(shù)據(jù)包組裝/分析工具,其命令模式很像Unix下的ping命令,但是它不是只能發(fā)送ICMP回應(yīng)請求,它還可以支持TCP、UDP、ICMP和RAW-IP協(xié)議,它有一個路由跟蹤模式,能夠在兩個相互包含的通道之間傳送文件。Hping常被用于檢測網(wǎng)絡(luò)和主機,其功能非常強大,可在多種操作系統(tǒng)下運行,如Linux,F(xiàn)reeBSD,NetBSD,OpenBSD,Solaris,MacOs X,Windows。

      Hping的主要功能有: 

        防火墻測試 

        實用的端口掃描 

        網(wǎng)絡(luò)檢測,可以用不同的協(xié)議、服務(wù)類型(TOS)、IP分片 

        手工探測MTU(最大傳輸單元)路徑 

        先進(jìn)的路由跟蹤,支持所有的協(xié)議 

        遠(yuǎn)程操作系統(tǒng)探測 

        遠(yuǎn)程的運行時間探測 

        TCP/IP堆棧審計 

       Hping的詳細(xì)參數(shù) 


         -h --help 顯示幫助信息 

         -v --version 顯示Hping的版本信息 

         -c --count 指定數(shù)據(jù)包的次數(shù) 

         -i --interval 指定發(fā)包間隔為多少毫秒,如-i m10:表示發(fā)包間隔為10毫秒 

      附秒、毫秒、微秒進(jìn)率

       

      1s=1000ms(毫秒)=1000000(微秒)
             1s=10^3ms(毫秒)=10^6μs(微秒)


         --fast 與 -i m100等同,即每秒鐘發(fā)送10個數(shù)據(jù)包 

         -n --numeric 指定以數(shù)字形式輸出 

         -q --quiet 退出Hping 

         -I --interface 指定IP,如本機有兩塊網(wǎng)卡,可通過此參數(shù)指定發(fā)送數(shù)據(jù)包的IP地址。如果不指定則默認(rèn)使用網(wǎng)關(guān)IP 

         -V --verbose 冗余模式 

         -D --debug 調(diào)試信息 

         -z --bind 將ctrl+z 綁定到ttl,默認(rèn)使用DST端口 

         -Z --unbind 解除ctrl+z的綁定 

        指定所用的模式: 

         默認(rèn)模式 TCP模式 

         -0 --rawip RAW IP 模式 

         -1 --icmp ICMP 模式 

         -2 --udp UDP 模式 

         -8 --scan 掃描模式. 

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

         -9 --listen 監(jiān)聽模式 

        IP選項: 

         -a --spoof 源地址欺騙 

         --rand-dest 隨機目的地址模式 

         --rand-source 隨機源目的地址模式 

         -t --ttl ttl值,默認(rèn)為64 

         -N --id 指定id,默認(rèn)是隨機的 

         -W --winid 使用win*的id 字節(jié)順序 

         -r --rel 相對的id區(qū)域 

         -f --frag 將數(shù)據(jù)包分片后傳輸(可以通過薄弱的acl(訪問控制 

         列表)) 

         -x --morefrag 設(shè)置更多的分片標(biāo)記 

         -y --dontfrag 設(shè)置不加分片標(biāo)記 

         -g --fragoff 設(shè)置分片偏移 

         -m --mtu 設(shè)置虛擬MTU, 當(dāng)數(shù)據(jù)包>MTU時要使用--frag 進(jìn)行分片 

         -o --tos 指定服務(wù)類型,默認(rèn)是0x00,,可以使用--tos help查看幫助 

         -G --rroute 包含RECORD_ROUTE選項并且顯示路由緩存 

         --lsrr 釋放源路記錄 

         --ssrr 嚴(yán)格的源路由記錄 

         -H --ipproto 設(shè)置協(xié)議范圍,僅在RAW IP模式下使用 

        ICMP選項 

         -C --icmptype 指定icmp類型(默認(rèn)類型為回顯請求) 

         -K --icmpcode 指定icmp編碼(默認(rèn)為0) 

         --force-icmp 發(fā)送所有ICMP數(shù)據(jù)包類型(默認(rèn)只發(fā)送可以支持的類型) --icmp-gw 針對ICMP數(shù)據(jù)包重定向設(shè)定網(wǎng)關(guān)地址(默認(rèn)是0.0.0.0) 

         --icmp-ts 相當(dāng)于--icmp --icmptype 13(ICMP時間戳) 

         --icmp-addr 相當(dāng)于--icmp --icmptype 17(ICMP地址掩碼) 

         --icmp-help 顯示ICMP的其它幫助選項 

       

      UDP/TCP選項 

         -s --baseport 基本源端口(默認(rèn)是隨機的) 

         -p --destport 目的端口(默認(rèn)為0),可同時指定多個端口 

         -k --keep 仍然保持源端口 

         -w --win 指定數(shù)據(jù)包大小,默認(rèn)為64 

         -O --tcpoff 設(shè)置假的TCP數(shù)據(jù)偏移 

         -Q --seqnum 僅顯示TCP序列號 

         -b --badcksum 嘗試發(fā)送不正確IP校驗和的數(shù)據(jù)包 

        許多系統(tǒng)在發(fā)送數(shù)據(jù)包時使用固定的IP校驗和,因此你會得到不正確的UDP/TCP校驗和. 

         -M --setseq 設(shè)置TCP序列號 

         -L --setack 使用TCP的ACK(訪問控制列表) 

         -F --fin 使用FIN標(biāo)記set FIN flag 

         -S --syn 使用SNY標(biāo)記 

         -R --rst 使用RST標(biāo)記 

         -P --push 使用PUSH標(biāo)記 

         -A --ack 使用 ACK 標(biāo)記 

         -U --urg 使用URG標(biāo)記 

         -X --xmas 使用 X 未用標(biāo)記 (0x40) 

         -Y --ymas 使用 Y 未用標(biāo)記 (0x80) 

         --tcpexitcode 最后使用 tcp->th_flags 作為退出代碼 

         --tcp-timestamp 啟動TCP時間戳選項來猜測運行時間 

        常規(guī)選項 

         -d --data 數(shù)據(jù)大小,默認(rèn)為0 

         -E --file 從指定文件中讀取數(shù)據(jù) 

         -e --sign 增加簽名 

         -j --dump 以十六進(jìn)行形式轉(zhuǎn)存數(shù)據(jù)包 

         -J --print 轉(zhuǎn)存可輸出的字符 

         -B --safe 啟用安全協(xié)議 

         -u --end 當(dāng)通過- -file指定的文件結(jié)束時停止并顯示,防止文件再從頭開始 

         -T --traceroute 路由跟蹤模式 

         --tr-stop 在路由跟蹤模式下當(dāng)收到第一個非ICMP數(shù)據(jù)包時退出 

         --tr-keep-ttl 保持源TTL,對監(jiān)測一個hop有用 

         --tr-no-rtt 使用路由跟蹤模式時不計算或顯示RTT信息 

        ARS 數(shù)據(jù)包描述(新增加的內(nèi)容,暫時還不穩(wěn)定) 

         --apd-send 發(fā)送用描述APD的數(shù)據(jù)包 

      =============================================================

      HPING 使用方法

      一、HPING和ping的區(qū)別:

      典型ping程序使用的是ICMP回顯請求來測試,而HPING可以使用任何IP報文,包括ICMP、TCP、UDP、RAWSOCKET。

      二、下載:

      HTTP://WWW.HPING.ORG/

      三、安裝(CentOS 5.5 64)  

      安裝過程沒有想象中的順利,測試了好長時間才成功?。?!

      1、安裝基礎(chǔ)庫

      [root@localhost ~]# yum -y install gcc libpcap-devel   tcl-devel

      注意:此環(huán)境必須安裝tcl-devel包才可以,不然一直出錯,所表現(xiàn)的錯誤在下面已一一列出,請參閱下面提示

      2、下載源碼包

      [root@localhost ~]# wget http://www.hping.org/hping3-20051105.tar.gz

      3、編譯安裝

      [root@localhost ~]# tar -zxvf hping3-20051105.tar.gz 

      [root@localhost ~]# cd hping3-20051105

      [root@localhost hping3-20051105]# ./configure

      。。。。。。。。。。。。

       

      creating Makefile...

      creating dependences...

      In file included from ars.h:20,

                       from apd.c:19:

      bytesex.h:22:3: error: #error can not find the byte order for this architecture, fix bytesex.h

      In file included from apd.c:19:

      ars.h:190:2: error: #error "Please, edit Makefile and add -DBYTE_ORDER_(BIG|LITTLE)_ENDIAN"

      ars.h:254:2: error: #error "Please, edit Makefile and add -DBYTE_ORDER_(BIG|LITTLE)_ENDIAN"

      ars.h:323:2: error: #error "Please, edit Makefile and add -DBYTE_ORDER_(BIG|LITTLE)_ENDIAN"

      。。。。。。。。。。。。。。。。。。。

       

      解決方法:

      從錯誤提示上看,又是什么高位前低位后到問題,打開Makefile,找了好久也找不到去哪兒添加這個環(huán)境變量,遂Google之,原來是因為64位機到緣故,遂修改上面說到的 bytesex.h (添加紅色區(qū)域部分)

       

      [root@localhost hping3-20051105]# vi bytesex.h

      /* Original code from the Linux C library */

      /* Copyright (C) 2000,2001 Salvatore Sanfilippo <antirez@invece.org>

       * This code is under the original GNU C library license (GPL) */

      /* $Id: bytesex.h,v 1.1.1.1 2003/08/31 17:23:48 antirez Exp $ */

      #ifndef ARS_BYTESEX_H

      #define ARS_BYTESEX_H

      #if     defined(__i386__) \

      || defined(__x86_64__) \

              || defined(__alpha__) \

              || (defined(__mips__) && (defined(MIPSEL) || defined (__MIPSEL__)))

      #define BYTE_ORDER_LITTLE_ENDIAN

      #elif   defined(__mc68000__) \

              || defined (__sparc__) \

              || defined (__sparc) \

              || defined (__PPC__) \

              || defined (__BIG_ENDIAN__) \

              || (defined(__mips__) && (defined(MIPSEB) || defined (__MIPSEB__)))

      #define BYTE_ORDER_BIG_ENDIAN

      #else

      # error can not find the byte order for this architecture, fix bytesex.h

      #endif

      #endif /* ARS_BYTESEX_H */

      繼續(xù)安裝。。。

      [root@localhost hping3-20051105]# make                                             

      gcc -c -O2 -Wall    -g  main.c

      gcc -c -O2 -Wall    -g  getifname.c

      getifname.c: In function ‘get_output_if’:

      getifname.c:343: warning: pointer targets in passing argument 3 of ‘getsockname’ differ in signedness

      。。。。。。。。。。

      gcc -c -O2 -Wall    -g  libpcap_stuff.c

      libpcap_stuff.c:20:21: error: net/bpf.h: No such file or directory

      libpcap_stuff.c: In function ‘pcap_recv’:

      libpcap_stuff.c:61: warning: pointer targets in assignment differ in signedness

      make: *** [libpcap_stuff.o] Error 1   

       

      提示我bpf.h文件未找到,印象中這個文件應(yīng)該是libpcap的一部分才是阿~~~

      按如下提示作個鏈接

      [root@localhost hping3-20051105]# ln -s /usr/include/pcap.h  /usr/include/net/bpf.h

      繼續(xù)make

      [root@localhost hping3-20051105]# make

      又出現(xiàn)了如下錯誤

      。。。。。。。。。。

       

      /usr/bin/ld: cannot find -ltcl

      collect2: ld returned 1 exit status

      make: *** [hping3] Error 1

      這個錯誤排除了鏈接原因外就是沒有安裝tcp-devel包(上面第一步使用yum搭建基礎(chǔ)環(huán)境中的紅色字體部分是我后添加上去的,走了很多彎路測試了好多次才找到原因啊~~)

      安裝tcl-devel包(如果第一步已安裝,此外不用再重提安裝?。。?/p>

      [root@localhost yum.repos.d]# yum install tcl-devel

      再次make 

       

      [root@localhost hping3-20051105]# make

      gcc -o hping3 -O2 -Wall    -g main.o getifname.o getlhs.o parseoptions.o datafiller.o datahandler.o gethostname.o binding.o getusec.o opensockraw.o logicmp.o waitpacket.o resolve.o sendip.o sendicmp.o sendudp.o sendtcp.o cksum.o statistics.o usage.o version.o antigetopt.o sockopt.o listen.o sendhcmp.o memstr.o rtt.o relid.o sendip_handler.o libpcap_stuff.o memlockall.o memunlockall.o memlock.o memunlock.o ip_opt_build.o display_ipopt.o sendrawip.o signal.o send.o strlcpy.o arsglue.o random.o scan.o hstring.o script.o interface.o adbuf.o hex.o apdutils.o sbignum.o sbignum-tables.o ars.o apd.o split.o rapd.o -L/usr/local/lib -lpcap  -ltcl -lm -lpthread

      ./hping3 -v

      hping version 3.0.0-alpha-1 ($Id: release.h,v 1.4 2004/04/09 23:38:56 antirez Exp $)

      NO TCL scripting support compiled in

      use `make strip' to strip hping3 binary

      use `make install' to install hping3

      又出錯。。。暈了。。

      按上面紅色字體提示部分進(jìn)行安裝

       

      [root@localhost hping3-20051105]# make strip

      -rwxr-xr-x 1 root root 436351 Jun 13 11:03 ./hping3

      strip hping3

      -rwxr-xr-x 1 root root 117368 Jun 13 11:03 ./hping3

       

      [root@localhost hping3-20051105]# make strip

      -rwxr-xr-x 1 root root 436351 Jun 13 11:03 ./hping3

      strip hping3

      -rwxr-xr-x 1 root root 117368 Jun 13 11:03 ./hping3

      [root@localhost hping3-20051105]# make install

      cp -f hping3 /usr/sbin/

      chmod 755 /usr/sbin/hping3

      ln -s /usr/sbin/hping3 /usr/sbin/hping

      ln -s /usr/sbin/hping3 /usr/sbin/hping2

      @@@@@@ WARNING @@@@@@

      Can't install the man page: /usr/local/man/man8 does not exist

      這應(yīng)試安裝成功了吧。。。。。

      測試是否可用

       

      [root@localhost hping3-20051105]# hping2 -c 4 -n -i 2 192.168.18.118

      HPING 192.168.18.118 (eth0 192.168.18.118): NO FLAGS are set, 40 headers + 0 data bytes

      len=46 ip=192.168.18.118 ttl=64 DF id=4638 sport=0 flags=RA seq=0 win=0 rtt=1.7 ms

      len=46 ip=192.168.18.118 ttl=64 DF id=4796 sport=0 flags=RA seq=1 win=0 rtt=0.3 ms

      len=46 ip=192.168.18.118 ttl=64 DF id=4966 sport=0 flags=RA seq=2 win=0 rtt=0.3 ms

      len=46 ip=192.168.18.118 ttl=64 DF id=5069 sport=0 flags=RA seq=3 win=0 rtt=0.3 ms

      --- 192.168.18.118 hping statistic ---

      4 packets tramitted, 4 packets received, 0% packet loss

      round-trip min/avg/max = 0.3/0.6/1.7 ms

      [root@localhost hping3-20051105]# 

       

       

       

       

      附此類問題解決思路:http://blog.itechol.com/space.php?uid=33&do=blog&id=5773             

       

      四、命令注釋:

      tsinghua@tsinghua-desktop:~$ hping2 --help

      usage: hping host [options]

      -h --help show this help //help

      -v --version show version //版本

      -c --count packet count //hping的包數(shù)量 和ping相同。

      -i --interval wait (uX for X microseconds, for example -i u1000) //hping的間隔 u表示微妙,--fast表示快速模式,一秒10個包。

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

      -n --numeric numeric output //表示不進(jìn)行名稱解析。

      -q --quiet quiet //安靜模式 只輸出開始結(jié)束信息。

      -I --interface interface name (otherwise default routing interface) //-使用網(wǎng)卡端口,缺省按路由表進(jìn)行。

      -V --verbose verbose mode //詳細(xì)模式 一般顯示很多包信息。

      -D --debug debugging info //debug模式,定義hping2使用模式。

      -z --bind bind ctrl+z to ttl (default to dst port)//幫定快捷鍵

      -Z --unbind unbind ctrl+z //撤銷快捷鍵。

      Mode //模式選擇。

      default mode TCP (缺省使用TCP進(jìn)行PING處理)

      -0 --rawip RAW IP mode //裸IP方式。使用RAWSOCKET方式。

      -1 --icmp ICMP mode //ICMP模式。

      -2 --udp UDP mode //UDP模式

      -8 --scan SCAN mode. //掃描模式 指定掃描對應(yīng)的端口。

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

      -9 --listen listen mode //偵聽模式,會接受指定的信息。偵聽指定的信息內(nèi)容。

      IP //IP模式選擇。

      -a --spoof spoof source address //源地址欺騙。

      --rand-dest random destionation address mode. see the man.隨機目的地址模式。

      --rand-source random source address mode. see the man. 隨機源地址模式,具體信息看MAN。

      -t --ttl ttl (default 64) //修改TTL值。

      -N --id id (default random) --h(huán)ping中的ID值,缺省為隨機值。

      -W --winid use win* id byte ordering 使用winid的模式,針對不同的操作系統(tǒng)。

      -r --rel relativize id field (to estimate host traffic) //遞減id區(qū)域模式。

      -f --frag split packets in more frag. (may pass weak acl)//分段,可以測試對方或者交換機碎片處理能力,缺省16字節(jié)。

      -x --morefrag set more fragments flag //大量碎片,淚滴攻擊。

      -y --dontfrag set dont fragment flag //不可恢復(fù)的IP碎片。

      -g --fragoff set the fragment offset //設(shè)置斷偏移。

      -m --mtu set virtual mtu, implies --frag if packet size > mtu //設(shè)置虛擬MTU值,當(dāng)大于mtu的時候分段。

      -o --tos type of service (default 0x00), try --tos help //tos字段,缺省0x00,盡力而為?

      -G --rroute includes RECORD_ROUTE option and display the route buffer //記錄IP路由,并顯示路由緩沖。

      --lsrr loose source routing and record route //松散源路由

      --ssrr strict source routing and record route //嚴(yán)格源路由。

      -H --ipproto set the IP protocol field, only in RAW IP mode //設(shè)置ip協(xié)議域,僅在RAW ip模式使用。

      ICMP //ICMP模式。

      -C --icmptype icmp type (default echo request) //ICMP類型,缺省回顯請求。

      -K --icmpcode icmp code (default 0) //ICMP代碼。

      --force-icmp send all icmp types (default send only supported types) //強制ICMP類型。

      --icmp-gw set gateway address for ICMP redirect (default 0.0.0.0) //ICMP重定向

      --icmp-ts Alias for --icmp --icmptype 13 (ICMP timestamp) //icmp時間戳

      --icmp-addr Alias for --icmp --icmptype 17 (ICMP address subnet mask) //icmp子網(wǎng)地址。

      --icmp-help display help for others icmp options //ICMP幫助。

      UDP/TCP //UDP/TCP模式。

      -s --baseport base source port (default random) //缺省隨機源端口

      -p --destport [+][+]<port> destination port(default 0) ctrl+z inc/dec //缺省目的端口為0,連接后端口+1。

      -k --keep keep still source port //保持源端口

      -w --win winsize (default 64) //win的滑動窗口。

      -O --tcpoff set fake tcp data offset (instead of tcphdrlen / 4)//設(shè)置偽造的數(shù)據(jù)偏移。

      -Q --seqnum shows only tcp sequence number //tcp 連接序列號

      -b --badcksum (try to) send packets with a bad IP checksum //IP包校驗。

      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 //設(shè)置TCP序列號

      -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 //一大堆IP抱頭的設(shè)置。

      -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 //tcp的時間戳。

      Common //通用設(shè)置

      -d --data data size (default is 0) 發(fā)送數(shù)據(jù)包大小,缺省是0。

      -E --file data from file //從文件中發(fā)送

      -e --sign add 'signature' //標(biāo)注簽名

      -j --dump dump packets in hex //以16進(jìn)制顯示包格式

      -J --print dump printable characters //打印

      -B --safe enable 'safe' protocol //開啟安全模式,確保數(shù)據(jù)發(fā)送。

      -u --end tell you when --file reached EOF and prevent rewind //到達(dá)報尾后提示。

      -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)

      五、具體應(yīng)用:

      1、PING失效后的主機檢測:

       

      [root@localhost hping3-20051105]# hping2 192.168.18.188

      HPING 192.168.18.188 (eth0 192.168.18.188): NO FLAGS are set, 40 headers + 0 data bytes

      --- 192.168.18.188 hping statistic ---

      9 packets tramitted, 0 packets received, 100% packet loss

      round-trip min/avg/max = 0.0/0.0/0.0 ms

       

       

      [root@localhost hping3-20051105]# hping2 -c 4 -n -i 2 192.168.18.251

      HPING 192.168.18.251 (eth0 192.168.18.251): NO FLAGS are set, 40 headers + 0 data bytes

      len=46 ip=192.168.18.251 ttl=64 DF id=0 sport=0 flags=RA seq=0 win=0 rtt=0.7 ms

      len=46 ip=192.168.18.251 ttl=64 DF id=0 sport=0 flags=RA seq=1 win=0 rtt=0.3 ms

      len=46 ip=192.168.18.251 ttl=64 DF id=0 sport=0 flags=RA seq=2 win=0 rtt=0.3 ms

      len=46 ip=192.168.18.251 ttl=64 DF id=0 sport=0 flags=RA seq=3 win=0 rtt=0.2 ms

      --- 192.168.18.251 hping statistic ---

      4 packets tramitted, 4 packets received, 0% packet loss

      round-trip min/avg/max = 0.2/0.4/0.7 ms

       

      -c 發(fā)送4個報文 -n 不進(jìn)行名稱解析 -i 包發(fā)送時間間隔。

      顯示信息解釋:len,返 回ip報文大小;ttl; id,IP的ID域;sport,源端口,flags,返回的IP報設(shè)置的TCP標(biāo)志 (R:RESET,A:ACK;S:SYN;F:FIN;P:PUSH;U:URGENT);seq:序列號;win:tcp窗口大小;rtt:往返 時,EIGRP似乎有這個設(shè)置。

      好處:

      即使主機阻塞了ICMP報文,也可以顯示主機是否在運行的信息,在關(guān)掉ICMP的探測有效!

      如下示:

      主機192.168.18.117上我設(shè)置了 iptables阻止icmp包響應(yīng)。

       

      [root@localhost ~]# iptables -L

      Chain INPUT (policy ACCEPT)

      target     prot opt source               destination         

      DROP       icmp --  anywhere             anywhere            

      Chain FORWARD (policy ACCEPT)

      target     prot opt source               destination         

      Chain OUTPUT (policy ACCEPT)

      target     prot opt source               destination    

       

      使用ping測試是否能通

       

      [root@localhost hping3-20051105]# ping 192.168.18.117

      PING 192.168.18.117 (192.168.18.117) 56(84) bytes of data.

      --- 192.168.18.117 ping statistics ---

      3 packets transmitted, 0 received, 100% packet loss, time 2000ms

      [root@localhost hping3-20051105]# 

      使用hping2測試是否有響應(yīng)包

       

      [root@localhost hping3-20051105]# hping2 192.168.18.117

      HPING 192.168.18.117 (eth0 192.168.18.117): NO FLAGS are set, 40 headers + 0 data bytes

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=0 flags=RA seq=0 win=0 rtt=0.4 ms

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=0 flags=RA seq=1 win=0 rtt=0.3 ms

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=0 flags=RA seq=2 win=0 rtt=0.3 ms

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=0 flags=RA seq=3 win=0 rtt=0.3 ms

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=0 flags=RA seq=4 win=0 rtt=0.3 ms

      --- 192.168.18.117 hping statistic ---

      5 packets tramitted, 5 packets received, 0% packet loss

      round-trip min/avg/max = 0.3/0.3/0.4 ms

      [root@localhost hping3-20051105]# 

       

       

      2、防火墻規(guī)則測試:

      hping有類似NMAP的方法來檢測并收集關(guān)于潛在的防火墻的規(guī)則和能力的信息。

      如果一個主機對ping沒有任何相應(yīng),而對hping有響應(yīng),假定目標(biāo)的主機為192.168.2.234.

      一旦主機對hping作出了響應(yīng),那么下一步我們先用nmap先進(jìn)行一個端口掃描,

      當(dāng)然這個hping2也可以作掃描

      如下示:

       

      [root@localhost hping3-20051105]# hping2 --scan 1-100 -S 192.168.18.251

      Scanning 192.168.18.251 (192.168.18.251), port 1-100

      100 ports to scan, use -V to see all the replies

      +----+-----------+---------+---+-----+-----+-----+

      |port| serv name |  flags  |ttl| id  | win | len |

      +----+-----------+---------+---+-----+-----+-----+

         21 ftp        : .S..A...  64     0  5840    46

         22 ssh        : .S..A...  64     0  5840    46

         23 telnet     : .S..A...  64     0  5840    46

         80 http       : .S..A...  64     0  5840    46

      All replies received. Done.

      Not responding ports: 

       

       

      [root@localhost hping3-20051105]# nmap -sT -P0 -p 21-25 192.168.18.251

      Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2012-06-13 15:44 CST

      Interesting ports on bogon (192.168.18.251):

      PORT   STATE  SERVICE

      21/tcp open   ftp

      22/tcp open   ssh

      23/tcp open   telnet

      24/tcp closed priv-mail

      25/tcp closed smtp

      Nmap finished: 1 IP address (1 host up) scanned in 1.110 seconds

      請看下面一個示例分析:

       

      [root@localhost hping3-20051105]# nmap -sT -P0 -p 21-25 192.168.18.117

      Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2012-06-13 15:55 CST

      Interesting ports on bogon (192.168.18.117):

      PORT   STATE  SERVICE

      21/tcp closed ftp

      22/tcp open   ssh

      23/tcp closed telnet

      24/tcp closed priv-mail

      25/tcp closed smtp

      Nmap finished: 1 IP address (1 host up) scanned in 0.008 seconds

      以上信息顯示除了ssh端口外,其他端口被阻塞.

      然后可以試試用hping向各個被阻塞的端口發(fā)送空的報文.用-p的開關(guān),可以對指定的目的端口進(jìn)行hping.

       

      [root@localhost hping3-20051105]# hping2 -c 2 -n -i 2 -p 21 192.168.18.117 

      HPING 192.168.18.117 (eth0 192.168.18.117): NO FLAGS are set, 40 headers + 0 data bytes

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=21 flags=RA seq=0 win=0 rtt=0.3 ms

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=21 flags=RA seq=1 win=0 rtt=0.3 ms

      --- 192.168.18.117 hping statistic ---

      2 packets tramitted, 2 packets received, 0% packet loss

      round-trip min/avg/max = 0.3/0.3/0.3 ms

       

      [root@localhost hping3-20051105]# hping2 -c 2 -n -i 2 -p 23 192.168.18.117 

      HPING 192.168.18.117 (eth0 192.168.18.117): NO FLAGS are set, 40 headers + 0 data bytes

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=23 flags=RA seq=0 win=0 rtt=0.4 ms

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=23 flags=RA seq=1 win=0 rtt=0.2 ms

      --- 192.168.18.117 hping statistic ---

      2 packets tramitted, 2 packets received, 0% packet loss

      round-trip min/avg/max = 0.2/0.3/0.4 ms

       

       

      [root@localhost hping3-20051105]# hping2 -c 2 -n -i 2 -p 24 192.168.18.117 

      HPING 192.168.18.117 (eth0 192.168.18.117): NO FLAGS are set, 40 headers + 0 data bytes

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=24 flags=RA seq=0 win=0 rtt=0.5 ms

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=24 flags=RA seq=1 win=0 rtt=0.4 ms

      --- 192.168.18.117 hping statistic ---

      2 packets tramitted, 2 packets received, 0% packet loss

      round-trip min/avg/max = 0.4/0.4/0.5 ms

       

      [root@localhost hping3-20051105]# hping2 -c 2 -n -i 2 -p 25 192.168.18.117 

      HPING 192.168.18.117 (eth0 192.168.18.117): NO FLAGS are set, 40 headers + 0 data bytes

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=25 flags=RA seq=0 win=0 rtt=0.6 ms

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=25 flags=RA seq=1 win=0 rtt=0.2 ms

      --- 192.168.18.117 hping statistic ---

      2 packets tramitted, 2 packets received, 0% packet loss

      round-trip min/avg/max = 0.2/0.4/0.6 ms

      端口21 23 24 25 獲得了RST/ACK響應(yīng).這說明,雖然這些端口被禁止PING,但沒有工具在該端口上監(jiān)聽.

      然而為什么NMAP沒有得到響應(yīng),因為NMAP雖然使用 TCP連接,但它在TCP報頭中設(shè)置了TCP SYN標(biāo)記位,而HPING 使用了空標(biāo)記的報文,這就告訴我們說,在主機192.168.18.117上只阻塞進(jìn)入的TCP連接.

      接下來使用hping創(chuàng)建一個SYN報文然后將其發(fā)送到5個端口再測試.

       

      [root@localhost hping3-20051105]# hping2 -c 2 -n -i 2 -S -p 21 192.168.18.117

      HPING 192.168.18.117 (eth0 192.168.18.117): S set, 40 headers + 0 data bytes

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=21 flags=RA seq=0 win=0 rtt=0.3 ms

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=21 flags=RA seq=1 win=0 rtt=0.3 ms

      --- 192.168.18.117 hping statistic ---

      2 packets tramitted, 2 packets received, 0% packet loss

      round-trip min/avg/max = 0.3/0.3/0.3 ms

      [root@localhost hping3-20051105]# hping2 -c 2 -n -i 2 -S -p 22 192.168.18.117

      HPING 192.168.18.117 (eth0 192.168.18.117): S set, 40 headers + 0 data bytes

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=22 flags=SA seq=0 win=5840 rtt=0.4 ms

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=22 flags=SA seq=1 win=5840 rtt=0.3 ms

      --- 192.168.18.117 hping statistic ---

      2 packets tramitted, 2 packets received, 0% packet loss

      round-trip min/avg/max = 0.3/0.3/0.4 ms

      [root@localhost hping3-20051105]# hping2 -c 2 -n -i 2 -S -p 23 192.168.18.117

      HPING 192.168.18.117 (eth0 192.168.18.117): S set, 40 headers + 0 data bytes

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=23 flags=RA seq=0 win=0 rtt=0.2 ms

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=23 flags=RA seq=1 win=0 rtt=0.3 ms

      --- 192.168.18.117 hping statistic ---

      2 packets tramitted, 2 packets received, 0% packet loss

      round-trip min/avg/max = 0.2/0.3/0.3 ms

      [root@localhost hping3-20051105]# hping2 -c 2 -n -i 2 -S -p 24 192.168.18.117

      HPING 192.168.18.117 (eth0 192.168.18.117): S set, 40 headers + 0 data bytes

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=24 flags=RA seq=0 win=0 rtt=0.3 ms

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=24 flags=RA seq=1 win=0 rtt=0.3 ms

      --- 192.168.18.117 hping statistic ---

      2 packets tramitted, 2 packets received, 0% packet loss

      round-trip min/avg/max = 0.3/0.3/0.3 ms

      [root@localhost hping3-20051105]# hping2 -c 2 -n -i 2 -S -p 25 192.168.18.117

      HPING 192.168.18.117 (eth0 192.168.18.117): S set, 40 headers + 0 data bytes

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=25 flags=RA seq=0 win=0 rtt=0.4 ms

      len=46 ip=192.168.18.117 ttl=64 DF id=0 sport=25 flags=RA seq=1 win=0 rtt=0.3 ms

      --- 192.168.18.117 hping statistic ---

      2 packets tramitted, 2 packets received, 0% packet loss

      round-trip min/avg/max = 0.3/0.4/0.4 ms

      這次只有22端口響應(yīng),說明SSH端口是開放的,但有工具在上面監(jiān)聽,該端口沒有進(jìn)行過濾.

       

      posted @ 2016-11-28 16:41  lpfuture  閱讀(4351)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 日本无遮挡真人祼交视频| 久久国产免费观看精品3| 成人污视频| 高清无码爆乳潮喷在线观看| 极品人妻少妇一区二区三区| 亚洲高请码在线精品av| 国产精品一区在线免费看| 欧美人与zoxxxx另类| 日韩精品一区二区三区激情视频| 丰满高跟丝袜老熟女久久| 国产亚洲精品中文字幕| 国精一二二产品无人区免费应用| AI做受???高潮AAAA视频| 久久99热只有频精品8| 兰州市| 国产精品自产在线观看一| 亚洲岛国成人免费av| 九九久久精品国产| 亚洲宅男精品一区在线观看| 亚洲综合在线日韩av| 田林县| 色伊人久久综合中文字幕| 天天躁夜夜躁狠狠喷水| 亚洲欧美高清在线精品一区二区| 国产免费午夜福利在线播放| AV人摸人人人澡人人超碰| 精品 无码 国产观看| 九九在线精品国产| 国产精品自在线拍国产手青青机版 | 国产欧美精品区一区二区三区 | 亚洲精品乱码久久久久久按摩高清| 中文字幕国产精品综合| 国产aⅴ夜夜欢一区二区三区| 18禁动漫一区二区三区| 99在线精品国自产拍中文字幕| 萝北县| 四房播色综合久久婷婷| 丰满人妻一区二区三区高清精品 | 日韩亚洲国产综合高清| 国产精品中文第一字幕| 国产亚洲精品一区二区无|