TryHackMe || Advent of Cyber 2023 Day 3: Hydra is Coming to Town || WalkThrough
Learning Objectives
After completing this task, you will understand:
- Password complexity and the number of possible combinations
- How does the number of possible combinations affect the feasibility of brute-force attacks
- Generating password combinations using Crunch.
- Trying out passwords automatically using Hydra.
We will use Crunch to generate the password list and use Hydra to guess the correct password using that password list.
The command used to generate the password list using Crunch: ‘crunch 3 3 0123456789ABCDEF -o 3digits.txt’. Now, let’s understand the logic behind this command.
- The first 3 denote the minimum length to generate the combination, while the second 3 denote the maximum length.
- ‘0123456789ABCDEF’ denotes the possible input at a specific place of the password.
- ‘-o 3digits.txt’ denotes the output to be saved with the name 3digits and the format will be .txt.
And the command to use the password list using Hydra: ‘hydra -l ‘’ -P 3digits.txt -f -v MACHINE_IP http-post-form “/login.php:pin=^PASS^:Access denied” -s 8000’. Now, let’s understand the logic behind this command.
- -l ‘’ denotes that the login name should be blank or the login name field does not exist.
- -P 3digits.txt denotes the password list to be the generated text file, if we have a single password, then p would be used instead of P.
- -f denotes that whenever the correct combination is found, the further operation will be stopped.
- -v is used for verbosity of the result, ie we will be able to see the details of whatever is happening.
- MACHINE_IP http-post-form is used as we are the post method of HTTP for submission.
- “/login.php:pin=^PASS^:Access denied” indicates that we are using the login page and the passwords from the list will replace the ^PASS^ and also that the Access denied page opens if the wrong pin is entered.
- -s 8000 indicates that the port being used is 8000.
If you use it correctly, then Crunch will provide you with the combination that opens the lock, and the Hydra does it for you.
Q/A
- Using
crunch
andhydra
, find the PIN code to access the control system and unlock the door. What is the flag?
If you use the above commands correctly, then Crunch will provide you with the combination that opens the lock, and the Hydra does it for you. You have to enter the combination and click on verify. Opt for the unlock door option to get the flag.
If you have got your answers, Congratulations🥳. But if you are confused and unable to get the answers, follow the link to the post which contains the answers. https://thecyberwarrior.medium.com/aoc-2023-answers-13a5fb83b0b7
If you find this blog helpful, follow me on LinkedIn: https://www.linkedin.com/in/-prashantkumar07/
Happy Learning