Para conocer los puertos abiertos de salida a Internet ejecutaremos el script
opa
en local y escucharemos con tcpdump
en la máquina remota.
remoto#stdbuf -o0 \ tcpdump -tni eth0 src net 82.81.233.0/24 2> /dev/null \ | awk -W interactive '{print $2,$3,$4}'
local#cat opa
#!/bin/bash # # NAME # opa - Outbound Port Agent # # SYNOPSIS # ./opa remote_ip from_port to_port [udp_mode] # # EXEMPLE # ./opa 79.159.199.15 1 65535 # ./opa 79.159.199.15 1 1024 -u ip=$1 from=$2 to=$3 udp=$4 counter=0 #echo "Checked ports:" for port in `seq $from $to` do if [ $counter -eq 9 ]; then killall nc 2> /dev/null # echo $port counter=0 else # echo -n "$port, " nc $udp -p $port $ip $port 2> /dev/null & let "counter += 1" fi done killall nc 2> /dev/null local#./opa 79.159.199.15 1 65535
No comments:
Post a Comment