您好,登錄后才能下訂單哦!
i=IP()
t=TCP()
i.dst='10.202.32.0/24'/連續(xù)地址段
t.sport=8888
t.dport=[3389,80,21,22,23,443,445,137,138,139]/(1,1024)
[]表示多個(gè)端口,()表示連續(xù)端口
repose=(i/t)
repose=(i/t)
t.flags='S'/產(chǎn)生標(biāo)志位也可以寫數(shù)據(jù)例如ACK寫16
從下到上FIN—SYN—RST—PSH—ACK—URG
1 2 4 8 16 32
ans,unans=sr(respose)
ans.show()
0000 IP / TCP 192.168.80.250:8888 > 10.202.32.1:ssh S ==> IP / TCP 10.202.32.1:ssh > 192.168.80.250:8888 SA / Padding
0001 IP / TCP 192.168.80.250:8888 > 10.202.32.74:microsoft_ds S ==> IP / TCP 10.202.32.74:microsoft_ds > 192.168.80.250:8888 SA / Padding
0002 IP / TCP 192.168.80.250:8888 > 10.202.32.74:netbios_ns S ==> IP / TCP 10.202.32.74:netbios_ns > 192.168.80.250:8888 RA / Padding
0003 IP / TCP 192.168.80.250:8888 > 10.202.32.74:netbios_ssn S ==> IP / TCP 10.202.32.74:netbios_ssn > 192.168.80.250:8888 SA / Padding
對(duì)數(shù)據(jù)進(jìn)行監(jiān)控:
sniff(iface="eth0",prn=lambda x:x.show() )
對(duì)數(shù)據(jù)進(jìn)行查看處理:
ans.summary( lambda(s,r): r.sprintf("%IP.src% \t %TCP.sport% \t %TCP.flags%") )
10.200.230.1 ssh SA
10.200.230.11 3389 SA
10.200.230.11 loc_srv SA
10.200.230.11 microsoft_ds SA
10.200.230.12 3389 SA
10.200.230.12 https SA
10.200.230.40 3389 SA
10.200.230.41 3389 SA
10.200.230.42 loc_srv SA
10.200.230.42 microsoft_ds SA
10.200.230.50 3389 SA
二、TCP ACK 掃描;
i=IP()
i.dst='10.200.193.0/24'
t=TCP()
t.flags='A'
t.sport=9999
t.dport=[3389,21,22,23,80,443]
respose=(i/t)
ans,unans=sr(respose)
ans.show()
0000 IP / TCP 192.168.80.250:9999 > 10.200.193.0:3389 A ==> IP / TCP 10.200.193.0:3389 > 192.168.80.250:9999 R / Padding
0001 IP / TCP 192.168.80.250:9999 > 10.200.193.0:ftp A ==> IP / TCP 10.200.193.0:ftp > 192.168.80.250:9999 R / Padding
0002 IP / TCP 192.168.80.250:9999 > 10.200.193.0:ssh A ==> IP / TCP 10.200.193.0:ssh > 192.168.80.250:9999 R / Padding
0003 IP / TCP 192.168.80.250:9999 > 10.200.193.0:telnet A ==> IP / TCP 10.200.193.0:telnet > 192.168.80.250:9999 R / Padding
如果服務(wù)器返回一個(gè)帶有 RST 標(biāo)識(shí)的 TCP 數(shù)據(jù)包,則說明端口沒有被過濾,不存在狀態(tài)防火墻。
對(duì)數(shù)據(jù)進(jìn)行監(jiān)控:
sniff(iface="eth0",prn=lambda x:x.show() )
對(duì)數(shù)據(jù)進(jìn)行查看處理:
ans.summary( lambda(s,r): r.sprintf("%IP.src% \t %TCP.sport% \t %TCP.flags% \t %ICMP.type%") )
10.200.193.1 3389 R ??
10.200.193.1 ftp R ??
10.200.193.1 ssh R ??
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。