CREDS >>

TryHackMe – https://tryhackme.com/p/TheSysRat

HackTheBox – https://app.hackthebox.com/profile/1298347

Discovery >

nmap >

Let’s inspect port 21, 1337 >>

Port 21/TCP [FTP] >>>

There is nothing >>

Port 1337/TCP [HTTP] >>>

We can look on website >>

Nothing , so let’s brute enumerate >

Dirsearch >>

What is interesting for us is >

So let’s look on it >>

/admin/

But when we look on source code it is fake login page!

/admin_101/

It is looking better and possible creds included “hacker@root.thm” 🙂

Lets’ inspect with Burp Suite >

So what we can try is sqlmap and try this request on SQLi possibilities >

So save request and run sqlmap >

And we can found this SQL injection >

And also found this databases >

For us is interesting expose database and we can dump it and found this spicy information >

And some config information and another password (need cracked) >>

Inspection endpoint /file1010111/index.php

We can found this >

After enter password we can found this information >

So let’s try some usually parameters >

And “file” parameter works >>

Inspection /upload-cv00101011/index.php

OK let’s look on /etc/passwd and we can found one user >>

After that we can found upload page, maybe try to upload rev. shell?

Uploading is restrict only to *.png file, but we can try to bypass it >>

Create php rev. shell save as for example rev.php#.png and upload using by Burp >

And try to change file name to rev.phar >

And Forward, after that was upload success >

And we can found location in source code >>

And we can try to get a rev. shell >

An finally we can get shell >

After small recon we can found txt file include SSH creds in user folder >>

We can connect to SSH and get USER flag >

USER flag is DONE!


ROOT Path >>>

We can run linpeas.sh and we can found this to spicy possibilities in SUID >

So in GTFObins we can found, but direct shell not working as root >

But we can overwrite files owned by root and add our own password to /etc/shadow for root>>

So we can generate new password >

And write to /etc/shadow , follow instruction in GTFObins >>

After that we can login as root >>

And we are DONE!

Expose was completely PWNed !!

Happy hacking!!

Leave a Reply

Your email address will not be published. Required fields are marked *