Detecting Cacti 4HTTP2SHELL: 4 Sigma rules for web logs, the poller and the web root

Detecting Cacti 4HTTP2SHELL: 4 Sigma rules for web logs, the poller and the web root

An unpatched bug with a public proof of concept and no CVE is the worst kind of week for a detection team: no vendor signature, no scanner plugin, nothing in the threat feeds. That is where Cacti users are with 4HTTP2SHELL, the four-request chain that turns an enabled guest account on Cacti 1.2.31 into command execution. Cacti merged matching fixes into its source branches on November 28, but no release carries them yet. I covered the bug, who is exposed and what to switch off in my analysis of the zero-day.

This post is the detection side. I found no published IOCs or request samples in the sources I read, so these four rules are built from the behaviour that watchTowr and RavenAI describe, plus my own reasoning where I say so. They are all experimental. Treat them as starting points to tune, not as alerts to page someone on at 3 a.m.

At a glance

  • Rules: 4 (one Sigma v2 correlation with three base rules, two host rules, one hunting rule).
  • Domains: Web/App and Linux.
  • Log sources: web server access logs with query strings, the PHP or web server error log and the Cacti log, Linux process creation and file creation (Sysmon for Linux, auditd or EDR).
  • ATT&CK: T1190, T1059.004, T1105, T1505.003.
  • Status: experimental. No CVE tag, because there is no CVE.
  • GitHub: Detection Rules/Linux and Detection Rules/Web-App.

The case in brief

The chain needs Cacti’s guest account to be enabled, which is not the default. According to RavenAI’s breakdown, the guest saves a text value into preview_graphs_per_page through auth_profile.php, a display setting that should be a number. A graph_view.php preview request then concatenates that stored value into a SQL LIMIT clause, and a stacked statement rewrites the arg1 command of a poller_item row. Finally a guest-reachable realtime graph request runs the poller path, which executes the command as the Cacti web and poller account. watchTowr adds that a warning about a non-numeric value may be logged along the way (RavenAI calls it a PHP warning), and lists new files created by the poller process as a pivot. The full story is in the analysis.

So the traces land in four places: the web access log (the request order), the PHP error log or Cacti log (the warning), the database (the rewritten poller command) and the host (whatever that command starts, and any files it writes). Sigma covers three of them. The database is the gap.

Detection map

Block diagram: web access logs, the PHP or Cacti log and Linux host process and file events feed four Sigma rules (request-order correlation, non-numeric warning hunt, suspicious poller child, PHP written in the Cacti tree) mapped to ATT&CK T1190, T1059.004 with T1105, and T1505.003, with the poller_item database rewrite marked as a gap.
Three log sources, four rules. The SQL rewrite of the poller command stays a database check.

Read it left to right. Web logs feed the correlation rule, which watches for the request order. The PHP error log or Cacti log feeds a keyword hunt. Host telemetry feeds the two rules I trust most: a suspicious child process under PHP, the web server or the spine poller, and a PHP file written into the Cacti tree by one of those processes. On the right, the red dashed box is the part none of the rules can see: the SQL write into poller_item. You close that with a scheduled database query, not a SIEM rule.

Rule overview

RuleDomainLog sourceATT&CK (tactic / technique)LevelStatus
Suspicious command spawned by Cacti web server or pollerLinuxlinux / process_creationExecution / T1059.004, C2 / T1105HighExperimental
Profile update, then preview, then realtime graph (correlation)Web/AppwebserverInitial Access / T1190MediumExperimental
PHP file written in Cacti web root by a web processLinuxlinux / file_eventPersistence / T1505.003MediumExperimental
Non-numeric value warning in the PHP or Cacti log (hunting)Web/Appcacti / application (PHP or Cacti log)Initial Access / T1190LowExperimental

The rules

Suspicious command spawned by Cacti web server or poller

Context: the last step of the chain is the poller running a command an anonymous guest chose. Whatever the attacker does next (download a tool, open a reverse shell, check who they are) starts as a process under PHP, Apache or spine. This is the rule I would turn on first, because it does not depend on how the command got into the poller.

Condition: alert when PHP, Apache/httpd or spine starts a shell whose command line contains curl, wget, a /dev/tcp redirect, base64, whoami, netcat, socat, chmod +x or an inline Python one-liner, or starts one of those tools directly. The lineage is my inference: I assume Cacti hands the stored command to a shell, so I match both the shell and the direct case.

ATT&CK: Execution (TA0002) – T1059.004 Unix Shell; Command and Control (TA0011) – T1105 Ingress Tool Transfer.

title: Suspicious Command Spawned by Cacti Web Server or Poller - Possible 4HTTP2SHELL Exploitation
id: 60c2cf77-4095-4bbf-9a3d-fd67b80c2a27
status: experimental
description: |
    Detects a shell running download, reverse-shell, discovery or encoding commands, or such a tool started directly,
    under the PHP, web server or spine poller processes on a Linux Cacti host. The 4HTTP2SHELL chain rewrites a
    poller command that a realtime graph request then executes as the Cacti service account (inferred process lineage).
references:
    - https://watchtowr.com/intelligence/4http2root-cacti-zero-day-faq/
    - https://ravenai.sh/blog/four-requests-to-shell-cacti
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.execution
    - attack.t1059.004
    - attack.command-and-control
    - attack.t1105
    - detection.emerging-threats
logsource:
    product: linux
    category: process_creation
detection:
    selection_parent:
        - ParentImage|contains: '/php'
        - ParentImage|endswith:
              - '/apache2'
              - '/httpd'
              - '/spine'
    selection_shell:
        Image|endswith:
            - '/sh'
            - '/bash'
            - '/dash'
    selection_shell_payload:
        CommandLine|contains:
            - 'curl '
            - 'wget '
            - '/dev/tcp/'
            - 'base64'
            - 'whoami'
            - 'nc -'
            - 'ncat '
            - 'socat '
            - 'chmod +x'
            - 'python -c'
            - 'python3 -c'
    selection_direct_tool:
        Image|endswith:
            - '/curl'
            - '/wget'
            - '/nc'
            - '/ncat'
            - '/netcat'
            - '/socat'
            - '/whoami'
            - '/base64'
    condition: selection_parent and ((selection_shell and selection_shell_payload) or selection_direct_tool)
falsepositives:
    - Custom Cacti data input scripts that call curl or wget to poll HTTP APIs (scope by the script path and add a filter)
    - Other PHP applications on the same host; scope the rule to Cacti servers
level: high

View on GitHub

False positives and tuning: custom data input scripts that poll HTTP APIs with curl are the obvious one. Add a filter on their script path rather than dropping curl from the list. Scope the rule to hosts tagged as Cacti servers, because on a general PHP web server it will be noisier.

How to test: on a lab Cacti host, run a harmless command through PHP as the web user, for example sudo -u www-data php -r 'system("whoami");'. That produces PHP starting a shell that runs whoami, the same lineage the rule looks for.

Profile update, then preview, then realtime graph from one client

Context: RavenAI describes the chain’s footprint as a guest profile update followed by graph preview and realtime graph initialisation requests. Each request on its own is normal Cacti use. The order, from one client in a short window, is what stands out.

Condition: three informational base rules match auth_profile.php with action=update_data, graph_view.php with action=preview, and graph_realtime.php. A Sigma v2 temporal_ordered correlation fires when the same client IP hits all three in that order within 10 minutes. The action=update_data string comes from InfoSec Monkey’s hunting grep; action=preview is the standard Cacti preview URL and my assumption. Access logs do not show request bodies, so the rule cannot see the injected value itself.

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

title: Cacti Profile Update Request
id: 79a15d1d-b432-48fb-8b57-83e92d9f520c
name: cacti_profile_update_request
status: experimental
description: |
    Base rule for the 4HTTP2SHELL sequence correlation. Matches a request to the Cacti user profile update action,
    the step where the chain stores a value in a per-user display setting.
references:
    - https://ravenai.sh/blog/four-requests-to-shell-cacti
    - https://infosecmonkey.com/cacti-4http2shell-zero-day/
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - detection.emerging-threats
logsource:
    category: webserver
detection:
    selection:
        cs-uri-stem|endswith: '/auth_profile.php'
        cs-uri-query|contains: 'action=update_data'
    condition: selection
falsepositives:
    - Users changing their own profile settings (expected; this base rule is not meant to alert on its own)
level: informational
---
title: Cacti Graph Preview Request
id: d3eb6803-9216-45a4-98d5-c877fc4f3a35
name: cacti_graph_preview_request
status: experimental
description: |
    Base rule for the 4HTTP2SHELL sequence correlation. Matches the graph_view.php preview action, which reads the
    stored page-size preference back into a SQL query.
references:
    - https://ravenai.sh/blog/four-requests-to-shell-cacti
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - detection.emerging-threats
logsource:
    category: webserver
detection:
    selection:
        cs-uri-stem|endswith: '/graph_view.php'
        cs-uri-query|contains: 'action=preview'
    condition: selection
falsepositives:
    - Normal graph browsing in preview mode (expected; this base rule is not meant to alert on its own)
level: informational
---
title: Cacti Realtime Graph Request
id: 7d465808-b5cb-44ec-be1f-89fbedd54bb0
name: cacti_realtime_graph_request
status: experimental
description: |
    Base rule for the 4HTTP2SHELL sequence correlation. Matches a request to graph_realtime.php, the page that
    triggers the realtime poller path where the rewritten command runs.
references:
    - https://ravenai.sh/blog/four-requests-to-shell-cacti
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - detection.emerging-threats
logsource:
    category: webserver
detection:
    selection:
        cs-uri-stem|endswith: '/graph_realtime.php'
    condition: selection
falsepositives:
    - Users opening realtime graphs (expected; this base rule is not meant to alert on its own)
level: informational
---
title: Cacti Profile Update Followed by Graph Preview and Realtime Graph - Possible 4HTTP2SHELL Chain
id: efe4f9f7-cadc-41a8-b8f0-d7fd9ad6127f
status: experimental
description: |
    Detects one client sending a Cacti profile update, then a graph_view.php preview, then a graph_realtime.php
    request within ten minutes, the request order RavenAI describes for the 4HTTP2SHELL guest-to-shell chain.
    Inferred from published analyses; I found no published request samples in the sources I read.
references:
    - https://ravenai.sh/blog/four-requests-to-shell-cacti
    - https://watchtowr.com/intelligence/4http2root-cacti-zero-day-faq/
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - detection.emerging-threats
correlation:
    type: temporal_ordered
    rules:
        - cacti_profile_update_request
        - cacti_graph_preview_request
        - cacti_realtime_graph_request
    group-by:
        - c-ip
    timespan: 10m
falsepositives:
    - A logged-in user who changes the preview page size and then opens a realtime graph; check whether the client is a known admin or NOC address
level: medium

View on GitHub

False positives and tuning: a logged-in admin who changes the preview page size and then opens a realtime graph will trigger it. Exclude your NOC and admin subnets, or better, enrich with the session user if your web server logs it and alert only when it is the guest. If guest is off on all your servers, this rule should be silent; any hit is worth a look.

How to test: on a lab install, log in, change the graphs-per-page preference, open preview mode, then open a realtime graph, all within a few minutes.

PHP file written in the Cacti web root by a web process

Context: watchTowr lists new files created by the poller process as a detection pivot, and RavenAI mentions an unexpected web shell or marker file. Once an attacker can run commands as the web user, dropping a PHP file in the Cacti tree is the cheapest way to keep access after you turn guest off.

Condition: alert when a file ending in .php is created under a path containing /cacti/, and the writing process is PHP, Apache/httpd, spine or a shell. Legitimate Cacti code arrives through the package manager or an admin’s deployment, not through those processes.

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

title: PHP File Written in Cacti Web Root by Web Server or Shell Process
id: 23d1ea44-9240-49d3-9768-00be868c537d
status: experimental
description: |
    Detects a .php file created under a Cacti installation path by PHP, the web server, the spine poller or a shell.
    watchTowr lists new files created by the poller process, and RavenAI an unexpected web shell or marker file, as pivots
    after 4HTTP2SHELL exploitation. Legitimate Cacti code is written by the package manager or an admin, not by these processes.
references:
    - https://watchtowr.com/intelligence/4http2root-cacti-zero-day-faq/
    - https://ravenai.sh/blog/four-requests-to-shell-cacti
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.persistence
    - attack.t1505.003
    - detection.emerging-threats
logsource:
    product: linux
    category: file_event
detection:
    selection_path:
        TargetFilename|contains: '/cacti/'
        TargetFilename|endswith: '.php'
    selection_writer:
        - Image|contains: '/php'
        - Image|endswith:
              - '/apache2'
              - '/httpd'
              - '/spine'
              - '/sh'
              - '/bash'
              - '/dash'
    condition: all of selection_*
falsepositives:
    - Cacti plugin installs or upgrades done through the web UI (match the time against change records)
    - Installs where Cacti lives outside a path containing /cacti/ will not match; adjust the path
level: medium

View on GitHub

False positives and tuning: plugin installs through the web UI write PHP as the web user, so match hits against change records. If Cacti lives in a path without /cacti/ in it, change the path. A shell writing the file is in the list on purpose: an attacker’s echo into a file comes from sh, not PHP.

How to test: as the web user, have PHP write a harmless file into the Cacti directory, check for the alert, then delete the file.

Non-numeric value warning in the PHP or Cacti log

Context: watchTowr and BleepingComputer both say a warning about a non-numeric value in a graph display setting may be logged when the chain runs, while the request itself succeeds. RavenAI describes it as a PHP warning. Depending on your setup it lands in the PHP or web server error log, or in Cacti’s own log, so forward both.

Condition: match the keyword non-numeric in the forwarded PHP error log or Cacti log. I could not find the exact message text in the sources, so I kept it to the keyword. That makes it a hunting rule, not an alert.

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

title: Non-Numeric Value Warning on a Cacti Host - 4HTTP2SHELL Hunting
id: af338bec-2440-4abd-8619-e984ec9031de
status: experimental
description: |
    Hunts for warnings about non-numeric values on a Cacti host. watchTowr notes a warning about a non-numeric value in a
    graph display setting may be logged when the 4HTTP2SHELL chain runs, while the request still succeeds; RavenAI calls it
    a PHP warning. Where it lands (PHP or web server error log, or the Cacti log) depends on the setup. The exact text is
    not published, so this matches the keyword only and needs review.
references:
    - https://watchtowr.com/intelligence/4http2root-cacti-zero-day-faq/
    - https://www.bleepingcomputer.com/news/security/unpatched-cacti-zero-day-with-public-poc-gives-remote-code-execution/
    - https://netsec101.com/?p=584
author: netsec101.com
date: 2026-11-28
tags:
    - attack.initial-access
    - attack.t1190
    - detection.threat-hunting
logsource:
    product: cacti
    service: application
    definition: 'Requirement: forward the PHP or web server error log and the Cacti log from the Cacti host to the SIEM (locations vary by install).'
detection:
    keywords:
        - 'non-numeric'
    condition: keywords
falsepositives:
    - PHP warnings from unrelated code paths or plugins with sloppy numeric handling
level: low

View on GitHub

False positives and tuning: any plugin with sloppy number handling can produce the same PHP warning. Once you see a real hit, copy the exact message into the rule and raise its level.

How to test: append a line containing “non-numeric” to the forwarded log in a lab and confirm it reaches the SIEM and matches.

Coverage and gaps

Step in caseTacticTechniqueRuleCovered?
Guest profile write, preview, realtime requestsInitial Access (TA0001)T1190Correlation rule, PHP or Cacti log huntYes (inferred URIs)
Stacked SQL rewrites poller_item.arg1Initial Access (TA0001)T1190NoneGap: database only
Poller runs the attacker commandExecution (TA0002)T1059.004Suspicious poller childYes, with process telemetry
Tool downloadCommand and Control (TA0011)T1105Suspicious poller childPartial
Web shell or file dropPersistence (TA0003)T1505.003PHP written in Cacti treeYes, with file telemetry
Follow-on actions (reading credentials, pivoting to devices)Variousn/aNoneGap: not described by sources

The biggest blind spot is the SQL write. Most teams do not audit the Cacti database, and a rewritten poller_item row looks like any other config change. I would close it with a scheduled read-only query: alert when a preview_graphs_per_page value in settings_user is not a plain number, and diff poller_item.arg1 against yesterday’s copy. The analysis post has the queries. The second gap is everything after the first command. Cacti servers hold SNMP credentials (the poller_item table itself has SNMP community and password columns) and can usually reach most network devices, so if the host rule fires, assume the attacker read the config and check your devices’ logs for logins from the Cacti server.

Deploying the rules

Grab the YAML from GitHub and convert it with sigma-cli for your SIEM. The Linux rules need a pipeline that maps Sysmon for Linux or your EDR’s field names; the web rules need your access log fields mapped to cs-uri-stem, cs-uri-query and c-ip. Correlation rules need a backend that supports Sigma v2 correlations (check yours); otherwise build the sequence as a saved search by hand. For example:

sigma list pipelines
sigma convert -t splunk --without-pipeline proc_creation_lnx_cacti_web_poller_suspicious_child.yml
sigma convert -t lucene --without-pipeline file_event_lnx_cacti_webroot_php_written_by_web_process.yml
sigma convert -t splunk --without-pipeline web_cacti_guest_profile_preview_realtime_sequence_correlation.yml

The --without-pipeline output keeps the Sigma field names, so rename them to your own schema, or swap in a pipeline from sigma list pipelines that matches your log source; pipeline names change between sigma-cli plugin versions. Run everything in alert-only mode for a week before it pages anyone, and tune the process rule’s filters with what your own data input scripts actually run.

My take

Honestly, the best detection for this bug is not a rule. It is setting Guest User to No User and taking the web UI off the internet, which closes the chain completely. Everything in this post is for the case where you cannot do that today, or where guest was on before you read about this and you need to know if someone got in.

Of the four, the process rule is the one worth keeping forever. Cacti has had four guest-reachable or unauthenticated paths published this year, and most of the impact flows through a poller that runs commands from a database table. Watching what that poller starts catches this chain and the next one. What I would really like is for Cacti to log changes to poller_item and to guest profile settings by default, with the user and source IP. That single log line would turn the biggest gap in this post into the easiest alert.

Sources

One thought on “Detecting Cacti 4HTTP2SHELL: 4 Sigma rules for web logs, the poller and the web root”

Leave a Reply