Drupal
Drupal supports three types of users by default:
Administrator
: This user has complete control over the Drupal website.Authenticated User
: These users can log in to the website and perform operations such as adding and editing articles based on their permissions.Anonymous
: All website visitors are designated as anonymous. By default, these users are only allowed to read posts.
Discovery/Footprinting
Attacking Drupal
PHP Filter Module
💡
In older versions of Drupal (before version 8), it was possible to log in as an admin and enable the PHP filter
module, which "Allows embedded PHP code/snippets to be evaluated." But from version 8 this module is not installed by default.
Go to Modules -> (Check) PHP Filter -> Save configuration
Then click on Add content -> Select Basic Page or Article -> Write php shellcode on the body -> Select PHP code in Text format -> Select Preview
PHP Filter Module from version 8 onwards
💡
Download the most recent version of the module from the Drupal website.
wget https://ftp.drupal.org/files/projects/php-8.x-1.1.tar.gz
Once downloaded go to
Administration
>Reports
>Available updates
./admin/reports/updates/install
Click on **
Browse**,
select the file from the directory we downloaded it to, and then clickInstall
.Once the module is installed, we can click on
Content
and create a new basic page, similar to how we did in the Drupal 7 example. Again, be sure to selectPHP code
from theText format
dropdown./admin/content
Uploading a Backdoored Module
💡
In current versions it's no longer possible to install plugins by only having access to the web after the default installation.
Download the archive and extract its contents.
Create a PHP web shell with the contents
Create a .htaccess
file to give ourselves access to the folder. This is necessary as Drupal denies direct access to the /modules
folder.
The configuration above will apply rules for the / folder when we request a file in /modules. Copy both of these files to the captcha folder and create an archive.
Click on Manage
and then Extend
click on the + Install new module
button
Leveraging Known Vulnerabilities
Drupalgeddon
https://www.exploit-db.com/exploits/34992
Drupalgeddon2
https://www.exploit-db.com/exploits/44448
Drupalgeddon3
https://github.com/rithchard/Drupalgeddon3
https://github.com/oways/SA-CORE-2018-004/blob/master/drupalgeddon3.py
Last updated