发新话题
打印

看我解释的还对?

看我解释的还对?

[left]:confused: [/left]
[left]/sbin/iptables -A INPUT -i eth0 -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP[/left]
[left]#所有进入eth0的tcp包,标志FIN,URG,PSH为1的都DROP;
/sbin/iptables -A INPUT -i eth0 -p tcp --tcp-flags SYN,RST SYN,RST -j DROP[/left]
[left]#所有进入eth0的tcp包带有标志SYN,RST的,且设置为1的都DROP;[/left]
[left]/sbin/iptables -A INPUT -i eth0 -p tcp --tcp-flags SYN,FIN SYN,FIN - j DROP [/left]
[left]#所有进入eth0的tcp包带有标志SYN,FIN 的,且设置为1的都DROP;
/sbin/iptables -A INPUT -i eth0 -p tcp --tcp-flags ALL FIN  -j DROP[/left]
[left]#所有进入eth0的tcp包,FIN标志设置为1的都DROP;
/sbin/iptables -A INPUT -i eth0 -p tcp --tcp-flags ALL ALL -j DROP[/left]
[left]#所有进入eth0的tcp包,且标志设置为1的都DROP;
/sbin/iptables -A INPUT -i eth0 -p tcp --tcp-flags ALL NONE -j DROP[/left]
[left]#防止NONE扫描;
/sbin/iptables -P INPUT DROP[/left]
[left] [/left]
[left]分析完了,就是不知道,每个对应了什么扫描~~~[/left]
[left] [/left]
[left]请大虾指导~~~[/left]      

TOP

复制内容到剪贴板
代码:
       --tcp-flags [!] mask comp
              Match when the TCP flags are as specified.  The  first  argument
              is  the  flags which we should examine, written as a comma-sepa-
              rated list, and the second argument is a comma-separated list of
              flags which must be set.  Flags are: SYN ACK FIN RST URG PSH ALL
              NONE.  Hence the command
               iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST SYN
              will only match packets with the SYN flag set, and the ACK,  FIN
              and RST flags unset.
所以 ALL 理解为TCP的所有标志位更位准确,表示我们需要检查所有的标志位,相当于一个掩码;第二个参数指出的标志位是用来匹配的



/sbin/iptables -A INPUT -i eth0 -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
检查标志 S,R ;如果设置了就drop

/sbin/iptables -A INPUT -i eth0 -p tcp --tcp-flags ALL NONE -j DROP
检查所有的标志位,如果都没设置就drop      
Advance Monitor - Linux Monitoring Solution

TOP

谢谢楼上      

TOP

发新话题