CREDS >>

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

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

Discovery >

nmap >

Nothing special, let’s inspect port 80 >>

80 / TCP >>>

dirsearch >>

We can look on website >>

We can login and register new user >

But when we login we can see, maintenance message and nothing more.

So we can try some SQL injection to break it >>

First try was basic ‘ OR 1=1 — – but not work, some kind of filtering is there >

But when we try on exist user it work >>

So we can try some guessing >>

And we can try one user which work >

So there is way which we can try and that is Boolean-Based Blind SQL Injection >>

Fro more info >>

https://www.geeksforgeeks.org/sqlbit-automatize-boolean-based-blind-sql-injections

https://portswigger.net/web-security/sql-injection/blind

And there two way to brutefircing one is over Substring and other is over ASCII codes bruteforcing , we can try first of this >

In the basic first we start Burp or Caido and hit request >

After that we can try bruteforcing character after character then we get all name of database, name of table or something what we would want.

Let’s start with database name >>

Our payload >

So we can get out payload to Intruder >

Select char “a” and we can set our Payloads to “Brute forcer” >

And start our attack >

And we should see this >

Where we can see first letter of database name is starting “m” !

After that we need to logout and try to second char >

Payload >

After whole process we can found database name like >> myw**site 🙂

After that we can try to find table name >>

Our payload >

Technique is same >>

There results will be like ” siteu**rs” 🙂

And we will password of Kitty user let’s start, technique stay same our payload >>

After that we can found passwordlike L0*********tY of kitty user and login to ssh >>

USER Flag is DONE !


ROOT Path >>>

After recon we can found this >>

We can found development page on localhost port 8080 >

So let’s look on it >

After port forwarding we can see >>

Look similar but in source code is this >>

If we use header X-FORWARDED-FOR and try SQLi it will get log item in logged file, so we can try >

Our request in Burp >

And output in /var/www/development/logged >

OK, we can try command injection >

Our payload >>

Start listener on port 1234 >>

And send our request >>

And result of our reverse shell >

And we are ROOT !!

Machine was completely PWNed!!

Happy Hacking 😉 . See you next time!

Leave a Reply

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