#----------------------------#
# INVALID PACKETS #
#----------------------------#
function INVALID {
# Drop illegal flag combinations which also prevents most port scanning
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,PSH,URG -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags SYN,RST SYN,RST -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags FIN,SYN FIN,SYN -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,PSH,URG -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags SYN,RST SYN,RST -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags FIN,SYN FIN,SYN -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,PSH,URG -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags SYN,RST SYN,RST -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags FIN,SYN FIN,SYN -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG FIN,PSH,URG -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags SYN,RST SYN,RST -j DROP
$IPT -t mangle -A PREROUTING -i $WANIFACE \
-p tcp --tcp-flags FIN,SYN FIN,SYN -j DROP
}
вот так не сканится :)