# Common Ports and Protocols: A Hacking Journey for Beginners

Listen to this Post

Understanding common ports and protocols is essential for cybersecurity professionals, penetration testers, and IT administrators. Both TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) serve different purposes but rely on ports to facilitate communication between devices.

Common Ports and Their Associated Protocols

TCP Ports

  1. Port 20/21 (FTP) – File Transfer Protocol for uploading/downloading files.

– Command: `ftp `
– Example: `ftp 192.168.1.1`

  1. Port 22 (SSH) – Secure Shell for encrypted remote access.

– Command: `ssh username@`
– Example: `ssh [email protected]`

  1. Port 25 (SMTP) – Simple Mail Transfer Protocol for email routing.

– Command: `telnet 25`
– Example: `telnet mail.example.com 25`

  1. Port 80 (HTTP) – Hypertext Transfer Protocol for web traffic.

– Command: `curl http://`
– Example: `curl http://example.com`

5. Port 443 (HTTPS) – HTTP Secure for encrypted web communication.
– Command: `openssl s_client -connect :443`
– Example: `openssl s_client -connect example.com:443`

UDP Ports

  1. Port 53 (DNS) – Domain Name System for resolving domain names.

– Command: `nslookup example.com`
– Example: `nslookup google.com`

  1. Port 67/68 (DHCP) – Dynamic Host Configuration Protocol for IP assignment.

– Command: `dhclient` (Linux) / `ipconfig /renew` (Windows)

  1. Port 161 (SNMP) – Simple Network Management Protocol for device monitoring.

– Command: `snmpwalk -v2c -c public `

You Should Know:

  • Scanning Ports with Nmap:
    nmap -sS -p 1-1000 <IP> # TCP SYN Scan 
    nmap -sU -p 53,67,161 <IP> # UDP Scan 
    

  • Checking Open Ports on Local Machine:

    netstat -tuln # Linux 
    netstat -ano # Windows 
    

  • Firewall Rules (Linux):

    iptables -L # List firewall rules 
    ufw allow 22/tcp # Allow SSH 
    

  • Windows Firewall (Command Line):

    netsh advfirewall show allprofiles 
    netsh advfirewall firewall add rule name="Allow Port 80" dir=in action=allow protocol=TCP localport=80 
    

What Undercode Say:

Mastering port and protocol knowledge is crucial for network security, penetration testing, and troubleshooting. Practice scanning, filtering, and securing ports to harden systems against attacks. Use tools like Wireshark (tshark -i eth0) for deeper packet analysis.

Expected Output:

A well-structured understanding of essential ports, their functions, and practical commands for cybersecurity operations.

*For further reading, refer to:*

References:

Reported By: Mmahmudul Hassan – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image