SpeedHacking on Youtube >>


CREDS >>

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

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


TryHackMe >>

https://tryhackme.com/r/room/thenewyorkflankees


Recon >>>

nmap >>

PORT 4346 / TCP >>

There we can found login web page >

Dirseach >>

This endpoints we will need after some steps …

PORT 80 / TCP >>

There we can found web page there are some points to find >

We can found script check-rooms.js and there we can found new end point /new-booking/

Let’s inspect this new end point >>

No rooms are available, but again, but when we look to debugger we can found this new script >

And there is interesting this part >

We can found api end point /api/booking-info?booking_key= and should get two parameters room_num and days. Next what we can found is in Storage is new Cookie parametr BOOKING_KEY:”55oYpt6n8TAVgZajJ4ghvHqe4″ .

We can try to decode this BOOKING_KEY >>

And we can get match Base58 decode our cookies.

Let’s look on API >>

We can use curl or web browser >

If we change parameter and add ‘ in the end there is a error >

But if we add ‘OR 1=1 — it works >>

SQLi confirmed !! And we can guess there are two parameters, so can try some magics >

So we can try confirm sqlite database >

Great, so we can look on table name >

And we can found tables :

  • email_access (guest_name TEXT, email_username TEXT, email_password TEXT)
  • reservations (guest_name TEXT, room_num INTEGER, days_remaining INTEGER)
  • bookings_temp (booking_id TEXT, room_num TEXT, days TEXT)

Interesting look email_access table, so let’s look into >

OK, we can try to login to found end point on port 4346 >

I left a message on your machine but wanted to follow up…. We can inspect source code >

There are two parts interesting api end point to messages >

And WebSocket communication >

So we can try IDOR check messages, maybe something interesting is there >>

Proxy request >

Set up payload and check >

And some messages we can found there >>

And response is base64 encode message >>

In one of this message we can found WEB Flag !!


USER PATH >>

Second part of script is WebSocket communication running, let’s burmp it and check >

There is information about Time Zone, we can try simple command injection >

And work, but if we are trying to get shell it is not able, there is some limitations for example lenght. I found this way >

Prepare reverse shell >

NOTE: Run port 443, other ports are filtered, more information below.

Start listener >

Go to console and execute reverse shell >

If everything is correct, you will get shell >

So let’s inspect around and we can found this files in home directory >

One file contains password. So we can try sudo -l >>

And we can check >

There is answer why many ports in reverse shell not work!

I check linpeas.sh but nothing interesting was there, so we can try run pspy64 >

This look interesting, let’s inspect >

So we can switch to sandra user >


ROOT PATH >>

In home folder sandra user we can found note.txt file >

In folder Pictures is boss.jpg file, we can download to kali and see password for jojo >

So we can switch to jojo user >

And in jojo home folder we can found this note >

And we can run as root this app >>

/usr/sbin/mount.nfs allows us to mount an NFS share. Where we can for example create suid app as root. Let’s try >>

Prepare on attacker machine >>

Create share on kali machine >

And we can try to connect to our server and linked it to /usr/sbin

Now we can copy for example bash >

And set owner to root add SUID >

And in share is this >

Now just run “b -p”

And we are DONE!

DX2: Hell’s Kitchen
was completely PWNed !!

Happy hacking!!

Leave a Reply

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