Test en TCP-port

Kontrollerer om en vilkårlig TCP-port på en vert er tilgjengelig.

HTTPS (443)

PowerShell (Windows)

Test-NetConnection Innebygd

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

nc / ncat Tilleggsverktøy

ncat -vz mail.example.com 443

Unix-skall (bash)

bash /dev/tcp Innebygd

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

nc Tilleggsverktøy

nc -vz mail.example.com 443

SMTP (25)

PowerShell (Windows)

Test-NetConnection Innebygd

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

nc / ncat Tilleggsverktøy

ncat -vz mail.example.com 25

Unix-skall (bash)

bash /dev/tcp Innebygd

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

nc Tilleggsverktøy

nc -vz mail.example.com 25

LDAPS (636)

PowerShell (Windows)

Test-NetConnection Innebygd

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

nc / ncat Tilleggsverktøy

ncat -vz dc01.example.com 636

Unix-skall (bash)

bash /dev/tcp Innebygd

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

nc Tilleggsverktøy

nc -vz dc01.example.com 636

Ping

Kontrollerer grunnleggende tilgjengelighet for en vert via ICMP.

PowerShell (Windows)

Test-Connection Innebygd

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

ping Innebygd

ping -n 4 mail.example.com

Unix-skall (bash)

ping Innebygd

ping -c 4 mail.example.com

fping Tilleggsverktøy

fping -c 4 mail.example.com

Traceroute

Viser nettverksveien til en vert hopp for hopp.

PowerShell (Windows)

Test-NetConnection Innebygd

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

tracert Innebygd

tracert -d mail.example.com

Unix-skall (bash)

tracepath Innebygd

tracepath mail.example.com

traceroute / mtr Tilleggsverktøy

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

traceroute er ikke alltid installert på minimale Linux-servere. mtr gir en kontinuerlig oppdatert visning.

Hvem lytter på en port?

Viser hvilken prosess som lytter lokalt på en port.

SMTP (25)

PowerShell (Windows)

Get-NetTCPConnection Innebygd

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

netstat Innebygd

netstat -ano | findstr ":25 "

Unix-skall (bash)

ss Innebygd

ss -tlnp "sport = :25"

lsof / netstat Tilleggsverktøy

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

Submission (587)

PowerShell (Windows)

Get-NetTCPConnection Innebygd

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

netstat Innebygd

netstat -ano | findstr ":587 "

Unix-skall (bash)

ss Innebygd

ss -tlnp "sport = :587"

lsof / netstat Tilleggsverktøy

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

Hvilken DNS-server?

Viser hvilke DNS-servere systemet bruker nå: viktig ved split DNS.

PowerShell (Windows)

Get-DnsClientServerAddress Innebygd

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

ipconfig Innebygd

ipconfig /all

Unix-skall (bash)

resolvectl Innebygd

resolvectl status

cat Innebygd

cat /etc/resolv.conf

Andre områder