Before I get started I want to clearly state that I am in no way affiliated, sponsored, or endorsed with/by Palo Alto Networks. All graphics are being displayed under fair use for the purposes of this article.
A pre-authentication format string vulnerability in the sslmgr service of Palo Alto GlobalProtect gateways allowed an attacker to leak memory and ultimately achieve remote code execution. The author details how to exploit this on a physical MIPS appliance by dumping memory to obtain the necessary offsets.
securifera.com
Published on securifera.com
The original lives on securifera.com
We do not hold its text, 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 sslmgr service passed user-controlled input directly to a format string function without proper sanitisation.
Impact
An unauthenticated attacker could execute arbitrary code on the device, potentially leading to full compromise of the firewall.
What the attacker needed
Internet-facing GlobalProtect gateway; vulnerable firmware version; ability to send crafted requests
The fix
The vulnerability was silently patched by Palo Alto in June 2018.
How it was found
- Set up a vulnerable Palo Alto GlobalProtect gateway (virtual or physical) with the affected firmware.
- Use the restricted shell to increase log verbosity and tail the sslmgr log.
- Send format string operators to leak memory addresses and identify stack offsets for controlled buffers.
- Dump arbitrary memory by writing addresses to the stack and using the %s format operator.
- Crash the service to obtain a core dump, then analyse it to find the base address of the sslmgr binary.
- Dump the ELF headers and symbol table to resolve the GOT and PLT offsets for strlen and system, then craft the final exploit.
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.
A format string bug is a programming mistake where user input is treated as a formatting instruction, letting an attacker read or write memory. Here, an attacker could send special characters to a login page and make the server reveal its memory contents, eventually leading to full control of the device.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.