Probar un puerto TCP

Comprueba si cualquier puerto TCP de un host es accesible.

HTTPS (443)

PowerShell (Windows)

Test-NetConnection Integrado

Test-NetConnection -ComputerName mail.example.com -Port 443 -InformationLevel Detailed

nc / ncat Herramienta adicional

ncat -vz mail.example.com 443

Shell de Unix (bash)

bash /dev/tcp Integrado

timeout 5 bash -c "</dev/tcp/mail.example.com/443" && echo open || echo closed

nc Herramienta adicional

nc -vz mail.example.com 443

SMTP (25)

PowerShell (Windows)

Test-NetConnection Integrado

Test-NetConnection -ComputerName mail.example.com -Port 25 -InformationLevel Detailed

nc / ncat Herramienta adicional

ncat -vz mail.example.com 25

Shell de Unix (bash)

bash /dev/tcp Integrado

timeout 5 bash -c "</dev/tcp/mail.example.com/25" && echo open || echo closed

nc Herramienta adicional

nc -vz mail.example.com 25

LDAPS (636)

PowerShell (Windows)

Test-NetConnection Integrado

Test-NetConnection -ComputerName dc01.example.com -Port 636 -InformationLevel Detailed

nc / ncat Herramienta adicional

ncat -vz dc01.example.com 636

Shell de Unix (bash)

bash /dev/tcp Integrado

timeout 5 bash -c "</dev/tcp/dc01.example.com/636" && echo open || echo closed

nc Herramienta adicional

nc -vz dc01.example.com 636

Ping

Comprueba la accesibilidad básica de un host mediante ICMP.

PowerShell (Windows)

Test-Connection Integrado

Test-Connection -TargetName mail.example.com -Count 4

ping Integrado

ping -n 4 mail.example.com

Shell de Unix (bash)

ping Integrado

ping -c 4 mail.example.com

fping Herramienta adicional

fping -c 4 mail.example.com

Traceroute

Muestra salto a salto la ruta de red hacia un host.

PowerShell (Windows)

Test-NetConnection Integrado

Test-NetConnection -ComputerName mail.example.com -TraceRoute

tracert Integrado

tracert -d mail.example.com

Shell de Unix (bash)

tracepath Integrado

tracepath mail.example.com

traceroute / mtr Herramienta adicional

traceroute mail.example.com
mtr -rw -c 10 mail.example.com

traceroute no siempre está instalado en servidores Linux mínimos. mtr ofrece una vista que se actualiza de forma continua.

¿Quién escucha en un puerto?

Muestra qué proceso escucha localmente en un puerto.

SMTP (25)

PowerShell (Windows)

Get-NetTCPConnection Integrado

Get-NetTCPConnection -State Listen -LocalPort 25 | Select-Object LocalAddress, LocalPort, OwningProcess
Get-Process -Id (Get-NetTCPConnection -State Listen -LocalPort 25).OwningProcess

netstat Integrado

netstat -ano | findstr ":25 "

Shell de Unix (bash)

ss Integrado

ss -tlnp "sport = :25"

lsof / netstat Herramienta adicional

lsof -iTCP:25 -sTCP:LISTEN
netstat -tlnp | grep ":25 "

Submission (587)

PowerShell (Windows)

Get-NetTCPConnection Integrado

Get-NetTCPConnection -State Listen -LocalPort 587 | Select-Object LocalAddress, LocalPort, OwningProcess
Get-Process -Id (Get-NetTCPConnection -State Listen -LocalPort 587).OwningProcess

netstat Integrado

netstat -ano | findstr ":587 "

Shell de Unix (bash)

ss Integrado

ss -tlnp "sport = :587"

lsof / netstat Herramienta adicional

lsof -iTCP:587 -sTCP:LISTEN
netstat -tlnp | grep ":587 "

¿Qué servidor DNS?

Muestra qué servidores DNS usa actualmente el sistema: importante con split DNS.

PowerShell (Windows)

Get-DnsClientServerAddress Integrado

Get-DnsClientServerAddress -AddressFamily IPv4 | Select-Object InterfaceAlias, ServerAddresses

ipconfig Integrado

ipconfig /all

Shell de Unix (bash)

resolvectl Integrado

resolvectl status

cat Integrado

cat /etc/resolv.conf

Otras áreas