quinta-feira, 22 de maio de 2014

IPTABLES - Bloqueando tentativa de invasão.

Cenário:

[root@192.168.0.1 ~]# lastb -n40
root       ssh:notty    116.10.191.201   Thu May 22 09:36 - 09:36  (00:00)   
root       ssh:notty    116.10.191.201   Thu May 22 09:36 - 09:36  (00:00)   
root       ssh:notty    116.10.191.201   Thu May 22 09:36 - 09:36  (00:00)   
root       ssh:notty    116.10.191.201   Thu May 22 09:36 - 09:36  (00:00)   
root       ssh:notty    116.10.191.201   Thu May 22 09:36 - 09:36  (00:00)   
root       ssh:notty    116.10.191.201   Thu May 22 09:36 - 09:36  (00:00)   
root       ssh:notty    116.10.191.201   Thu May 22 09:36 - 09:36  (00:00)   
root       ssh:notty    116.10.191.201   Thu May 22 09:35 - 09:35  (00:00)   
root       ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
admin    ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
root       ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
root       ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
admin    ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
root       ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
admin    ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
root       ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
admin    ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
root       ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
root       ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
admin    ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
root       ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
admin    ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)   
root       ssh:notty    116.10.191.167   Thu May 22 06:22 - 06:22  (00:00)


O comando lastb com o parâmetro -n40 trás as últimas 40 tentativas mal-sucedidas de acesso, percebemos que o IP 116.10.191.201 fez várias tentativas de acesso como root e admin no mesmo minuto, ou seja, características de invasão por brute force. 

Para resolver isso:
iptables -t filter -A INPUT -s 116.10.191.201  -j DROP
iptables -t filter -A OUTPUT -s 116.10.191.201 -j DROP
iptables -t filter -A FORWARD -s 116.10.191.201  -j DROP


obs.: é importe verificar os usuários default , caso você use alguma aplicação instalada no servidor como mysql, apache, zimbra, etc... , encontre esses usuário e dê o devido tratamento (mudar senha padrão ou bloquear o acesso).


Nenhum comentário:

Postar um comentário

Comente ai!!!!