Skip to content

Common CLI Network Tools

A brief description of common CLI network tools.

1. Inspect open ports

1.1 Check local listening ports

Bash:

Bash
# TCP + UDP listeners, numeric output, process mapping
sudo ss -tulnp

➡️ Explanation:

  • -t = TCP
  • -u = UDP
  • -l = listening only
  • -n = numeric (no DNS/service name lookup)
  • -p = process information

post25_1

➡️ Quick interpretation rules

  • 0.0.0.0:<port> → open on all IPv4 interfaces
  • [::]:<port> → open on all IPv6 interfaces
  • 127.0.0.1:<port> / [::1]:<port> → local-only, not reachable from network
  • LISTEN (TCP) → waiting for incoming connections
  • UNCONN (UDP) → connectionless socket (normal for UDP)

PowerShell

PowerShell
# TCP listeners with process name
Get-NetTCPConnection -State Listen |
  Select-Object LocalAddress,LocalPort,@{Name='PID';Expression={$_.OwningProcess}},@{Name='Process';Expression={(Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).ProcessName}} |
  Sort-Object LocalPort

# UDP listeners with process name
Get-NetUDPEndpoint |
  Select-Object LocalAddress,LocalPort,@{Name='PID';Expression={$_.OwningProcess}},@{Name='Process';Expression={(Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).ProcessName}} |
  Sort-Object LocalPort

alt text

➡️ Quick interpretation rules

  • 0.0.0.0:<port> → open on all IPv4 interfaces
  • [::]:<port> → open on all IPv6 interfaces
  • 127.0.0.1:<port> / [::1]:<port> → local-only, not reachable from network

1.2 Check remote listening ports

Bash

Bash
# single port
nc -zv blog.guelers.de 443

# port range
nc -zv blog.guelers.de 20-25

➡️ Key parameters

  • -z = scan mode (no payload)
  • -v = verbose output

➡️ Alternative:

Bash
nmap -p 443 blog.guelers.de
nmap -p- blog.guelers.de

➡️ Key parameters

  • -p 443 = scan specific port
  • -p- = scan full TCP range (1-65535)

post25_3


PowerShell

PowerShell
Test-NetConnection blog.guelers.de -Port 443

➡️ Focus on: \ - TcpTestSucceeded : True/False

post25_4

2. Check Website reachability

Bash:

Bash
# headers + redirects
curl -I -L https://blog.guelers.de

➡️ Key parameters

  • -I = HEAD/headers only
  • -L = follow redirects

post25_5

➡️ Quick interpretation rules

  • HTTP/2 200 → Protocol is HTTP/2, status code 200 OK = request successful
  • date: Sat, 21 Feb 2026 15:12:47 GMT → Server response timestamp (GMT/UTC)
  • content-type: text/html → Response body is HTML
  • content-length: 37249 → Response size is 37,249 bytes (~37 KB)
  • server: Proxy → Request is handled by a proxy/reverse proxy layer in front of the app
  • strict-transport-security: max-age=63072000; includeSubDomains; preload → HSTS enabled (2 years), includes subdomains, preload-ready
  • referrer-policy: strict-origin-when-cross-origin → Sends limited referrer data on cross-origin requests (privacy-friendly default)
  • x-permitted-cross-domain-policies: none → Disables legacy Flash/Adobe cross-domain policy files
  • x-content-type-options: nosniff → Prevents MIME sniffing by browsers
  • x-xss-protection: 1; mode=block → Legacy XSS filter header for older browsers (deprecated in modern browsers, but harmless)
  • x-frame-options: SAMEORIGIN → Blocks framing from other origins (clickjacking protection)
  • content-security-policy: upgrade-insecure-requests → Insecure http:// subrequests are upgraded to https://
  • permissions-policy: geolocation=(), camera=(), microphone=(), interest-cohort=(), payment=(), clipboard-read=(), clipboard-write=() → Browser APIs are restricted/disabled; reduces attack surface/privacy leakage
  • expect-ct: enforce; max-age=604800 → Certificate Transparency policy enabled (7 days)
  • x-served-by: blog.guelers.de → Internal/backend identifier of the serving host.

PowerShell:

PowerShell
invoke-WebRequest -Uri "https://blog.guelers.de" -Method Head

post25_6

➡️ Quick interpretation rules

  • StatusCode = 200 → Request successful
  • 301/302 → Redirect response
  • 401/403 → Auth/permission issue
  • 404 → Resource not found
  • 500+ → Server-side error
  • Use try/catch because Invoke-WebRequest throws for many 4xx/5xx responses

3. Check DNS

Bash

Bash
dig blog.guelers.de A +short
dig blog.guelers.de AAAA +short
dig blog.guelers.de MX +short
dig +trace blog.guelers.de

➡️ Key parameters

  • A, AAAA, MX = requested record type
  • +short = compact output
  • +trace = full recursive path (root → TLD → authoritative)

PowerShell

PowerShell
Resolve-DnsName blog.guelers.de

CMD:

Text Only
nslookup blog.guelers.de

4. Trace Route

Bash

Bash
traceroute blog.guelers.de
traceroute -I blog.guelers.de

➡️ Key parameter

  • -I = ICMP mode (helpful if UDP probes are filtered)

PowerShell

PowerShell
tracert blog.guelers.de

➡️ Reading hints

  • * * * on a hop is not always a hard failure (ICMP may be filtered)
  • Sudden latency jump can indicate a bottleneck segment

5. Cli Downloads

Bash:

Bash
curl -L -C - "https://blog.guelers.de/large.iso" -o large.iso
➡️ Key parameters

  • -L = follow HTTP redirects automatically
  • -C - = resume interrupted download
  • -o large.iso = save file under specified name
Bash
wget -c "https://blog.guelers.de/large.iso"

➡️ Key parameters

  • -c = continue / resume interrupted download

PowerShell:

PowerShell
Invoke-WebRequest -Uri "https://blog.guelers.de/large.iso" -OutFile "C:\Temp\large.iso"

➡️ Key parameters

  • Invoke-WebRequest = standard HTTP download in PowerShell
  • -Uri = source
  • -OutFile = destination file

➡️ For larger files:

PowerShell
Start-BitsTransfer -Source "https://blog.guelers.de/large.iso" -Destination "C:\Temp\large.iso"

➡️ Key parameters

  • Start-BitsTransfer = uses Windows Background Intelligent Transfer Service (BITS)
  • -Source = source URL
  • -Destination = target path

➡️ Characteristics:

  • Uses available bandwidth intelligently
  • Stable on unreliable connections
  • Automatic resume
  • Suitable for server and enterprise environments

➡️ Quick Comparison

Tool Resume Stability Enterprise Suitable
curl Yes Good Medium
wget Yes Good Medium
BITS Yes Very High Yes
Invoke-WebRequest No Medium Limited

6. Validate Webserver Certificate

Bash:

🔨 Expire Date:

Bash
echo | openssl s_client -connect blog.guelers.de:443 -servername blog.guelers.de 2>/dev/null | openssl x509 -noout -dates

🔨 Issuer and Coverage:

Bash
# Check expiry
echo | openssl s_client -connect blog.guelers.de:443 -servername blog.guelers.de 2>/dev/null | openssl x509 -noout -issuer -subject -ext subjectAltName

🔨 Chain Verification Status:

Bash
openssl s_client -connect blog.guelers.de:443 -servername blog.guelers.de </dev/null

➡️ Quick interpretation rules

  • notBefore / notAfter → certificate validity window
  • subjectAltName must include the requested hostname
  • Verify return code: 0 (ok) → chain validation successful
  • Non-zero verify code → trust chain / hostname / CA issue

7. References

https://curl.se/docs/ https://www.openssl.org/docs/manmaster/man1/openssl-s_client.html https://nmap.org/book/man.html https://learn.microsoft.com/powershell/

Cheers!