Uploads and Dev seemed interesting. However, uploads was empty.
phpbash.php got us the web-shell already installed on the server with www-data user.
User Own
> cat /home/arrexel/user.txt
2c281***
Root Own
Another thing to notice was user www-data is able to run sudo as scriptmanager without a password and there's an interesting folder owned by scriptmanager in the root directory.
To run LinEnum.sh I got a reverse shell from the existing web-shell. Using the python server I downloaded the LinEnum.sh file onto the server and ran to see what all was interesting.
There was nothing too exciting in the output except the fact that there were some crontabs registered for the user root. As evident from the listings of the folder /scripts/ the text file was being generated every minute as stated above.
The code which was being run was test.py
f =open("test.txt", "w")f.write("testing 123!")f.close
As evident from the permissions, this file can be modified by the scriptmanager user and hence can be used to our leverage.
Craft the following python script on the attacker system, transfer, and replace the file on the machine and wait for the output.
After 1 minute we will have our root flag in the /tmp/root file.
> cat /tmp/rootcc4f0***
Learning outcome
Having a closer look at suspiciously owned root files, as these may give out important information, as in this case the change in time every minute was the clue to a root owned cron tab.