iptables -A INPUT -p tcp --syn -j DROP
Só uma regra básica de firewall! Imagine com um IDS!
Apesar que em servidores tem que melhorar essa regra senão irá bloquear as porta que usam os pacotes SYN para uma nova conexão por exemplo o Apache por isso seria preciso usar mais flags em conjunto com o SYN, mais de qualquer modo fica a dica para bloquear esse tipo de escaneamento!
# nmap -sS -O -P0 -v localhost
Starting Nmap 4.11 (
http://www.insecure.org/nmap/ ) at 2007-01-04 16:08 CET
Initiating SYN Stealth Scan against localhost (127.0.0.1) [1680 ports] at 16:08
SYN Stealth Scan Timing: About 8.72% done; ETC: 16:13 (0:05:16 remaining)
The SYN Stealth Scan took 339.78s to scan 1680 total ports.
Warning: OS detection will be MUCH less reliable because we did not find at least 1 open and 1 closed TCP port
Host localhost (127.0.0.1) appears to be up ... good.
All 1680 scanned ports on localhost (127.0.0.1) are filtered
Too many fingerprints match this host to give specific OS details
TCP/IP fingerprint:
SInfo(V=4.11%P=i486-slackware-linux-gnu%D=1/4%Tm=459D19CF%O=-1%C=-1)
T5(Resp=N)
T6(Resp=Y%DF=Y%W=0%ACK=O%Flags=R%Ops=)
T7(Resp=Y%DF=Y%W=0%ACK=S++%Flags=AR%Ops=)
PU(Resp=Y%DF=N%TOS=C0%IPLEN=164%RIPTL=148%RID=E%RIPCK=E%UCK=E%ULEN=134%DAT=E)
Nmap finished: 1 IP address (1 host up) scanned in 379.013 seconds
Raw packets sent: 3375 (149.544KB) | Rcvd: 3381 (149.868KB)
Sem a regra:
nmap -sS -O -P0 -v localhost
Starting Nmap 4.11 (
http://www.insecure.org/nmap/ ) at 2007-01-04 16:15 CET
Initiating SYN Stealth Scan against localhost (127.0.0.1) [1680 ports] at 16:15
Discovered open port 631/tcp on 127.0.0.1
Discovered open port 3128/tcp on 127.0.0.1
Discovered open port 6000/tcp on 127.0.0.1
Discovered open port 901/tcp on 127.0.0.1
The SYN Stealth Scan took 0.26s to scan 1680 total ports.
For OSScan assuming port 631 is open, 1 is closed, and neither are firewalled
Host localhost (127.0.0.1) appears to be up ... good.
Interesting ports on localhost (127.0.0.1):
Not shown: 1676 closed ports
PORT STATE SERVICE
631/tcp open ipp
901/tcp open samba-swat
3128/tcp open squid-http
6000/tcp open X11
Device type: general purpose
Running: Linux 2.4.X|2.5.X
OS details: Linux 2.4.0 - 2.5.20
Uptime 0.026 days (since Thu Jan 4 15:38:43 2007)
TCP Sequence Prediction: Class=random positive increments
Difficulty=1536480 (Good luck!)
IPID Sequence Generation: All zeros
Nmap finished: 1 IP address (1 host up) scanned in 2.405 seconds
Raw packets sent: 1695 (75.088KB) | Rcvd: 3398 (143.412KB)