Summary
Noter was a Medium difficulty Linux box created by kavigihan. Initial Foothold was finding a weak signing key used to sign the session we can modify the session and get ourself VIP
access using that we get the ftp
credentials and we find a pdf containing hint for ftp
admin credential. Logging as ftp_admin
we get access to app backup.In backup we find /export_note_local
route which take an markdown and export that as pdf. Using the we can get command injection and get access to the box as svc
we can get privilege escalation using module injection in mysql.
Enumeration
nmap
1 | # Nmap 7.92 scan initiated Sun May 8 04:06:01 2022 as: nmap -sC -sV -oN nmap/noter noter.htb |
Port 5000
Opening the page we see
Which look like an note taking application running on Werkzeug
Let’s Register to the website and see what happens
After Successful Register, Lets Login
On Dashboard We see two button
Add Note
and Upgrade to VIP
Creating some notes we see
the endpoint /note/4/
Lets look for other?
Not finding anything I looked into trying to unsign the cookie to maybe find the secret
1 | flask-unsign -u -c "eyJsb2dnZWRfaW4iOnRydWUsInVzZXJuYW1lIjoiZjN2M3IifQ.Ynd81g.NGys3evMvZ-sFmG0a1JEg6KulBY" -w "/usr/share/wordlists/rockyou.txt" --no-literal-eval |
and was able to find the secret as secret123
Enumerating for user on login screen based on error message we find an username as blue
.
forging the cookie for that and trying it out we find
a note as
Logging into the ftp service we find the policy.pdf which show the password creation patern.
Logging as ftp_admin
with password ftp_admin@Noter!
we find an app backup so downloading that
Shell
1 | Nildogg36 |
1 | use mysql; |
Root Shell
https://medium.com/r3d-buck3t/privilege-escalation-with-mysql-user-defined-functions-996ef7d5ceaf