System hacking
Performing Online Password Attacks
An online password attack is performed on network service, such as SSH, HTTP, FTP, SMB, and so on. For example, an attacker might attempt to guess a user’s password from a Website login. Most of the time, servers or network devices are not equipped to block an online password attack. Therefore, these attacks can succeed without much effort.
Password attacks can be of two types. The first type is the dictionary attack, which uses a list of common words. It continues to run through the list until a suitable match is found. On the other hand, a brute-force attack attempts to use words based on a given character set. With an online password attack, either one of the methods can be used. However, a dictionary attack is mostly the choice because of the slow speed of attack.
In this exercise, you will learn about performing an online password attack.
Learning Outcomes
After completing this exercise, you will be able to:
- Switch Off the Windows Firewall on PLABWIN10
- Use Wordlists
- Use Hydra to Guess Usernames and Passwords
Your Devices
You will be using the following devices in this lab. Please power these on now.
- PLABDC01 - (Windows Server 2019 - Domain Server)
- PLABWIN10 - (Windows 10 - Workstation)
- PLABKALI01 - (Kali 2019.2 - Linux Kali Workstation)
Task 1 - Switching Off the Windows Firewall on PLABWIN10
You will need to switch off the Windows Firewall to perform an attack on PLABWIN10. There are attacking methods that you can use to bypass the Windows or any other firewall running on the target. However, for the sake of this module, you will switch off the Windows Firewall and proceed with the remaining tasks.
To switch off the Windows Firewall on PLABWIN10, perform the following steps:
Step 1
Ensure that you have connected to PLABWIN10 and logged into the system.
Note that the PLABWIN10 desktop is displayed.
Step 2
In the Type here to search text box, type the following:
windows firewall
From the search results, select the Windows Defender Firewall.
Step 3
The Windows Defender Firewall window is displayed. On the Help protect your PC with Windows Defender Firewall page, click Turn Windows Defender Firewall on or off in the left pane.
Step 4
On the Customize settings for each type of network page, select Turn off Windows Defender Firewall (not recommended) for Domain, Private, and Public network.
Click OK.
Step 5
On the Help protect your PC with Windows Defender Firewall page, notice that Windows Defender Firewall is now turned off for Domain, Private, and Public network.
Close the Control Panel window and the PLABWIN10 window.
Task 2 - Using Wordlists
In a dictionary attack, a list of words, known as wordlist, is pre-defined and is used to match against the victim’s password. There are ready-made password lists available on the Internet. A password list can be a few bytes large, or it can also be gigabytes, as the more words in a password file, the bigger the size. If you do not intend to use a pre-defined wordlist, you can create your own. There are tools that are available that can help you create a wordlist. Some of the tools that are used commonly are:
- Wyd: Password Profiling Tool
- Crunch: Password Cracking Wordlist Generator
- CeWL: Password Cracking Custom Word List Generator
- RSMangler: Keyword Based Wordlist Generator for Brute forcing
In this task, you will learn about the wordlists. To do this, perform the following steps:
Step 1
Ensure you have powered on all the devices listed in the introduction and connect to PLABKALI01.
Credentials are:
Username:
rootPassword:
Passw0rdNote that the Kali desktop is displayed.
Step 2
On the desktop, in the left pane, click the Terminal icon.
Step 3
The terminal window is displayed. First, let’s look at the pre-defined wordlists that are available in Kali Linux. To do this, type the following command:
ls -l /usr/share/wordlists
Press Enter.
Step 4
Notice several wordlist files are displayed.
Step 5
Clear the screen by entering the following command:
clear
You have an option to use a pre-defined wordlist. You can also download the wordlists from the Internet. There are several wordlists available that have grown into Gigabytes in size. An alternative is to create a small wordlist manually, which you will do now. In the command prompt window, type the following command:
leafpad plab.txt
Press Enter.
Step 6
Leafpad opens with a file named (plab.txt).
Type the following words:
test
bee
bug
12345
12345678
password
passw0rd
Passw0rd
p@ssw0rd
admin
admin@123
Press Enter after each word except the last one.
Step 7
Press Ctrl + s to save the file.
Close the plab.txt file.
Step 8
Let’s verify if the plab.txt is created. Type the following command in the terminal window:
ls -l
Press Enter. Notice that the plab.txt file is created.
Step 9
Clear the screen by entering the following command:
clear
Kali Linux also contains a tool named cewl, which is used to generate wordlists.
Type the following command:
Note: The parameter -w defines the name of the wordlist. The -d parameter defines the depth of the search in a Website. The -m parameter defines the minimum word length.cewl -w test.txt -d 5 -m 3 intranet
Press Enter.
Step 10
The command runs successfully without any error.
Step 11
Let’s verify if the test.txt file has been created. Type the following command:
ls -l
Press Enter.
Step 12
Notice that the test.txt file has been created.
Step 13
Clear the screen by entering the following command:
clear
Let’s open the test.txt file and see the words that are stored in it.
Type the following command:
leafpad test.txt
Press Enter.
Step 14
The test.txt file is now open. It has captured several words from the Intranet Website.
Close this file.
Keep the terminal window open.Task 3 - Using Hydra to Guess Usernames and Passwords
Hydra is a tool that can perform dictionary attacks against several protocols, such as HTTP, FTP, SMB, SSH, and so on. Hydra is designed to conduct attacks against authentication services, which might be running using a protocol, such as HTTP.
In this task, you will use Hydra to guess usernames and passwords. To do this, perform the following steps:
Step 1
Ensure you have powered on all the devices listed in the introduction and connect to PLABKALI01. The command prompt window should be open.
Clear the screen by entering the following command:
clear
Hydra is not installed on Kali Linux by default. To use it, you need to install it first. Type the following command:
apt-get install hydra
Press Enter.
Step 2
The installation process for Hydra starts. During the installation process, you need to confirm the installation. Type the following:
Y
Press Enter.
Step 3
The installation process for Hydra continues.
Note: It may take a few minutes to complete the installation for Hydra.After the installation is complete, you are back on the prompt in the terminal window.
Step 4
Now, you will use Hydra to perform a dictionary attack using plab.txt that you had created.
Note: In reality, the wordlist will never be so small, but for the sake of demonstration, we can use this wordlist.Clear the screen by entering the following command:
clear
You have a vulnerable application, bWAPP, running on 192.168.0.10. You will use the plab.txt file to perform a dictionary attack against this application. To do this, type the following command:
Note: The hydra command takes the following parameters inputs: -t: Defines the number of logins to try simultaneously. -V: Displays each attempt of login and password. -f: Stops the dictionary attack after a suitable match for username and password is found. -l username: Defines a username that needs to be cracked. For example, the bee was the username for the bWAPP application. If you do not know the username, you can use the -L parameter and provide a username list, which is similar to wordlist. -P wordlist: Defines the wordlist containing probable passwords. You can use -p parameter for a single password. The website name or IP address: Defines the Website name or its IP address. Protocol: Defines the services on which the dictionary attack is launched.hydra -t 5 -V -f -l bee -P plab.txt 192.168.0.10 ftp
Press Enter.
Step 5
Let’s see if Hydra has been able to find out the password for the user, bee.
Note: Depending on the size of the wordlist, the time to get the results will vary.Notice the text in green. You have been able to crack the password for this FTP service on the host, 192.168.0.10.
Comments
Post a Comment