servidorlinux
(usa Debian)
Enviado em 11/03/2020 - 15:05h
StanislausK escreveu:
Ola,
no terminal digite o comando ip addr show e use o IP que consta (não é o localhost, 127.0.0.1!), para ser usado no nmap...
Olá StanislausK tudo bem?
Exucutei o comando que você me indicou ficou assim:
SEM SCRIPT
# iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
# nmap 10.0.2.15
Starting Nmap 7.70 (
https://nmap.org ) at 2020-03-11 14:36 -03
Nmap scan report for 10.0.2.15
Host is up (0.000030s latency).
All 1000 scanned ports on 10.0.2.15 are closed
Nmap done: 1 IP address (1 host up) scanned in 1.69 seconds
COM O SEU SCRIPT
# iptables -S
-P INPUT DROP
-P FORWARD DROP
-P OUTPUT DROP
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -p icmp -j ACCEPT
-A OUTPUT -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 443 -j ACCEPT
# nmap 10.0.2.15
Starting Nmap 7.70 (
https://nmap.org ) at 2020-03-11 14:13 -03
Nmap scan report for 10.0.2.15
Host is up (0.000034s latency).
All 1000 scanned ports on 10.0.2.15 are closed
Nmap done: 1 IP address (1 host up) scanned in 1.69 seconds
COM O MEU SCRIPT
# iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -i enp0s3 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j DROP
-A INPUT -m state --state INVALID -j DROP
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j DROP
# nmap 10.0.2.15
Starting Nmap 7.70 (
https://nmap.org ) at 2020-03-11 14:21 -03
Nmap scan report for 10.0.2.15
Host is up (0.000029s latency).
All 1000 scanned ports on 10.0.2.15 are closed
Nmap done: 1 IP address (1 host up) scanned in 1.69 seconds
Verifiquei que a saída dos três foi a mesma:
All 1000 scanned ports on 10.0.2.15 are closed
Minha dúvida é porque mesmo sem script as 1000 portas estão fechadas?