Understanding popular ports and their associated services is crucial for network security assessment. This lesson covers the most commonly encountered ports, their services, typical vulnerabilities, and specific NMAP commands for effective reconnaissance.
Learn common vulnerabilities and security considerations for each service.
Targeted scanning techniques and NSE scripts for each service.
Understanding how these services are used in actual network environments.
Used for transferring files between client and server
FTP transmits credentials in cleartext. Consider SFTP or FTPS for secure file transfers.
nmap -p 21 -sV target
nmap -p 21 --script ftp-anon target
nmap -p 21 --script ftp-bounce target
Secure remote login and command execution
Use key-based authentication, disable root login, and keep SSH updated.
nmap -p 22 -sV target
nmap -p 22 --script ssh-auth-methods target
nmap -p 22 --script ssh-hostkey target
Unencrypted remote terminal access
Telnet should be replaced with SSH in all modern environments.
nmap -p 23 -sV target
nmap -p 23 --script telnet-ntlm-info target
nmap -p 23 --script banner target
Email transmission between servers
Configure proper authentication and disable open relay functionality.
nmap -p 25 -sV target
nmap -p 25 --script smtp-enum-users target
nmap -p 25 --script smtp-open-relay target
Domain name resolution services
Restrict zone transfers and implement DNS security extensions (DNSSEC).
nmap -p 53 -sU -sV target
nmap -p 53 --script dns-zone-transfer target
nmap -p 53 --script dns-cache-snoop target
Unencrypted web traffic
Use HTTPS (port 443) for sensitive data transmission.
nmap -p 80 -sV target
nmap -p 80 --script http-title target
nmap -p 80 --script http-enum target
Email retrieval from server to client
Use POP3S (port 995) or IMAP with SSL/TLS encryption.
nmap -p 110 -sV target
nmap -p 110 --script pop3-capabilities target
nmap -p 110 --script pop3-brute target
Microsoft RPC endpoint resolution
Block this port at the firewall unless required for legitimate RPC services.
nmap -p 135 -sV target
nmap -p 135 --script rpc-grind target
nmap -p 135 --script msrpc-enum target
Windows file and printer sharing
Disable NetBIOS or use SMB3 with encryption for modern networks.
nmap -p 139 -sV target
nmap -p 139 --script smb-enum-shares target
nmap -p 139 --script smb-os-discovery target
Email access and synchronization
Use IMAPS (port 993) with SSL/TLS encryption for secure email access.
nmap -p 143 -sV target
nmap -p 143 --script imap-capabilities target
nmap -p 143 --script imap-brute target
Encrypted web traffic using SSL/TLS
Use strong cipher suites, valid certificates, and latest TLS versions.
nmap -p 443 -sV target
nmap -p 443 --script ssl-enum-ciphers target
nmap -p 443 --script ssl-cert target
Modern Windows file sharing protocol
Keep Windows updated and use SMB3 with encryption enabled.
nmap -p 445 -sV target
nmap -p 445 --script smb-vuln-ms17-010 target
nmap -p 445 --script smb-enum-shares target
Secure email access with encryption
Ensure strong SSL/TLS configuration and certificate validation.
nmap -p 993 -sV target
nmap -p 993 --script ssl-enum-ciphers target
nmap -p 993 --script imap-capabilities target
Secure email retrieval with encryption
Use strong SSL/TLS settings and consider migrating to IMAP.
nmap -p 995 -sV target
nmap -p 995 --script ssl-enum-ciphers target
nmap -p 995 --script pop3-capabilities target
Microsoft SQL Server database service
Use strong authentication, disable sa account, and implement network segmentation.
nmap -p 1433 -sV target
nmap -p 1433 --script ms-sql-info target
nmap -p 1433 --script ms-sql-empty-password target
MySQL database server
Use strong passwords, disable remote root access, and implement proper access controls.
nmap -p 3306 -sV target
nmap -p 3306 --script mysql-info target
nmap -p 3306 --script mysql-empty-password target
Windows remote desktop access
Use Network Level Authentication, strong passwords, and VPN access.
nmap -p 3389 -sV target
nmap -p 3389 --script rdp-enum-encryption target
nmap -p 3389 --script rdp-vuln-ms12-020 target
PostgreSQL database server
Configure proper authentication, use SSL connections, and limit network access.
nmap -p 5432 -sV target
nmap -p 5432 --script pgsql-brute target
nmap -p 5432 --script banner target
nmap -p 21,22,23,25,53,80,110,443 target
Scan common ports quickly
nmap --top-ports 1000 target
Scan top 1000 most common ports
nmap -sV -sC target
Version detection with default scripts
nmap -A target
Aggressive scan (OS, version, scripts, traceroute)