Skip to content

Drupal โ€‹

Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)!

Other ways to support HackTricks:

โ›“๏ธ External Link

Discovery โ€‹

  • Check meta
bash
curl https://www.drupal.org/ | grep 'content="Drupal'
  • Node: Drupal indexes its content using nodes. A node can hold anything such as a blog post, poll, article, etc. The page URIs are usually of the form /node/<nodeid>.
bash
curl drupal-site.com/node/1

Enumeration โ€‹

Drupal supports three types of users by default:

  1. Administrator: This user has complete control over the Drupal website.
  2. Authenticated User: These users can log in to the website and perform operations such as adding and editing articles based on their permissions.
  3. Anonymous: All website visitors are designated as anonymous. By default, these users are only allowed to read posts.

Version โ€‹

  • Check /CHANGELOG.txt
bash
curl -s http://drupal-site.local/CHANGELOG.txt | grep -m2 ""

Drupal 7.57, 2018-02-21

โ„น๏ธ

Newer installs of Drupal by default block access to the CHANGELOG.txt and README.txt files.

Username enumeration โ€‹

Register โ€‹

In /user/register just try to create a username and if the name is already taken it will be notified:

Request new password โ€‹

If you request a new password for an existing username:

If you request a new password for a non-existent username:

Get number of users โ€‹

Accessing /user/<number> you can see the number of existing users, in this case is 2 as /users/3 returns a not found error:

Hidden pages โ€‹

Fuzz /node/$ where $ is a number (from 1 to 500 for example).
You could find hidden pages (test, dev) which are not referenced by the search engines.

Installed modules info โ€‹

bash
#From https://twitter.com/intigriti/status/1439192489093644292/photo/1
#Get info on installed modules
curl https://example.com/config/sync/core.extension.yml
curl https://example.com/core/core.services.yml

# Download content from files exposed in the previous step
curl https://example.com/config/sync/swiftmailer.transport.yml

Automatic โ€‹

bash
droopescan scan drupal -u http://drupal-site.local

RCE โ€‹

If you have access to the Drupal web console check these options to get RCE:

Post Exploitation โ€‹

Read settings.php โ€‹

find / -name settings.php -exec grep "drupal_hash_salt\|'database'\|'username'\|'password'\|'host'\|'port'\|'driver'\|'prefix'" {} \; 2>/dev/null

Dump users from DB โ€‹

mysql -u drupaluser --password='2r9u8hu23t532erew' -e 'use drupal; select * from users'

References โ€‹

โ›“๏ธ External Link
Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)!

Other ways to support HackTricks: