Network Protocols CheatSheet

Listen to this Post

Understanding network protocols is essential for cybersecurity professionals, IT specialists, and developers. Below is an in-depth breakdown of key protocols, along with practical commands and steps to apply them in real-world scenarios.

You Should Know:

1. HTTP & HTTPS

  • HTTP: Unencrypted web traffic (Port 80).
  • HTTPS: Encrypted with TLS/SSL (Port 443).

Verify HTTPS Certificate:

openssl s_client -connect example.com:443 | openssl x509 -noout -text 

Force HTTPS in Apache:

<VirtualHost *:80> 
ServerName example.com 
Redirect permanent / https://example.com/ 
</VirtualHost> 

2. FTP (File Transfer Protocol)

  • Ports: 20 (data), 21 (control).

Connect via FTP:

ftp ftp.example.com 

Secure Alternative (SFTP):

sftp [email protected] 

3. TCP vs. UDP

  • TCP: Reliable (used in HTTP, SSH).
  • UDP: Fast but unreliable (used in DNS, VoIP).

Check Open TCP Ports:

netstat -tulnp 

Test UDP Connectivity:

nc -u example.com 53 

4. SMTP (Email Protocol)

  • Port: 25 (unencrypted), 587 (TLS).

Test SMTP Server:

telnet smtp.example.com 25 
EHLO example.com 

5. WebSocket (Full-Duplex Communication)

  • Used in real-time apps (e.g., chat, trading).

Check WebSocket Handshake:

curl -i -H "Connection: Upgrade" -H "Upgrade: websocket" http://example.com 

6. HTTP/3 (QUIC)

  • Faster, encrypted by default (UDP-based).

Enable HTTP/3 in Nginx:

listen 443 quic reuseport; 
listen [::]:443 quic reuseport; 
add_header Alt-Svc 'h3=":443"; ma=86400'; 

7. SSH (Secure Shell)

  • Port 22 (encrypted remote access).

Generate SSH Keys:

ssh-keygen -t ed25519 

Copy Key to Remote Server:

ssh-copy-id user@remote-server 

8. DNS (Domain Name System)

  • UDP Port 53.

Query DNS Records:

dig example.com A 
nslookup example.com 

9. ICMP (Ping & Traceroute)

  • Used for network diagnostics.

Ping Test:

ping example.com 

Traceroute:

traceroute example.com # Linux 
tracert example.com # Windows 

What Undercode Say:

Mastering network protocols is crucial for securing systems, troubleshooting, and optimizing performance. Practice these commands in a lab environment (e.g., Kali Linux, Wireshark for packet analysis). Always encrypt sensitive traffic (HTTPS, SSH, SFTP) and disable outdated protocols (FTP, Telnet).

Expected Output:

  • A fully secured, optimized network with encrypted communications.
  • Ability to diagnose and resolve connectivity issues efficiently.
  • Compliance with modern security standards (TLS 1.3, HTTP/3).

Further Reading:

References:

Reported By: Alexrweyemamu Network – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image