Service Enumeration

21: FTP

FTP (File Transfer Protocol) operates over TCP Port 21 and is commonly used to enable file sharing between a server and client(s). It's also frequently leveraged for transferring files to and from web server directories. Metasploit offers several auxiliary modules to gather information from FTP servers and conduct brute-force attacks.

FTP authentication typically requires a valid username and password. However, misconfigured servers may allow anonymous login, presenting a potential security risk.

msfconsole
workspace -a ftp_enum

# Perform Port Scan
search portscan
use auxiliary/scanner/portscan/tcp

# Search for FTP-related auxiliary modules
search type:auxiliary name:ftp

ftp_version # To identify the FTP server version.
ftp_login # Requires user and password files for brute-force attempts (note: brute-force attacks can be slow).
ftp/anonymous # To check if anonymous login is enabled.

22: SSH

SSH (Secure Shell) is a remote administration protocol that provides encrypted communication and is the successor to Telnet. It is commonly used for remote access to servers and systems. By default, SSH runs on TCP port 22, though it can be configured to use any open TCP port. Metasploit's auxiliary (aux) modules can be used to enumerate the SSH version and perform brute-force attacks to identify passwords, potentially granting remote access to the target system

Note: Although Metasploit offers these modules, manual methods and other tools may provide better results in some cases.

25: SMTP

SMTP (Simple Mail Transfer Protocol) is a communication protocol used for transmitting emails. By default, it uses TCP port 25, but can also be configured to run on TCP ports 465 and 587. Using Metasploit's auxiliary (aux) modules, we can enumerate the SMTP server version and user accounts on the target system.

Scenario

How can you identify the SMTP server, enumerate users, check supported commands, and send emails (including fake emails) using various tools such as Nmap, Netcat, Telnet, smtp-user-enum, and Metasploit?

Web Server Enum: 80,443: HTTP, HTTPS

A web server is software that serves website data on the web, using HTTP to facilitate communication between clients and the server. HTTP, an application layer protocol, uses TCP port 80 for communication. Using Metasploit’s auxiliary (aux) modules, we can enumerate the web server version, HTTP headers, brute force directories, and more. Examples of web servers include Apache, NGINX, and Microsoft IIS.

Note: Metasploit is not mandatory for web server enumeration; manual techniques or other tools may yield better results.

445: SMB

Server Message Block (SMB) is a protocol for network file sharing, primarily using port 445, with earlier implementations running over NetBIOS on port 139. It's used for sharing files and peripherals on local networks (LAN), and its Linux implementation is called SAMBA, enabling Linux and Windows systems to share resources.

Scenario

How can you perform a comprehensive reconnaissance on a SAMBA server to identify its open TCP and UDP ports, workgroup name, exact version using Nmap and Metasploit, NetBIOS computer name, and determine whether anonymous connections (null sessions) are allowed using smbclient and rpcclient?

3306: MySQL

MySQL is an open-source relational database management system (RDBMS) based on SQL. It is commonly used to store web application data and customer records. By default, MySQL uses TCP port 3306, though it can run on any open TCP port. Metasploit’s auxiliary (aux) modules can be used to enumerate MySQL versions, perform brute-force attacks to identify passwords, execute SQL queries, and more.

Note: While Metasploit provides useful tools, manual techniques or other tools may sometimes yield better results.

Last updated