Brute It
Date: 09 November, 2021
Author: Dhaval Kotak
Room: Brute It
Reconnaissance
nanomite @ zeus in ~/thm/brute_it
⚡️ nmap -A 10.10.87.211 | tee nmap.log
Starting Nmap 7.91 ( https://nmap.org ) at 2021-11-09 12:20 IST
Nmap scan report for 10.10.87.211
Host is up (0.24s latency).
Not shown: 998 closed ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 4b:0e:bf:14:fa:54:b3:5c:44:15:ed:b2:5d:a0:ac:8f (RSA)
| 256 d0:3a:81:55:13:5e:87:0c:e8:52:1e:cf:44:e0:3a:54 (ECDSA)
|_ 256 da:ce:79:e0:45:eb:17:25:ef:62:ac:98:f0:cf:bb:04 (ED25519)
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-title: Apache2 Ubuntu Default Page: It works
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 72.48 secondsHow many ports are open?
2
What version of SSH is running?
OpenSSH 7.6p1
What version of Apache is running?
2.4.29
Which Linux distribution is running?
Ubuntu
Search for hidden directories on web server.
What is the hidden directory?
/admin
Getting A Shell
We find the username of SSH in a comment while looking at the page source
Now lets brute force the login page with hydra
Explaination :
-l admin : Specifying the username
-P /usr/share/wordlists/rockyou.txt : Specifying the password dictionary
10.10.87.211 : The Target IP
http-post-form : The type of attack protocol
/admin : The directory of the form
user=^USER^&pass=^PASS^ : The login response from the form
Username or password invalid : The login message if the login failed
What is the user:password of the admin panel?
admin:xavier
Crack the RSA key you found.
What is John's RSA Private Key passphrase?
rockinroll
User.txt
Web flag
You will get the flag when you login with the credentials found by hydra
Privilege Escalation
Find a form to escalate your privileges.
We can use cat as a root user without any password. So lets cat the /etc/shadow file.
Using john to crack the root hash
What is the root's password?
football
root.txt
Last updated
