DevOops
XXE with a git misconfiguration
Vulnerable endpoint /upload that seems succeptible to XXE.

When we use any generic XXE payload, we recieve an internal server error as it does not fit the requirements of the XML elements (Author, Subject, Content).
Adding these elements nested seems to fix the problem and we get our RFI!

We can easily get the user flag, knowing that the user is roosa and the file is user.txt.

But now we need a shell. We know that the file running the app is feed.py most likely located in roosa's home directory based on the file path leaked from the burp request.
Using our XXE payload, we can query for feed.py at /home/roosa/deploy/src/feed.py, getting the source code of the web application.
Cool, so we have a pickle vulnerability once again. We can quickly craft out reverse shell and pickle it.
Viola, a shell appears.

To get root, we can checkout the .git directory where can read the commit history using git log
We see two interesting commit entries 33e87c312c08735a02fa9c796021a4a3023129ad and d387abf63e05c9628a59195cec9311751bdb283f.
Looking at blogfeed/resources/integration/authcredentials.key, we see that the key is a ssh private key.
If we extract the file using git checkout and try to login, we see that it is actually root's ssh key, thus getting our root flag.
Last updated