Stratosphere Writeup
Stratosphere Writeup
Enumeration
Visiting the webservices on port 80 in a web browser brings us to the “Stratosphere” Web
Application landing page.
Clicking on the “Getting Started” URL leads us to a “Site under construction” page as seen below.
Visiting the /Monitorting web content redirects us to to the “Stratosphere Credit Monitoring”
Application.
The application has a unique web file extension of .action which is associated with the Apache Struts
url pattern. After some further research, we can learn that it is indeed a well-known extension for
the Java WebSphere & Apache Struts applications.
At this particular point if you are familiar with popular infosec news/events, you would know that
the U.S Credit Monitoring organization known as “Equifax” was compromised through an unpatched
apache struts vulnerability. Based on the similarities, and context clues of the “Stratosphere Credit
Monitoring” we can maybe assume that this application is vulnerable to the “Apache Struts” RCE
vulnerability.
After some quick googling we come across the following PoC exploit for the Apache Struts, CVE-
2017-5638 vulnerability called struts-pwn.
Once the tool is downloaded, we will open that folder and run the following command.
Now that we know we have successful remote code execution, let’s try to escalate our privileges
further, and look into getting an interactive shell.
After exploring we found a file with name db_connect, let’s see what’s in that.
It seems as though there is a database running on the server. We can enumerate the mysql database
through the apache struts exploit. Using the mysql -e parameter we can run mysql commands non-
interactively, and receive the output of the queries through stdout.
Database
information_schema
users
Tables_in_users
Accounts
Attempting to ssh into the box using the richard account, and the password of
9tc*rhKuG5TyXvUJOrE^5CK7k from the mysql database results in.
Privilege Escalation
Upon enumeration We found the file test.py , we tried to open it and found it has some hash
stored in it.
So now we will decrypt the hash online and we got the following.
Successfully solving the challenge results in a Permissioned denied on the the sucess.py script so it
seems that this may have been a false flag, and we need to do further enumeration for the proper
priv. esc vector.
In order to exploit this vulnerability, all we have to do is create a python module (that our target
script is importing) in the directory of the script that we are attempting to run. Since the test.py
script imports the hashlib library we will create a hashlib.py python module, which will load our code
over the original hashlib python module.