OverPass
Target Details
IP: 10.10.60.248
Nmap Scan
Scan
Output
SSH and HTTP services are open
Find Directories using GoBuster
scan for directories
useful link: /admin
Admin Page
visit Admin Page
View Source
Interesting finding was
/login.js
file, which consists of login logic for client sideJavascript Function for client side login
From the above piece of code, we can observe that, we can bypass login by setting a cookie from web-browser console (Ctrl+Shift+I -> console tab) and using below method then reload the page
On reloading, we'll get private ssh key
id_rsa
on the pagesave the ssh key to a file
id_rsa
provide read and write access to user only
Cracking id_rsa using John The Ripper
Copy
ssh2john.py
script to current directoryUsing the scipt convert into crackable hash for john
Crack using john the ripper
Cracked password:
james13
Accessing Target Machine via SSH
Since, the message was for
james
, assuming the username to bejames
, try logging in with theid_rsa
filepassword:
james13
We'll get access to the shell
On listing directory contents, we'll find the first
user.txt
flag in james's home directory
Privilege Escalation
There's another file
todo.txt
, read file contentsjames has stored password in their password manager
Download and Read source code of the Overpass Project from the target's HTTP server
We can make below observations:
data is encrypted in ROT47 format in a file
data file is located in home directory named
.overpass
Reading contents of
~/.overpass
We can crack this encryption using online tools CyberChef
Unencrypted text
Download and Upload Linpeas to Target machine
Attacker Machine
Target Machine
Linpeas juicy findings
it's a cronjob which will run
Generating attack surface
Change
overpass.thm
ip to attacker's ipCreate an evil bash script with path
downloads/src/buildscript.sh
which will be executed every minuteStart HTTP server using python on attacker's machine to serve the file on port 80
Get root priviliges
Executing Attack
Target Machine
Attacker's Machine
After running the job, we'll get reverse shell
Get Root Flag
Output: thm{7f336f8c359dbac18d54fdd64ea753bb}
Answers
Q. Hack the machine and get the flag in user.txt
Q. Escalate your privileges and get the flag in root.txt
Last updated