ASA对FTP的审查抓包测试
生活随笔
收集整理的這篇文章主要介紹了
ASA对FTP的审查抓包测试
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
一.概述: 聽了yeslab的秦珂老師的ASA視頻,說(shuō)PAT時(shí),FTP服務(wù)器在Outside,FTP客戶端在Inside,這種情況主動(dòng)FTP能正常工作是因?yàn)?ftp審查可以使得穿越PAT時(shí)FTP能正常工作(修改了FTP應(yīng)用層的數(shù)據(jù)),并且使得FTP主動(dòng)模式下從Outside主動(dòng)向Inside發(fā)起的包能夠順利通過(guò)防火墻。因?yàn)樵诼酚善魃吓渲肞AT,FTP也能正常工作,因此打算測(cè)試一下,到底是FTP審查使得PAT能正常工作,還是ASA自身的PAT就能使得PAT能正常工作。
二.測(cè)試思路及結(jié)論: A.關(guān)閉ASA的FTP審查,確認(rèn)FTP被動(dòng)模式是否能正常工作 ----能正常工作,FTP被動(dòng)模式都由Inside的FTP客戶端主動(dòng)發(fā)起,防火墻不需要放行策略的FTP審查就能正常工作 B.關(guān)閉ASA的FTP審查,Inside路由器作為FTP客戶端設(shè)置為主動(dòng)模式,確認(rèn)FTP主動(dòng)模式是否能正常工作 ----不能正常工作,通過(guò)抓包可以發(fā)現(xiàn),Outside接口FTP服務(wù)器收到的FTP客戶端的發(fā)送的FTP應(yīng)用層的數(shù)據(jù)中IP沒(méi)有被更改,FTP服務(wù)器主動(dòng)去連接PAT之前的地址,導(dǎo)致連接無(wú)法建立 ----進(jìn)一步確認(rèn)了老師講課所說(shuō)的是正確的 三.測(cè)試拓?fù)?#xff1a; 四.基本配置: A.FTP服務(wù)器 ip:202.100.1.1/24 開啟3CDamon,并配置FTP服務(wù)器 B.ASA842防火墻: ①接口配置 interface GigabitEthernet0
nameif Outside
security-level 0
ip address 202.100.1.10 255.255.255.0
no shut
interface GigabitEthernet1
nameif Inside
security-level 100
ip address 10.1.1.10 255.255.255.0
no shut、 ②全局policy map修改: ----關(guān)閉FTP審查,并且啟用icmp審查 policy-map global_policy class inspection_default no inspect ftp inspect icmp ③PAT配置: object network Inside_net subnet 10.1.1.0 255.255.255.0 nat (inside,outside) dynamic interface C.Inside路由器: ①接口配置: interface Ethernet0/0 ip address 10.1.1.1 255.255.255.0
no shut ②默認(rèn)路由配置: ip route 0.0.0.0 0.0.0.0 10.1.1.10 ③FTP用戶名和密碼配置: ip ftp username xll
ip ftp password 1234qwer, 五.測(cè)試步驟: A.關(guān)閉FTP審查后,被動(dòng)FTP能正常工作 ①被動(dòng)FTP能正常傳文件 Inside#copy ftp: flash:
Address or name of remote host [202.100.1.1]?
Source filename [202.100.1.1]? xx.txt
Destination filename [xx.txt]?
%Warning:There is a file already existing with this name
Do you want to over write? [confirm]
Accessing ftp://202.100.1.1/xx.txt...
Erase flash: before copying? [confirm]
Erasing the flash filesystem will remove all files! Continue? [confirm]
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
Erase of flash: complete
Loading xx.txt
[OK - 24/4096 bytes]
Verifying checksum... OK (0x8A8A)
24 bytes copied in 6.820 secs (4 bytes/sec)
Inside# ②Inside路由器接口抓包:
③Outside接口FTP服務(wù)器上面抓包:
B.關(guān)閉FTP審查后,主動(dòng)FTP不能正常工作: ①Inside路由器設(shè)置FTP客戶端為主動(dòng)模式: (config)#no ip ftp passive ②主動(dòng)FTP無(wú)法正常工作: Inside#copy ftp: flash:
Address or name of remote host [202.100.1.1]?
Source filename [202.100.1.1]? xx.txt
Destination filename [xx.txt]?
%Warning:There is a file already existing with this name
Do you want to over write? [confirm]
Accessingftp://202.100.1.1/xx.txt... ③Inside路由器接口抓包:
④Outside的FTP服務(wù)器抓包: ---從抓包中,確實(shí)可以看到,如果不開啟FTP審查的話,ASA不會(huì)修改FTP應(yīng)用層的IP地址,因?yàn)镕TP服務(wù)器收到FTP客戶端告訴給它的地址為內(nèi)網(wǎng)PAT前的地址,導(dǎo)致FTP服務(wù)器無(wú)法連接。 C.開啟FTP審查后,被動(dòng)FTP能正常工作: ①ASA防火墻開啟FTP審查: policy-map global_policy
class inspection_default inspect ftp ②被動(dòng)FTP能正常工作: Inside#copy ftp: flash:
Address or name of remote host []? 202.100.1.1
Source filename []? xx.txt
Destination filename [xx.txt]?
%Warning:There is a file already existing with this name
Do you want to over write? [confirm]
Accessing ftp://202.100.1.1/xx.txt...
Erase flash: before copying? [confirm]
Erasing the flash filesystem will remove all files! Continue? [confirm]
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
Erase of flash: complete
Loading xx.txt
[OK - 24/4096 bytes]
Verifying checksum... OK (0x8A8A)
24 bytes copied in 1.788 secs (13 bytes/sec) ③Inside路由器接口抓包:
④Outside的FTP服務(wù)器抓包:
----從抓包接口來(lái)看,確實(shí)因?yàn)殚_啟FTP審查,ASA修改了FTP應(yīng)用層的數(shù)據(jù),將IP地址和端口進(jìn)行了修改。
本文轉(zhuǎn)自 碧云天 51CTO博客,原文鏈接:http://blog.51cto.com/333234/1304633,如需轉(zhuǎn)載請(qǐng)自行聯(lián)系原作者
二.測(cè)試思路及結(jié)論: A.關(guān)閉ASA的FTP審查,確認(rèn)FTP被動(dòng)模式是否能正常工作 ----能正常工作,FTP被動(dòng)模式都由Inside的FTP客戶端主動(dòng)發(fā)起,防火墻不需要放行策略的FTP審查就能正常工作 B.關(guān)閉ASA的FTP審查,Inside路由器作為FTP客戶端設(shè)置為主動(dòng)模式,確認(rèn)FTP主動(dòng)模式是否能正常工作 ----不能正常工作,通過(guò)抓包可以發(fā)現(xiàn),Outside接口FTP服務(wù)器收到的FTP客戶端的發(fā)送的FTP應(yīng)用層的數(shù)據(jù)中IP沒(méi)有被更改,FTP服務(wù)器主動(dòng)去連接PAT之前的地址,導(dǎo)致連接無(wú)法建立 ----進(jìn)一步確認(rèn)了老師講課所說(shuō)的是正確的 三.測(cè)試拓?fù)?#xff1a; 四.基本配置: A.FTP服務(wù)器 ip:202.100.1.1/24 開啟3CDamon,并配置FTP服務(wù)器 B.ASA842防火墻: ①接口配置 interface GigabitEthernet0
nameif Outside
security-level 0
ip address 202.100.1.10 255.255.255.0
no shut
interface GigabitEthernet1
nameif Inside
security-level 100
ip address 10.1.1.10 255.255.255.0
no shut、 ②全局policy map修改: ----關(guān)閉FTP審查,并且啟用icmp審查 policy-map global_policy class inspection_default no inspect ftp inspect icmp ③PAT配置: object network Inside_net subnet 10.1.1.0 255.255.255.0 nat (inside,outside) dynamic interface C.Inside路由器: ①接口配置: interface Ethernet0/0 ip address 10.1.1.1 255.255.255.0
no shut ②默認(rèn)路由配置: ip route 0.0.0.0 0.0.0.0 10.1.1.10 ③FTP用戶名和密碼配置: ip ftp username xll
ip ftp password 1234qwer, 五.測(cè)試步驟: A.關(guān)閉FTP審查后,被動(dòng)FTP能正常工作 ①被動(dòng)FTP能正常傳文件 Inside#copy ftp: flash:
Address or name of remote host [202.100.1.1]?
Source filename [202.100.1.1]? xx.txt
Destination filename [xx.txt]?
%Warning:There is a file already existing with this name
Do you want to over write? [confirm]
Accessing ftp://202.100.1.1/xx.txt...
Erase flash: before copying? [confirm]
Erasing the flash filesystem will remove all files! Continue? [confirm]
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
Erase of flash: complete
Loading xx.txt
[OK - 24/4096 bytes]
Verifying checksum... OK (0x8A8A)
24 bytes copied in 6.820 secs (4 bytes/sec)
Inside# ②Inside路由器接口抓包:
③Outside接口FTP服務(wù)器上面抓包:
B.關(guān)閉FTP審查后,主動(dòng)FTP不能正常工作: ①Inside路由器設(shè)置FTP客戶端為主動(dòng)模式: (config)#no ip ftp passive ②主動(dòng)FTP無(wú)法正常工作: Inside#copy ftp: flash:
Address or name of remote host [202.100.1.1]?
Source filename [202.100.1.1]? xx.txt
Destination filename [xx.txt]?
%Warning:There is a file already existing with this name
Do you want to over write? [confirm]
Accessingftp://202.100.1.1/xx.txt... ③Inside路由器接口抓包:
④Outside的FTP服務(wù)器抓包: ---從抓包中,確實(shí)可以看到,如果不開啟FTP審查的話,ASA不會(huì)修改FTP應(yīng)用層的IP地址,因?yàn)镕TP服務(wù)器收到FTP客戶端告訴給它的地址為內(nèi)網(wǎng)PAT前的地址,導(dǎo)致FTP服務(wù)器無(wú)法連接。 C.開啟FTP審查后,被動(dòng)FTP能正常工作: ①ASA防火墻開啟FTP審查: policy-map global_policy
class inspection_default inspect ftp ②被動(dòng)FTP能正常工作: Inside#copy ftp: flash:
Address or name of remote host []? 202.100.1.1
Source filename []? xx.txt
Destination filename [xx.txt]?
%Warning:There is a file already existing with this name
Do you want to over write? [confirm]
Accessing ftp://202.100.1.1/xx.txt...
Erase flash: before copying? [confirm]
Erasing the flash filesystem will remove all files! Continue? [confirm]
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
Erase of flash: complete
Loading xx.txt
[OK - 24/4096 bytes]
Verifying checksum... OK (0x8A8A)
24 bytes copied in 1.788 secs (13 bytes/sec) ③Inside路由器接口抓包:
④Outside的FTP服務(wù)器抓包:
----從抓包接口來(lái)看,確實(shí)因?yàn)殚_啟FTP審查,ASA修改了FTP應(yīng)用層的數(shù)據(jù),將IP地址和端口進(jìn)行了修改。
本文轉(zhuǎn)自 碧云天 51CTO博客,原文鏈接:http://blog.51cto.com/333234/1304633,如需轉(zhuǎn)載請(qǐng)自行聯(lián)系原作者
總結(jié)
以上是生活随笔為你收集整理的ASA对FTP的审查抓包测试的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 关于Web报表FineReport打印的
- 下一篇: docker-ce私有仓库搭建