cisco ios 12.45T新特性-FPM

cisco ios 12.45T新特性-FPM

cisco ios 12.4.15T系列中推出了新的FPM技術。簡單的介紹一下cisco fpm技術。fpm技術在cisco iso 12.4.4T中已經推出,在cisco iso 12.4.4T之前,fpm能夠檢測IP包的前256byte中的最多32byte的數據,檢測出與配置相符合的數據,你可以選擇丟棄或者允許通過或者log,當然還有其他功能,這裏不一一細表。而在cisco iso 12.4.15T中cisco強化了fpm的功能,使其能檢測整個IP數據包(最大1500byte)中最多256byte的數據。這實際上等於在cisco router上安裝了一個sniffer軟件,然後通過配置決定什麼數據能夠被允許通過,什麼數據要丟棄。
cisco的推出fpm技術的初衷是通過fpm技術來強化網絡安全,封堵網絡病毒及各種***

一個封PPLIVE的例子
一.用udp 8000端口進行登陸
這種登陸方式最簡單的封堵方法就是用access-list,方式如下:
access-list 199 deny udp any any eq 8000
int f0/0
ip access-group 199 in
但是,對這種方式我並不滿意,因爲除了pplive使用udp8000端口以外,還有好多程序使用udp800端口,比如說QQ。
使用sniffer軟件反複分析,我找到了udp8000包的特徵。
1.ip包長度 97byte
2.udp目的端口 8000
3.在ip包的第28位起包含4個byte的特徵字段:E9030201
4.在ip包的第32位起包含4個byte的特徵字段:98AB0102
變換成cisco的配置文件就是:
class-map type access-control match-all pplive-udp8000-request
match field UDP dest-port eq 8000
match field IP length eq 97
match start l3-start offset 28 size 4 eq 0xE9030201
match start l3-start offset 32 size 4 eq 0x98AB0102
注意:上面offset的數值要注意,如果是ip包中的第一個byte位,則offset爲0,第二個byte位,則offset爲1,offset是從0開始計數而不是1,這個問題我有教訓,cisco網站上也沒有寫明,提醒一下大家。
OK,udp8000的請求包的問題解決

二.使用tcp 80端口進行登陸,也就是用http登陸,並下載用戶列表
解決這個問題我就頭大了,因爲用sniffer反複分析,從用戶端向pplive server發送的http包基本沒有數據淨載就是沒有payload,我無法取得數據包的特徵。(應該是有的,但是我沒有找到)

那好了,請求的包沒有特徵,那從pplive server迴應的包有沒有特徵了。

還好是有的。

迴應包的特徵如下:

1.tcp源端口80
2.在ip包的第52位起包含2個byte的特徵字段:E903
3.在ip包的第56位起包含4個byte的特徵字段:98AB0102

變換成cisco的配置文件就是:
class-map type access-control match-all pplive-http-answer-I
match start l3-start offset 52 size 2 eq 0xE903
match start l3-start offset 56 size 4 eq 0x98AB0102
match field TCP source-port eq 80

配置完成後,我想應該是大功告成了,一測試,nnd,pplive還能照樣工作。

於是在這兩條policy工作的情況下我再次使用sniffer抓包,結果,發現在pplive server在原有格式http包被丟棄的情況下,修改了http的格式。

特徵如下:

1.tcp源端口80
2.在ip包的第56位起包含2個byte的特徵字段:E903
3.在ip包的第60位起包含4個byte的特徵字段:98AB0102

變換成cisco的配置文件就是:
class-map type access-control match-all pplive-http-answer-II
match start l3-start offset 56 size 2 eq 0xE903
match start l3-start offset 60 size 4 eq 0x98AB0102
match field TCP source-port eq 80



下面是完整的配置文件:

load protocol flash:ip.phdf
load protocol flash:tcp.phdf
load protocol flash:udp.phdf

class-map type stack match-all ip-tcp
match field IP protocol eq 0x6 next TCP

class-map type stack match-all ip-udp
match field IP protocol eq 0x11 next UDP

class-map type access-control match-all pplive-udp8000-request
match field UDP dest-port eq 8000
match field IP length eq 97
match start l3-start offset 28 size 4 eq 0xE9030201
match start l3-start offset 32 size 4 eq 0x98AB0102

class-map type access-control match-all pplive-http-answer-I
match start l3-start offset 52 size 2 eq 0xE903
match start l3-start offset 56 size 4 eq 0x98AB0102
match field TCP source-port eq 80

class-map type access-control match-all pplive-http-answer-II
match start l3-start offset 56 size 2 eq 0xE903
match start l3-start offset 60 size 4 eq 0x98AB0102
match field TCP source-port eq 80
!
policy-map type access-control fpm-udp-policy
class pplive-udp8000-request
log
drop
policy-map type access-control fpm-tcp-policy
class pplive-http-answer-I
log
drop
class pplive-http-answer-II
log
drop
policy-map type access-control fpm-output-policy
class ip-tcp
service-policy fpm-tcp-policy
policy-map type access-control fpm-input-policy
class ip-udp
service-policy fpm-udp-policy


interface FastEthernet0/0
description $FW_INSIDE$
ip address 172.24.43.100 255.255.255.0
no ip redirects
no ip unreachables
no ip proxy-arp
ip nat inside
ip virtual-reassembly
ip route-cache flow
ip tcp adjust-mss 1452
duplex auto
speed auto
no mop enabled
service-policy type access-control input fpm-input-policy
service-policy type access-control output fpm-output-policy

關於fpm的配置,有些地方我就不再做很多講解,否則能要寫個xx頁,大家如果有興趣,可以到
[url]www.cisco.com/go/fpm[/url]上去仔細看看。

反正我覺得fpm的推出,對於水平比較高的網絡管理人員是非常好的,它是一個強大的工具,可以讓網絡管理員對網絡進行準確到bit的管理。

注:只有高級安全版、高級IP版和高級企業版的12.4.4T以上版本才能使用fpm,我的經驗是最好現在不要用12.4.15T,因爲這個版本剛剛推出bug很多,我在配置時死機好幾次。我用的是高級企業版的12.4.9T5,硬件平臺是cisco 1841。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章