Detecting Drupal installer takeover: 4 Sigma rules for web logs and host files

Detecting Drupal installer takeover: 4 Sigma rules for web logs and host files

Drupal’s installer flaws are a detection engineer’s dream and nightmare at once. The dream: the attack has to go through one URL, /core/install.php, that a finished production site has no business serving. The nightmare: neither Drupal nor the researchers published a single IP address, hash or user agent, and Drupal itself says a compromised site may no longer look vulnerable.

This post is the companion to my analysis of CVE-2026-136716 and the earlier Fail2Install bug. Here you get four Sigma rules built on behaviour, what each one catches, how to tune it, and how to test it safely in a lab.

At a glance

  • Rules: 4 rule files (one of them a Sigma v2 correlation with its own base rule).
  • Domains: Web/App (3) and Linux (1).
  • Log sources: web server access logs with method and full path; host file events from Sysmon for Linux, auditd or an EDR.
  • ATT&CK: T1190 Exploit Public-Facing Application (Initial Access) and T1505.003 Web Shell (Persistence).
  • Status: one rule test (vector confirmed by Drupal), three experimental (built from researcher write-ups and my own reasoning).
  • GitHub: Detection Rules/Web-App and Detection Rules/Linux.

The case in brief

Drupal fixed CVE-2026-132165 (SA-CORE-2026-017) on November 18, 2026, and reported exploitation on live sites from November 19 at 19:00 UTC. A week later, on November 25, it fixed CVE-2026-136716 (SA-CORE-2026-019) for sites in unusual or incomplete installation states that the first fix missed, and said that one is exploited in the wild too. In both cases the attacker uses the installer to reinstall Drupal on a live site and take it over. The full story is in the analysis.

For detection, the steps that matter and where they leave traces are these. The attacker requests the installer, and for Fail2Install, puts pressure on the database or the server so that the “already installed” check fails (Searchlight Cyber’s research). That shows up in access logs. The attacker then most likely submits installer forms (my inference), which are POST requests to the same path. On some setups the attacker can go further: Searchlight describes writing a SQLite database file with a .php name into the web root and running it through a crafted path. The CSA and Hive Security write-ups give that path shape as .php/core/ in the middle. That leaves a file on disk and one more odd line in the access log. The account takeover itself happens inside Drupal and does not reach the web server logs in a useful way.

Detection map

Block diagram: web access logs and Linux host file events feed four Sigma rules (installer POST request, installer request burst correlation, .php/core/ path trick, PHP file in public files) mapped to ATT&CK T1190 and T1505.003, with the user 1 takeover marked as a gap to check by hand.
Two log sources, four rules. The admin takeover itself stays a manual check.

Two log sources feed four rules. The web access log carries three of them: the installer POST, the burst correlation and the .php/core/ path. Host file events carry the fourth, a PHP file appearing under sites/*/files. Together they cover the initial access and the web shell step. The account takeover in the middle is the gap: it lives in Drupal’s own logs and state, so I treat it as a manual check, not a rule.

Rule overview

RuleDomainLog sourceATT&CK (tactic / technique)LevelStatus
Drupal installer POST requestWeb/AppwebserverInitial Access / T1190Hightest
Burst of installer requests from one clientWeb/Appwebserver (correlation)Initial Access / T1190Mediumexperimental
PHP file requested with trailing /core/ pathWeb/AppwebserverPersistence / T1505.003Highexperimental
PHP file created in Drupal public filesLinuxlinux / file_eventPersistence / T1505.003Highexperimental

The rules

Drupal installer POST request

Context: Drupal names the installer as the vector for both exploited bugs. My inference is that a reinstall most likely needs someone to submit installer forms on a site that is already running, with or without a resource flood, so this is the rule with the best signal. It is test rather than experimental because Drupal itself names the installer as the vector.

Condition: alert on any POST request whose path contains /install.php. The contains match also catches /core/install.php/foo style paths, which Drupal’s own hardening guide warns about.

ATT&CK: Initial Access (TA0001) – T1190 Exploit Public-Facing Application.

title: Drupal Installer POST Request - Potential CVE-2026-136716 / CVE-2026-132165 Site Takeover
id: d251aa0a-f5e0-4e6a-85f2-31c59d86e62c
status: test
description: |
    Detects HTTP POST requests to the Drupal installer (install.php). Drupal names the installer as the vector for both
    exploited flaws, SA-CORE-2026-017 and SA-CORE-2026-019. A reinstall most likely requires submitting installer
    forms (inference), which a site that is already installed should never receive.
references:
    - https://www.drupal.org/sa-core-2026-019
    - https://www.drupal.org/sa-core-2026-017
    - https://www.drupal.org/docs/administering-a-drupal-site/security-in-drupal/securing-the-installer-installphp
    - https://netsec101.com/?p=563
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - cve.2026-136716
    - cve.2026-132165
    - detection.emerging-threats
logsource:
    category: webserver
detection:
    selection_path:
        cs-uri-stem|contains:
            - '/core/install.php'
            - '/install.php'
    selection_method:
        cs-method: 'POST'
    condition: all of selection_*
falsepositives:
    - Building a brand new Drupal site or adding a multisite site through the browser installer
    - Staging or development hosts that are reinstalled on purpose (scope the rule to production hosts)
level: high

View on GitHub

False positives and tuning: new site builds and multisite additions done in the browser will fire it. Scope it to production host names, or add a filter for the IP addresses your team installs from. If you have already blocked the installer, you’ll see hits with status 403 or 404. Keep them; they tell you who is probing, and you can lower the level for blocked responses with a filter on sc-status.

How to test: on a lab Drupal site, send any harmless POST to /core/install.php (an empty form body is enough) and check that the access log line matches.

Burst of Drupal installer requests from one client

Context: Searchlight’s Fail2Install technique depends on a database check failing at exactly the right moment. My inference is that real attempts will hit the installer many times in a short window, much more than a scanner checking once. This rule is a Sigma v2 event_count correlation: a low-level base rule matches any installer request, and the correlation fires when one client crosses a threshold.

Condition: alert when one client address sends 30 or more requests to the installer on one host within one minute. The threshold is my starting point, not a value from any source.

ATT&CK: Initial Access (TA0001) – T1190 Exploit Public-Facing Application.

title: Drupal Installer Request From Any Client
id: 75e838b2-152b-43ec-b7a4-413b0331d848
name: web_drupal_installer_request_any
status: experimental
description: |
    Base rule for the burst correlation below: any request to the Drupal installer. Not meant to alert on its own.
references:
    - https://www.drupal.org/sa-core-2026-017
    - https://netsec101.com/?p=563
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - cve.2026-132165
    - detection.threat-hunting
logsource:
    category: webserver
detection:
    selection:
        cs-uri-stem|contains:
            - '/core/install.php'
            - '/install.php'
    condition: selection
falsepositives:
    - Uptime checks or scanners that request install.php
level: low
---
title: Burst Of Drupal Installer Requests From One Client - Potential Fail2Install Attempt
id: 8d2db544-b525-4e65-9bb3-fad5250d6ca7
status: experimental
description: |
    Detects one client sending many requests to the Drupal installer within a minute. The Fail2Install technique
    (CVE-2026-132165) relies on making database checks fail at the right moment, so I expect attempts to repeat the
    installer request many times (inference). The threshold of 30 per minute is my own starting point, not a source value.
references:
    - https://www.slcyber.io/research/fail2install-system-limits-pre-auth-rce-drupal
    - https://www.drupal.org/sa-core-2026-017
    - https://netsec101.com/?p=563
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - cve.2026-132165
    - detection.emerging-threats
correlation:
    type: event_count
    rules:
        - web_drupal_installer_request_any
    group-by:
        - c-ip
        - cs-host
    timespan: 1m
    condition:
        gte: 30
falsepositives:
    - Load tests or security scans aimed at the site
    - Many users behind one NAT or proxy address (group by X-Forwarded-For if your logs keep it)
level: medium

View on GitHub

False positives and tuning: load tests and authorised scans will trip it, and so will many users behind one NAT or proxy address. If your logs keep X-Forwarded-For, group by that instead of c-ip. Remember that CVE-2026-136716 may not need a flood at all, so a quiet result here does not clear a site. The base rule on its own is a decent hunting query for the retro-hunt.

How to test: send 30 plain GET requests to /core/install.php on a lab site from one machine within a minute and check that the correlation fires once your backend supports Sigma correlations.

PHP file requested with trailing /core/ path

Context: Searchlight explains that the stock Drupal .htaccess rule meant to stop PHP files outside core from running was not anchored, so a crafted path slipped past it. The Cloud Security Alliance note and Hive Security give the shape to look for: a .php file followed by an extra /core/<name>.php segment. I am matching the path shape only, not a full request.

Condition: alert on any request whose path contains a .php file followed by /core/ and another .php name.

ATT&CK: Persistence (TA0003) – T1505.003 Web Shell.

title: Drupal PHP File Requested With Trailing /core/ Path - Potential Fail2Install Code Execution
id: aba8fc39-98da-47fa-be7a-8609c0d87300
status: experimental
description: |
    Detects requests where a .php path is followed by an extra /core/<name>.php segment. Searchlight Cyber says a crafted
    path got past the stock Drupal Apache .htaccess rule in the Fail2Install chain (CVE-2026-132165); the CSA and Hive
    Security write-ups list this path shape as an indicator. Built from published research, not from vendor IOCs.
references:
    - https://www.slcyber.io/research/fail2install-system-limits-pre-auth-rce-drupal
    - https://labs.cloudsecurityalliance.org/research/csa-research-note-drupal-fail2install-ai-found-installer-tak/
    - https://hivesecurity.gitlab.io/blog/drupal-cve-2026-136716-installer-takeover/
    - https://www.drupal.org/sa-core-2026-017
    - https://netsec101.com/?p=563
author: netsec101.com
date: 2026-11-28
tags:
    - attack.persistence
    - attack.t1505.003
    - cve.2026-132165
    - detection.emerging-threats
logsource:
    category: webserver
detection:
    selection:
        cs-uri-stem|re: '\.php/core/[^/]*\.php'
    condition: selection
falsepositives:
    - Scanners and vulnerability checks that probe this path pattern (still worth a look on a Drupal host)
level: high

View on GitHub

False positives and tuning: I don’t know of a legitimate Drupal route with this shape, so expect hits from scanners testing for the bug. Check the response code: a 200 for one of these paths deserves an incident ticket, a 404 is a probe. Make sure your log format keeps the full path; some setups split the path info part out.

How to test: request /modules/test.php/core/test.php on a lab site. It will typically return 404, depending on the server, and the log line should match.

PHP file created in Drupal public files directory

Context: Drupal’s public files directory under sites/<site>/files is for uploads and generated assets. The CSA note lists PHP files in the public files directory as an indicator. The exception is my own: from general Drupal knowledge, the default compiled Twig cache lives under files/php/twig, so I filter that path. A new PHP file anywhere else in that tree is most likely a web shell or a database file planted through the installer. This rule outlives the CVE, which is why it carries no emerging-threat tag.

Condition: alert when a file ending in .php is created under a path containing /sites/ and /files/, unless the path contains /files/php/twig/.

ATT&CK: Persistence (TA0003) – T1505.003 Web Shell.

title: PHP File Created In Drupal Public Files Directory
id: 9857fb99-344e-4407-8333-68aadb13f0f1
status: experimental
description: |
    Detects creation of a .php file under a Drupal sites/<site>/files directory. CSA lists PHP files in the public files
    directory as an indicator; excluding files/php/twig (the default compiled Twig cache) is my own tuning. A new PHP
    file there points to a web shell or to a database file planted through the installer (Fail2Install chain).
references:
    - https://labs.cloudsecurityalliance.org/research/csa-research-note-drupal-fail2install-ai-found-installer-tak/
    - https://www.slcyber.io/research/fail2install-system-limits-pre-auth-rce-drupal
    - https://www.drupal.org/sa-core-2026-019
    - https://netsec101.com/?p=563
author: netsec101.com
date: 2026-11-28
tags:
    - attack.persistence
    - attack.t1505.003
    - cve.2026-132165
    - cve.2026-136716
logsource:
    product: linux
    category: file_event
detection:
    selection:
        TargetFilename|contains: '/sites/'
        TargetFilename|endswith: '.php'
    selection_files_dir:
        TargetFilename|contains: '/files/'
    filter_main_twig_cache:
        TargetFilename|contains: '/files/php/twig/'
    condition: all of selection* and not 1 of filter_main_*
falsepositives:
    - Sites that moved the Twig cache or other generated PHP into a custom path under files/ (add that path as a filter)
    - Backup or migration tools that copy PHP files into the files directory
level: high

View on GitHub

False positives and tuning: if you moved the Twig cache or keep other generated PHP under files/, add that path as a filter. Backup and migration tools that copy whole trees can also trip it. The bigger limit is telemetry: file creation events are not collected by default on Linux, so you need Sysmon for Linux, an auditd watch on the files directory, or an EDR. A file written somewhere other than files/ will not match.

How to test: on a lab host with file telemetry on, run touch sites/default/files/test.php and check for an alert, then create a file under sites/default/files/php/twig/ and check that the filter keeps it quiet.

Coverage and gaps

Step in the caseTacticTechniqueRuleCovered?
Reach the installer and flood it (Fail2Install)Initial Access (TA0001)T1190Installer request burstPartly, threshold based
Submit installer forms and reinstallInitial Access (TA0001)T1190Installer POST requestYes
Take over user 1 or create an adminPersistence (TA0003)T1078 Valid AccountsNoneGap: Drupal logs and state, manual check
Write PHP through a SQLite filePersistence (TA0003)T1505.003PHP file in public filesYes, with host file telemetry
Run it through a .php/core/ pathPersistence (TA0003)T1505.003.php/core/ pathYes

What none of these rules can see is the account takeover itself. Drupal’s advice is to check logs for changes to or by user 1, set its email to one you control and consider resetting its password. Do that by hand, along with looking for administrators you don’t recognise. Hive Security also suggests checking the installer state with drush state:get install_task (expect done) and drush state:get install_time (expect the original install time). The CSA note lists database error strings that appear during the resource flood, such as PostgreSQL refusing extra clients or MySQL reporting too many connections. Those are worth a manual search of your database and PHP error logs for the days after November 18, but ordinary overload produces them too, so I did not turn them into a rule.

Deploying the rules

Pull the YAML from the GitHub folders above and convert it with sigma-cli for your SIEM. The web rules use the standard webserver field names (cs-uri-stem, cs-method, c-ip), so you need a pipeline that maps them to your Apache or nginx fields. The Linux rule uses TargetFilename as Sysmon for Linux does. A few examples:

sigma convert -t splunk --without-pipeline web_drupal_installer_post_request.yml
sigma convert -t lucene --without-pipeline web_drupal_php_path_info_core_bypass.yml
sigma convert -t splunk --without-pipeline file_event_lnx_drupal_php_file_in_public_files.yml

--without-pipeline keeps the Sigma field names as they are, so rename them to your own log schema (or write a small pipeline) before the query returns anything. The correlation rule needs a backend that supports Sigma correlations; if yours does not, run the base rule as a scheduled search with a count. Run everything in alert-only mode for a week before it pages anyone, and do a retro-hunt back to November 18, 2026 on day one.

My take

This is one of the more detectable critical bugs I’ve written rules for, and that’s because of where it lives. Every variant has to pass through one URL that a finished site never needs. If I could only deploy one rule, it would be the installer POST, and I’d pair it with the web server block from the analysis so that a hit means “someone tried” rather than “someone got in”.

The weak spot is the part attackers care about most: the takeover of user 1 happens inside Drupal, and default logging does not make it easy to see from outside. I’d like Drupal to log any write to the installer state, and any change to user 1’s email or password, to syslog by default, with a clear event name a SIEM can key on. Until then, the manual checks in the gaps section are not optional.

Sources

One thought on “Detecting Drupal installer takeover: 4 Sigma rules for web logs and host files”

Leave a Reply