mtk
Service

Blocco attacco ssh/ftp

DA anni gestisco piccole medie reti aziendali , spesso il firewall è esposto alla grande rete con ip statico , bastano poche ore per trovare qualcuno che già bussa alla nostra porta , si !!! la porta , solitamente la 22 ssh oppure la 21 FTP .

Con Mikrotik esiste un piccolo script ben commentato sul wiki che consente solo 10 risposte FTP al login non corrette , poi mette l’ip del malintenzionato nella BlackList per 10 giorni .
ecco il codice :


/ip firewall filter
add chain=input protocol=tcp dst-port=21 src-address-list=ftp_blacklist action=drop \
comment="drop ftp brute forcers"

add chain=output action=accept protocol=tcp content=”530 Login incorrect” dst-limit=1/1m,9,dst-address/1m

add chain=output action=add-dst-to-address-list protocol=tcp content=”530 Login incorrect” \
address-list=ftp_blacklist address-list-timeout=3h


/ip firewall filter

add chain=input protocol=tcp dst-port=22 src-address-list=ssh_blacklist action=drop \
comment="drop ssh brute forcers" disabled=no

add chain=input protocol=tcp dst-port=22 connection-state=new \
src-address-list=ssh_stage3 action=add-src-to-address-list address-list=ssh_blacklist \
address-list-timeout=10d comment="" disabled=no

add chain=input protocol=tcp dst-port=22 connection-state=new \
src-address-list=ssh_stage2 action=add-src-to-address-list address-list=ssh_stage3 \
address-list-timeout=1m comment="" disabled=no

add chain=input protocol=tcp dst-port=22 connection-state=new src-address-list=ssh_stage1 \
action=add-src-to-address-list address-list=ssh_stage2 address-list-timeout=1m comment="" disabled=no

add chain=input protocol=tcp dst-port=22 connection-state=new action=add-src-to-address-list \
address-list=ssh_stage1 address-list-timeout=1m comment="" disabled=no


add chain=forward protocol=tcp dst-port=22 src-address-list=ssh_blacklist action=drop \
comment="drop ssh brute downstream" disabled=no

Mikrotik e una delle tante soluzioni disponibili in commercio , ci sono firewall piu conosciuti e semplici da utilizzare e configurare , con interfaccia web come cisco , fortinet ,WatchGuard, e Zyxel

Spread the love
  •  
  •  
  •  
  •