GoBuster on 61337 found multiple directories: /admin, /application, /temporary, etc. However, they returned 403.
Although, there still may be files/directory that we have permission to access. Therefore, we ran Gobuster for each directory found and repeat for each new directory found.
After running GoBuster, we found that we can access /temporary/dev/newacc
List used: /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt
This endpoint allowed us to create an account for the web app.
We could login using the accounts created above
Server Side Template Injection – username parameter (Initial Foothold)
Privilege Escalation – logstash process running as root, write privileges over logstash config file and set to auto-reload.
All Done! 😀
Enumeration
Nmap and rustscan found the following open ports:
7/echo
21/ftp
22/ssh
23/telnet
80/http
61337/Werkzeug httpd
Enumerating the ftp did not find anything as anonymous logon and usage of other common credentials failed.
While enumerating the HTTP services (80 and 61337), we found that there is a logon page on port 61337.
Use of common weak credentials did not work. Additionally, the parameters were not found to be vulnerable to SQLi
For further enumeration, we ran GoBuster on ports 80 and 61337.
We found multiple directories: /admin, /application, /temporary, etc. However, they returned 403. Although, there still may be files/directory that we have permission to access. Therefore, we ran Gobuster for each directory found and repeat for each new directory found.
After running GoBuster, we found that we can access /temporary/dev/newacc
list used: /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt
This endpoint allowed us to create an account for the web app.
We were able to login to the web app using the account created previously.
Browsing through the app, we found that on /account our username is reflected on the page.
Since the name of the room is ‘temple’ and the web server is python, we could assume that it would be related to the templates. Therefore we try for SSTI (Server Side Template injection)
Exploitation
To confirm if the endpoint is vulnerable to SSTI, we try to register a user with the following username:
{{1*2}}
Once registered, we logged in and found that the username showed up as 2. This confirmed that the endpoint was vulnerable to SSTI.
When we tried SQLi, we found that the parameters had some filtering in-place
Therefore, to exploit the application, we did the following:
Created a file called rce with the following contents: