For Windows and Linux the following command shows TCP services running:
1
netstat -ano -p tcp
Also for linux you can use the following command:
1
ss -tulnp
Examples: [[StreamIO#^1d2840]] [[Antique#^dac47f]]
While within a machine you can enumerate the ports open locally with this script:
1
2
3
4
5
6
#!/bin/bash
for port in $(seq 1 65535); do
timeout 1 bash -c "echo '' > /dev/tcp/127.0.0.1/$port" &>/dev/null && echo "[+] Puerto activo $port" &
done
Examples: [[Flustered]]