HTB-oopsie
Oopsie htb machine

Target machine enumeration

i got two ports open 80 and 22
i visited the http://10.129.183.20 and normal page appeared !! and i tried to analyze the source codes ! , not effectively !! :)

i got something suspicious there !!

i apprached the login pannel i.e

see i started to logged in and captured the req in burp and i saw the response of the request !!

as you can see above i saw the param i.e guess=true i tried that and i was redirecting to admin.php

as you willl always go through this website on your target ip , you will have to get familiar for finding the small bugs , as i did , see i captured the req and saw the reponse but i instantly gone to the source code on target ip and seen carefullly !!
it requires super admin privilages ——> i was like yeah this shold be noted then i moved to the other optoins like account ;)
i got this usl i tried to do id=1 and i got admin acess id , at this point i was thinking like i have forgotten something , at the time i captured the rep i didnt looked into the req carefully !!


i got acess id there that i missed to lookout earlier and then i just maked the 3422 i.e admin acess id and role to admin !!
and it was sucess !!
but yeah at this was login page it still returned me a login pannel and leaved this and moved on to the source code there i got any urls

but this was nothing for me at the time like i already founded it and gone to uplaods and it required the admin priv so i just changed the role and acess id to admin and 34322 and then i got option for uploading the file !!!
2> GAINING FOOTHOLD
for foothold i just gone through cmds notes and copied a php revershell payload and started a listner too
so all this things for foothold i have been into the burp ,
i refreshed the page and captured the req of the url below;
i started the listener after sending the above payload as the shell.php , see i tried multiple times but i didnt get the trigger like the mistake was i was triggering this into wrong like

but this was wrong !!
i stared directory enumeration with totally upset mood , till that i was roaming for shell acess because to trigger the revere shell i have to make it trigger throught the proper path !!

i gone to the path
boom , i got reverse shell on 4444 which i started nc -lvnp 4444

so this was what i had done there , see i am posting here what i have done , because i am lazy and i dont want to edit anything at all ,

so i got user.txt
3> privilage esclation
i am not good at priv esc like i am always like i have to think harder and harder so i just tried the commands

as you can see i got a intresting thing bugtracker , idk anything about it,
i use above cmd and got nothing intresting !! this was my thinking when i used this cmd and just scrolled down faslt no analysis like deep one !!

but yeah i got something there !!

so this was my thinkgin going on , and i leaved it later like i didnt knwo anythin and i started to use that and i got permission denied and followed the directory i.e

see this looks easy but trust me it was too hard for me to go raoming this side for php files and i got some password
i setuped putty for interactive shell and yeahh i got admin and pass MEGACORP_4dm1n!!
and i runned on my terminal su
so su to robert ;
now the real game begainns for me !!!

as you can see this was the **it i was doing here !! idk what i was doing but i was geeting something like
i was going deeper and i got nothing there !!!
i tried to go for /etc/passwd to find the active users there and only robert was present there
same alternative i tried to do ssh like we had admin crdentials but no luck there !!



see i started to look into the bug tracker as i confirmed that i was in the bugtrackers grp so i can execute it !!
so a catch is there see , cat: /root/reports/123
so catch is like the tool or like service or whatever bugtracker coudnt find the cat ,
for example , for running the cat command in the linux first liunux goes throught the file cat and then run the cat !!
just do following
If we make our own file called cat, and put it in a directory that comes before /bin in the $PATH, it gets used instead of the real cat
so ,
now , bugtracker runs the cat and the linux finds the /tmp/cat first i.e before bin
and the file does is /bin/bash
offcourse it started a new shell !!!
as bugtraker is already root so it provides a root shell !!

here i used less command to get root !!
CATCH—→
see , the bugtracker runs following
if bugtracer runs this
system("/bin/cat /root/reports/12");
which was like boom no efforts then it could have worked !!
but in out situation its like kali linux have to find the path for the cat /root/reports ///….. to run
so key point is its just “cat” written there
and linux finds the cat like this ;)
so , what happened with our tricked path hijack is ;
1> linux gone to /tmp/cat
2> and provide a shell
3> it never reached the /bin/cat
i am soory its bit confusing , i am new to building writeupps i tried this to understand to you as well as me as for my notes i am making this writeupps !!!
hope the catch concept should be cleared !!!

connect with me here ;) https://www.linkedin.com/in/ashutosh-0xash-munde-%F0%9F%87%AE%F0%9F%87%B3-760138262/
its really a nice machine !!!
Last updated
Was this helpful?
