Brute It

Task 1: About this box

Deploy the machine

No answer needed

Task 2: Reconnaissance

Search for open ports using nmap. How many ports are open?

  • Let's perform a nmap scan against the machine.

  • There are two open ports:

Port
Service

22

ssh

80

http

Answer

What version of SSH is running?

  • The answer is present in the nmap scan.

Answer

What version of Apache is running?

  • The answer is in the nmap scan.

Answer

Which Linux distribution is running?

  • The answer is in the nmap scan.

Answer

Search for hidden directories on web server. What is the hidden directory?

  • Let's brute force the web pages using gobuster.

Answer

Task 2: Getting a shell

What is the user:password of the admin panel?

  • Let's go to the admin/ directory.

  • We can check the source code using CTRL+U.

  • Now that we know the username, we can use hydra to brute force the password.

Answer

Crack the RSA key you found. What is John's RSA Private Key passphrase?>

  • Let's login with admin as the username and xavier as the password.

  • Let's download the RSA private key for the user john.

  • We can use ssh2john to create a hash file.

  • Now we can use john to crack the hashes.

Answer

user.txt

  • Let's change the permissions of the id_rsa file.

  • Now that we know that the password for john is rockinroll, let's login through SSH.

  • Let's read the user.txt file.

Answer

Web flag

  • The web flag was present on the page with the RSA private key.

Task 4: Privilege Escalation

Find a form to escalate your privileges. What is the root's password?

  • Let's check what sudo commands john has the permission to execute.

  • So we can run /bin/cat as an elevated user.

  • That means we can cat the /etc/shadow file.

  • We can tell that the root user's password is hashed using SHA-512 by the $6$ characters.

  • Let's save the root user's hash on our machine.

  • We have to find the correct mode for SHA-512.

  • Let's run hashcat in order to crack this hash.

Answer

root.txt

  • Let's switch to the root user.

  • We can now read the root.txt file.

Answer

Last updated

Was this helpful?