StartUp
Room Covers:
Discovery
Exploitation
Privilege Escalation (horizontal + vertical)
Target Details
IP: 10.10.115.38
Service and Content Discovery
Scan Machine with Nmap
We can login anonymously on FTP and we can write data anonymously in
ftp
directoryServices Discovered
ServicePortVersionFTP
21
vsftpd 3.0.3
SSH
22
OpenSSH 7.2p2
HTTP
80
Apache httpd 2.4.18
Visiting HTTP website doesn't provide much information
Finding directories using gobuster
Directories Found
DirectoryLinkfiles
/files
On visitng
/files
we get few files along with notice directory
Accessing FTP
Login anonymously
Logged in successfully
list files
files are of web directory
/files
Get Reverse Shell from Target Machine
Download php reverse shell
In reverse shell, change IP to TryHackMe VPN IP. default port is 1234
Start Netcat listener
Upload via FTP anonymously
From browser visit
/files/ftp/
directory and click on reverse shell file to get reverse shell on attacker's terminal
Search for First Flag
Find files
Read
recipe.txt
fileWe need to escalate privileges to read files
Privilege Escalation
Finding files with sticky bits
Couldn't find something important
Checking for Python to get shell with tty
Spawn TTY terminal to use sudo/su
from
/incidents
directory found a pcap fileTo analzye this file in WireShark, we need to first download the file, let's copy this file in
ftp
directory, then we can download it from web serverDownload the file from
http://10.10.115.38/files/ftp/suspicious.pcapng
Load the file in WireShark, right click on TCP packet number around 200 and choose follow -> TCP Stream, a list of commands will pop up in a new window, from where we can find the password
From pcap file: use follow lennie password
c4ntg3txxxxxxxxxxx
Now, we can log into lennie's account with the password
We've successfully escalated privileges horiztontally
Get User Flag
Finding Flag
Read
user.txt
file
Escalating Privileges Vertically
finding executables with sticky bits
let's try sudo
get sudo executables list
We cannot use
sudo
commandThere was scripts folder in the home directory
planner.sh
script belongs toroot
userRead
planner.sh
scriptscripts calls another script
/etc/print.sh
with root privilegesLet's analyze
print.sh
scriptThis script belongs to lennie, hence we can write it and create a reverse shell with root access
Overwrite file contents
Start netcat listener on attacker's machine on port 9999
Execute
planner.sh
scriptGet Reverse Shell
We've successfully got root privileges machine
Get Root Flag
List files
Read
root.txt
file
Last updated