Stratos Ally

Password Cracking with Medusa in Linux 

**Note: The content in this article is only for educational purposes and understanding of cybersecurity concepts. It should enable people and organizations to have a better grip on threats and know how to protect themselves against them. Please use this information responsibly.** 

Medusa is a highly versatile, modular, and efficient login brute-forcing tool renowned for its speed and parallel processing capabilities. With over 21 modules, it offers extensive protocol support, enabling users to brute-force credentials across various services, potentially leading to remote code execution. Some of the supported modules include PcAnywhere, POP3, CVS, FTP, HTTP, IMAP, SMB, SMTP (VRFY), SNMP, SSHv2, MS-SQL, MySQL, NCP (NetWare), PostgreSQL, rexec, rlogin, rsh, Telnet, SVN, VNC, VmAuthd, and a generic wrapper module. 

Kali Linux, a popular security-focused Linux distribution, comes pre-installed with Medusa. However, if Medusa is not present on your system, you can install it easily using the following command in your terminal, which utilizes the apt package manager: 

sudo apt-get install medusa 

The tool aims to provide extensive support for remote authentication services by incorporating a wide range of protocols, such as HTTP, FTP, SSH, and Telnet, allowing for comprehensive testing and analysis of login processes across various platforms and services. This tool allows concurrent brute-force testing against multiple hosts, users, or passwords, enhancing efficiency and reducing testing time. Users can specify target information (such as host, user, and password) in various formats, accommodating single entries or files containing multiple entries. Additionally, a combination file format enables users to refine their target listing according to their requirements. 

Each service module is encapsulated within an independent .mod file. This modular architecture ensures that the core application remains unaltered when extending support for additional services, simplifying the incorporation of new brute-forcing capabilities. 

Switches of Medusa 

To access detailed descriptions of the available options in the Medusa tool, simply enter “medusa” in the Kali terminal without any additional options. This command shows the comprehensive list of available options along with their descriptions. 

This syntax allows users to specify the following parameters: 

-h host|-H file Specify a single host or a file containing multiple hosts. 
-u username|-U file  Specify a single username or a file containing multiple usernames.  
-p password|-P file Specify a single password or a file containing multiple passwords.  
-C file Specify a file containing combinations of hosts, usernames, and passwords. 
-M module Select the module corresponding to the target service.  
[OPT] Additional options specific to the selected module.  

The “-d” option can be utilized to list all available modules within the Medusa tool. This command provides users with an overview of the diverse range of modules supported by Medusa for conducting brute-force testing against different authentication services. 

Password Cracking for specific Username:  

As a brute-force tool, Medusa can be employed to crack passwords when the username is known for various protocols. To achieve this, you’ll need a valid username and a file containing passwords to test against.  

The following command illustrates how to use Medusa for this purpose: 

medusa -h 192.168.40.129 -u username -P pass.txt -M ftp -n 21 -f 

In this command: 

  • -h specifies the target IP address. 
  • -u is used to specify the username. 
  • -P indicates the file containing the list of passwords to be tested. 
  • -M selects the protocol/module (in this case, FTP) for which the password will be cracked. 
  • -n is used for non-default TCP port number.  

Username: msfadmin 

Password: msfadmin 

To crack Login credentials 

In a scenario where both the username and password are unknown, Medusa can be employed to perform brute-force attacks on both fields simultaneously. Here’s how you can use Medusa for this purpose: 

medusa -h 192.168.40.128 -U users.txt -P pass.txt -M ftp 

In this command: 

  •  -h specifies the target host’s IP address.  
  • -U is used to specify the list of usernames to be tested  
  • -P indicates the file containing the list of passwords to be tested.  
  • -M selects the FTP protocol/module for which both username and password will be brute-forced. 

In summary, Medusa’s versatility, speed, and effectiveness make it an essential component of any security professional’s toolkit. It provides the capability to conduct rigorous security assessments and bolster the resilience of network infrastructures against unauthorized access and malicious attacks. 

Moreover, Medusa’s ease of use, coupled with its robust performance and reliability, makes it an invaluable asset for identifying weak authentication mechanisms, uncovering vulnerabilities, and fortifying network defenses against potential cyber threats. 

more Related articles