18 Essential Network Ports: A Must-Know Guide for Secure and Efficient IT Operations

Listen to this Post

FTP (File Transfer Protocol) – TCP/21

Purpose: Used for transferring files between clients and servers.

Command to test FTP connection:

ftp <server-ip>

SSH (Secure Shell) – TCP/22

Purpose: Provides a secure channel for remote login and command execution.

Command to connect via SSH:

ssh username@<server-ip>

Telnet – TCP/23

Purpose: Offers unencrypted, text-based remote login.

Command to test Telnet connection:

telnet <server-ip> 23

SMTP (Simple Mail Transfer Protocol) – TCP/25

Purpose: Responsible for sending email from clients to mail servers and between mail servers.

Command to test SMTP server:

telnet <smtp-server-ip> 25

DNS (Domain Name System) – UDP/TCP/53

Purpose: Translates human-friendly domain names into IP addresses (and vice versa).

Command to query DNS:

nslookup example.com

DHCP Server – UDP/67

Purpose: Assigns IP addresses and network configuration parameters to DHCP clients.

Command to check DHCP lease on Linux:

cat /var/lib/dhcp/dhclient.leases

DHCP Client – UDP/68

Purpose: Used by client machines to receive IP address leases and network settings from the DHCP server.

Command to renew DHCP lease:

sudo dhclient -r && sudo dhclient

HTTP (Hypertext Transfer Protocol) – TCP/80

Purpose: Primary protocol for transferring web pages and related data.

Command to check HTTP server response:

curl -I http://example.com

POP3 (Post Office Protocol v3) – TCP/110

Purpose: Retrieves emails from a remote mail server to a local client.

Command to test POP3 connection:

telnet <pop3-server-ip> 110

NTP (Network Time Protocol) – UDP/123

Purpose: Synchronizes the clocks of computers over a network.

Command to check NTP synchronization:

ntpq -p

NetBIOS – TCP/139

Purpose: Allows applications on different computers to communicate within a LAN.

Command to list NetBIOS names:

nmblookup -A <ip-address>

IMAP (Internet Message Access Protocol) – Typically TCP/143

Purpose: Retrieves and manages email on a mail server.

Command to test IMAP connection:

telnet <imap-server-ip> 143

HTTPS (Secure HTTP) – TCP/443

Purpose: Secured version of HTTP, encrypting data in transit with SSL/TLS.

Command to check HTTPS certificate:

openssl s_client -connect example.com:443

SMB (Server Message Block) – TCP/445

Purpose: Provides file and printer sharing services primarily on Windows networks.

Command to list SMB shares:

smbclient -L //<server-ip>

Oracle Database – TCP/1521

Purpose: Default listener port for Oracle Database connections.

Command to test Oracle connection:

tnsping <oracle-server-ip>:1521

MySQL – TCP/3306

Purpose: Default port for MySQL database communication.

Command to connect to MySQL:

mysql -h <mysql-server-ip> -u username -p

RDP (Remote Desktop Protocol) – TCP/3389

Purpose: Remote desktop access to Windows-based systems.

Command to connect via RDP:

xfreerdp /v:<windows-ip> /u:username /p:password

PostgreSQL – TCP/5432

Purpose: Default port for PostgreSQL database connections.

Command to connect to PostgreSQL:

psql -h <postgres-server-ip> -U username -d dbname

What Undercode Say

Understanding and managing network ports is crucial for secure and efficient IT operations. This guide provides a comprehensive overview of essential ports, their purposes, and practical commands to test and manage them. For instance, using `ssh` for secure remote access or `nslookup` for DNS queries ensures smooth network operations. Additionally, tools like `curl` and `openssl` help verify web server responses and SSL certificates, respectively. For database administrators, commands like `mysql` and `psql` are indispensable for managing database connections. Network administrators can leverage `smbclient` for SMB share management and `ntpq` for time synchronization. Mastering these commands not only enhances security but also optimizes network performance. For further reading, refer to Linux Networking Commands and Windows Networking Commands. Always ensure ports are properly configured and secured to prevent unauthorized access and potential breaches.

References:

Hackers Feeds, Undercode AIFeatured Image