
A Rust implementation of the CVE-2018-7600 exploit targeting vulnerable Drupal 7 installations (<= 7.57)
A Rust implementation of the CVE-2018-7600 exploit targeting vulnerable Drupal 7 installations (<= 7.57). This CLI reproduces this following PoC flow: it poisons a cached renderable form via the user/password path, extracts a form_build_id, then triggers the cached payload through the file/ajax endpoint to achieve remote code execution via a PHP function invocation.
CVE-2018-7600 is a remote code execution vulnerability affecting Drupal 7 (and Drupal 8 in a different context). In Drupal 7 the issue stems from insufficient sanitization when certain renderable arrays are cached and later rendered. By injecting specially crafted render metadata into an endpoint that is cached, an attacker can cause arbitrary PHP functions to run when the cached data is later rendered or requested.
#post_render callback is an arbitrary PHP function (for example passthru).?q=user/password with the crafted renderable array parameters so Drupal caches the poisoned form.form_build_id, the PoC triggers the payload by calling /file/ajax/name/#value/<form_build_id> with the form_build_id in the POST body. When Drupal renders the cached element, the #post_render callback executes with attacker-controlled markup, enabling command execution.This Rust CLI constructs performs the two-step sequence (poison then trigger) against a target Drupal 7 site request parameters, parses the HTML response for form_build_id, and then triggers the file/ajax endpoint to execute the function specified by the attacker.
Because the client disables certificate verification (to mirror the original PoC which passed verify=False), the tool will work against targets using self-signed or otherwise invalid TLS certs. This behaviour can be changed in the source if you prefer to require valid certificates.
Basic usage (default command is whoami, default function is passthru):
cargo run -- -u http://target.com/
Run a custom command and function:
cargo run -- -u http://target.com/ -c "whoami" -f "passthru"
Use an HTTP/S proxy (format: http://127.0.0.1:8080/):
cargo run -- -u http://target.com/ -p http://127.0.0.1:8080/
CLI options summary:
-u, target: URL of the target Drupal site (e.g. http://target.com/).-c, --command: Command to execute on target (default: whoami).-f, --function: PHP function to use as the attack vector (default: passthru).-p, --proxy: Optional proxy URL to route requests through.Example full flow:
user/password form, inserting #post_render callback and #markup containing the command.form_build_id inside form#user-pass.?q=file/ajax/name/#value/<form_build_id> with the form_build_id to trigger rendering and execute the command.This tool is for educational and authorized penetration testing purposes only. Use responsibly and only on systems you own or have explicit permission to.