Strutted-HTB MACHINE


RECON
RUST SCAN && NMAP
rustscan -a 10.10.11.59 --ulimit=5000 --range 1-65000 -- -sCV -Pn

nmap -sC -sV -vv -oA 1 10.10.11.59

recon && analysis on website !!!
i was just roaming on the website reading source code , i saw download.action(after reading on the bottom i got there is a writeen something about there docker stuff that catched my attention and then it was written to download and see the stuff ) and upload.action .........
downloaded the strutted folder and then i saw a dir of strutted wit some files

i visited all the files , as you can see below and i got some creds (happy at the time ;) ) , after that got a version of strut 2 (


under pom.xml i saw the version is preesent and after this i was still on file check >> strutted > src > main > java >org > strutted > htb ;) had a nice read at that files (some database files but had nothing intrest at all there )

wass seeing some hidden endpoints......

thesse are some of the files i had the read (still having that version but i was doing it parllely ) ....



RECON OF VERSION NUMBER AND UPLOADING IMAGE TO GET FOOTHOLD !!
finally after scanning files , gone for to may searches and seriosly visited many links rapid seven (but the version was low around 2 to 2.45 something approx ..............


after search for a particular cve i got some resultes and this was quite nice , as i had a nice read at the code basically what it is doing and all stuff .........
THEN I STARTED TO ANALYZE THE REQ FROM THE PROXY , AS THE I WAS NOT GEETING THIS POST IMAGE UPLOAD REQ DIRECTLY FROM INTERCEPT !!!!!!!...........

analyzed that there is a name = 'upload' , instead its Upload , if you try this and add a jsp shell as below the foothold is yours ;) , so the reason i took to upload the png was bit difficult as the png format was encoded and i had uploaded a png image from internet , so , that i was geting a lot of encoded format strings ......
see there are two point fields , composition disposition and after the upload was sucessfull just added it again at the end to make sure my file comes at the normal directory where i shouldnt get errors !!! ,
for example , https://ip/uploades/date_data/filename --> https://ip/file
so putting the file format in ../../file --> ip/file makes visible (you have to test this i will be telling all the failures end of this !!!!!!!........
THE CODE AND JSP FILE AT THE END OF THIS SECTION !!!!


i got a shell there !!!!!!(unix) --> foothold


https://raw.githubusercontent.com/tennc/webshell/refs/heads/master/fuzzdb-webshell/jsp/cmd.jsp

GAINING FOOTHOLD && SSH to james ;)
uploading the file from my terminal to unix web shell ,


done some mistakes , like uploaded directly , normally i upload it to /tmp

sended perdfectly !!!!


one more mistake norammly i use 4444 , due to a lot fale attempts idk nothing but at last it worked

had some basic recon on foothold !!!


saw the user james downside !!!!!

nothing nice here !!!


hehheheh we got some creds here ,



cat user.txt
and user is yours !!!!


ROOT............
/usr/sbin/tcpdump NOPASSWD
Tcpdump = Network packet sniffer
tcpdump -z --> does the work of capturing the packet and rotating it and executing the command
so basically captured file >>> roating it and then exec cmd !!!......
and also there is a tcpdump page on GTFObins

tried to get some help here , on google and got in mind that this is not goona work (i was doing something else experiments)



finally the gtfobin was working one and got root there !!!!!!!
Sudo misconfiguration + Tcpdump -z flag + Root context = Command injection → SUID bash copy → Permanent root shell!!!
i am really improving myself at writting reports as i am not expert , just learning daily , the screenshots above were saved and i hae to arranged it properly at the end of machine so tuff , i have to do it parllely , btw done some parrly at the starting ........ will be improving (am too lzy!)..

Last updated
Was this helpful?

