How to exploit CVE-2021-40539 on ManageEngine ADSelfService Plus
The report describes a path traversal in the REST API that bypasses authentication, an arbitrary file upload, and an argument injection in the keytool command, which together allow an unauthenticated attacker to execute arbitrary code on the server.
synacktiv.com
Published on synacktiv.com
Rédigé par Antoine Cervoise, Wilfried Bécard - 04/11/2021 - dans Exploit, Pentest - Téléchargement
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application failed to properly sanitise user-supplied paths and parameters, leading to a path traversal authentication bypass, unrestricted file upload, and command argument injection.
What the attacker needed
Network access to the ADSelfService Plus instance; No authentication required
The fix
The path traversal was fixed by normalising the URI, but the file upload and argument injection issues remain unfixed according to the text.
How it was found
- Send a request to the REST API endpoint with a path traversal sequence to bypass authentication.
- Use the authenticated access to upload an arbitrary file via the LogonCustomization endpoint.
- Trigger the openSSLTool action to execute keytool with injected parameters.
- Upload a malicious Java class and use keytool's providerclass option to load and execute it.
- Optionally upload a JSP webshell and move it to the webroot using the code execution.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
This is about a security flaw in a password management tool. Attackers could trick the tool into letting them in without a password, upload harmful files, and then run their own programs on the server. This means they could take full control of the system.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.