repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
overview.mdMarkdown118 lines4.5 KiBsource raw download

title: "Drupal" section: "Network Services" sectionSlug: "network-services-pentesting" sourcePath: "src/network-services-pentesting/pentesting-web/drupal/README.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/network-services-pentesting/pentesting-web/drupal/README.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: true modified: true license: "CC-BY-NC-4.0"#

Drupal#

Discovery#

curl https://www.drupal.org/ | grep 'content="Drupal'
curl drupal-site.com/node/1

Enumeration#

Version#

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

Drupal 7.57, 2018-02-21

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

Username enumeration#

Drupal installs define the following broad roles by default; permissions and any additional roles are site-configurable:[3]

  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.

To enumerate users you can:

Hidden pages#

Just find new pages by looking into /node/FUZZ where FUZZ is a number (from 1 to 1000 for example).

Installed modules info#

Exposed configuration-synchronization files may reveal enabled modules and service settings.[5]

# Technique shared by Intigriti; see reference 5
#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 Tools#

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

droopescan fingerprints CMS versions, plug-ins, and themes; validate its findings manually because content filtering and customized paths can cause false results.[4]

RCE#

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

Drupal Rce

From XSS to 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#