Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🏠 Back to Blog

Medusa Cheatsheet

Medusa is a fast, massively parallel, and modular login brute-forcer designed to support a wide array of services that allow remote authentication.

Installation

sudo apt-get -y update
sudo apt-get -y install medusa

Command Syntax

medusa [target_options] [credential_options] -M module [module_options]

Parameters

ParameterExplanationUsage Example
-h HOSTTarget: Single hostname or IP addressmedusa -h 192.168.1.10 ...
-H FILETarget: File containing list of targetsmedusa -H targets.txt ...
-u USERNAMEUsername: Single usernamemedusa -u admin ...
-U FILEUsername: File containing usernamesmedusa -U usernames.txt ...
-p PASSWORDPassword: Single passwordmedusa -p password123 ...
-P FILEPassword: File containing passwordsmedusa -P passwords.txt ...
-M MODULEModule: Specific module to usemedusa -M ssh ...
-m "OPTION"Module options: Additional parameters for modulemedusa -M http -m "POST /login.php..."
-t TASKSTasks: Number of parallel login attemptsmedusa -t 4 ...
-fFast mode: Stop after first success on current hostmedusa -f ...
-FFast mode: Stop after first success on any hostmedusa -F ...
-n PORTPort: Specify non-default portmedusa -n 2222 ...
-v LEVELVerbose: Detailed output (0-6)medusa -v 4 ...
-e nsEmpty/Default: Check empty (n) and same as username (s)medusa -e ns ...

Modules

ModuleService/ProtocolDescriptionUsage Example
ftpFile Transfer ProtocolBrute-force FTP login credentialsmedusa -M ftp -h 192.168.1.100 -u admin -P passwords.txt
httpHypertext Transfer ProtocolBrute-force HTTP login forms (GET/POST)medusa -M http -h www.example.com -U users.txt -P passwords.txt -m DIR:/login.php -m FORM:username=^USER^&password=^PASS^
imapInternet Message Access ProtocolBrute-force IMAP logins for email serversmedusa -M imap -h mail.example.com -U users.txt -P passwords.txt
mysqlMySQL DatabaseBrute-force MySQL database credentialsmedusa -M mysql -h 192.168.1.100 -u root -P passwords.txt
pop3Post Office Protocol 3Brute-force POP3 logins for email retrievalmedusa -M pop3 -h mail.example.com -U users.txt -P passwords.txt
rdpRemote Desktop ProtocolBrute-force RDP logins for Windows remote desktopmedusa -M rdp -h 192.168.1.100 -u admin -P passwords.txt
sshSecure Shell (SSH)Brute-force SSH logins for secure remote accessmedusa -M ssh -h 192.168.1.100 -u root -P passwords.txt
svnSubversion (SVN)Brute-force Subversion repositoriesmedusa -M svn -h 192.168.1.100 -u admin -P passwords.txt
telnetTelnet ProtocolBrute-force Telnet servicesmedusa -M telnet -h 192.168.1.100 -u admin -P passwords.txt
vncVirtual Network ComputingBrute-force VNC login credentialsmedusa -M vnc -h 192.168.1.100 -P passwords.txt
web-formWeb Login FormsBrute-force login forms using HTTP POSTmedusa -M web-form -h www.example.com -U users.txt -P passwords.txt -m FORM:"username=^USER^&password=^PASS^:F=Invalid"

Useful Examples

SSH Brute-Force Attack

medusa -h 192.168.0.100 -U usernames.txt -P passwords.txt -M ssh

Multiple Web Servers with Basic HTTP Authentication

medusa -H web_servers.txt -U usernames.txt -P passwords.txt -M http -m GET

Test for Empty or Default Passwords

medusa -h 10.0.0.5 -U usernames.txt -e ns -M ssh

HTTP POST Form Attack

medusa -M http -h www.example.com -U users.txt -P passwords.txt -m "POST /login.php HTTP/1.1\r\nContent-Length: 30\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\nusername=^USER^&password=^PASS^"

Fast Mode (Stop on First Success)

medusa -h 192.168.1.100 -U usernames.txt -P passwords.txt -M ssh -f

Custom Port SSH Attack

medusa -h 192.168.1.100 -n 2222 -U usernames.txt -P passwords.txt -M ssh

Verbose Output

medusa -h 192.168.1.100 -U usernames.txt -P passwords.txt -M ssh -v 4

Parallel Tasks

medusa -h 192.168.1.100 -U usernames.txt -P passwords.txt -M ssh -t 8