Skip to main content
Mallory
CriticalCISA KEVExploited in the wildPublic exploit

Unauthenticated Command Injection in Cacti remote_agent.php

IdentifiersCVE-2022-46169CWE-78· Improper Neutralization of Special…

CVE-2022-46169 is a critical unauthenticated command injection vulnerability in Cacti, affecting versions up to and including 1.2.22. The issue resides in remote_agent.php, which is reachable without authentication. Its authorization logic relies on get_client_addr() in lib/functions.php to determine the client IP address, then uses gethostbyaddr() to resolve that IP to a hostname and checks whether that hostname exists in the poller table. Because get_client_addr() trusts attacker-controlled HTTP_-prefixed server variables, an attacker can spoof the apparent client IP address, for example by supplying a forwarded-for style header containing the target server's own IP. Since Cacti commonly has a default poller entry for the local server hostname, this allows the hostname-based authorization check to be bypassed. After bypassing authorization, the attacker can invoke the polldata action. In the poll_for_data code path, Cacti loads poller_item records based on request parameters. If the selected poller_item has action POLLER_ACTION_SCRIPT_PHP, the application uses proc_open() to execute a PHP script. The attacker-controlled poller_id parameter, obtained via get_nfilter_request_var(), is insufficiently constrained and is concatenated into the command string passed to proc_open(), enabling shell metacharacter injection. As a result, an unauthenticated attacker can execute arbitrary OS commands on the Cacti server.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation results in unauthenticated remote code execution on the server hosting Cacti. An attacker can run arbitrary commands in the security context of the web server or Cacti process, which can lead to full compromise of the application host, malware deployment, persistence, credential theft, lateral movement, data access, and service disruption. The content also notes active in-the-wild exploitation, including use to deploy botnet malware such as MooBot and ShellBot.

Mitigation

If you can’t patch tonight, do this now.

If immediate patching is not possible, restrict or disable external access to remote_agent.php and the Cacti web interface, especially from untrusted networks. Filter or ignore untrusted proxy-related HTTP_ headers so attackers cannot spoof the client IP used by get_client_addr(). Where feasible, place Cacti behind a trusted reverse proxy that rewrites and validates client IP headers, and block direct access. Reduce exposure by limiting internet reachability, monitoring for suspicious requests to remote_agent.php with action=polldata, and reviewing configurations for poller_item entries using POLLER_ACTION_SCRIPT_PHP. These are temporary mitigations and do not replace upgrading.

Remediation

Patch, then assume compromise.

Upgrade Cacti to a fixed release. The vulnerability was addressed in both supported branches, with Cacti 1.2.23 identified as the first patched 1.2.x release; patched 1.3.x releases are also available. Apply the vendor patch that hardens get_client_addr()/authorization handling and removes the command injection path involving unsanitized poller_id input reaching proc_open(). Verify that all internet-exposed instances are updated beyond affected versions.
PUBLIC EXPLOITS

Exploits

12 valid exploits after Mallory filtered fakes, detection scripts, and README-only repos (4 hidden).

VALID 12 / 16 TOTALView more in app
CVE-2022-46169-Cacti-v1.2.22-RCEMaturityPoCVerified exploit

This repository contains a single Python exploit script (CVE-2022-46169.py) targeting Cacti v1.2.22, specifically exploiting CVE-2022-46169. The exploit works by first brute-forcing valid host_id and local_data_id values using multi-threaded HTTP requests to the /remote_agent.php endpoint. Once valid IDs are found, the script crafts a malicious GET request to /remote_agent.php with a specially crafted poller_id parameter that injects an arbitrary command (provided by the user) for execution on the target system. The exploit leverages the 'X-Forwarded-For: 127.0.0.1' header to bypass access controls. The repository also includes a standard .gitignore and a GPLv3 license file. The README is minimal and only states the CVE and Cacti version. The exploit is operational, providing real command execution on vulnerable targets, and is not part of any larger framework.

mind2hexDisclosed Mar 28, 2024pythonnetwork
CVE-2022-46169-Cacti-1.2.22MaturityPoCVerified exploit

This repository contains a Python exploit script (CVE-2022-46169.py) targeting the Cacti network monitoring tool, specifically exploiting CVE-2022-46169. The exploit abuses a command injection vulnerability in the /remote_agent.php endpoint. The script can operate in two modes: direct execution (if host_id and local_data_id are known) or brute-force (testing combinations of host_id and local_data_id). Upon successful exploitation, it delivers a bash reverse shell to the attacker's specified LHOST and LPORT. The repository also includes a README.md with usage instructions and a .gitignore file. The exploit is operational, requiring the attacker to set up a listener and provide the target URL and their own IP/port for the reverse shell. The main fingerprintable endpoint is /remote_agent.php on the target server.

alv-davidDisclosed Jul 2, 2025pythonnetwork
SHELL-POC-CVE-2022-46169MaturityPoCVerified exploit

This repository contains a Bash proof-of-concept exploit for CVE-2022-46169, a remote code execution vulnerability in Cacti. The main script, poc.sh, takes as input the attacker's IP, listening port, and the target Cacti URL. It first checks if the target is vulnerable by probing /cacti/remote_agent.php, then enumerates possible host_id and local_data_ids to find a valid endpoint. Once a suitable endpoint is found, it crafts and URL-encodes a Bash reverse shell payload, which is injected via a crafted HTTP request. If successful, the exploit grants the attacker a reverse shell on the target system. The repository is structured with a README providing usage instructions and a single Bash script implementing the exploit logic. No hardcoded endpoints are present; the target URL is supplied by the user. The exploit is operational and delivers a working payload, but is not part of a larger framework.

RdBBB3Disclosed May 21, 2025bashnetwork
CVE-2022-46169MaturityPoCVerified exploit

This repository contains an exploit for CVE-2022-46169, a critical unauthenticated command injection vulnerability in Cacti (versions prior to 1.2.22). The main exploit logic is implemented in 'main.py', which reads a list of target hosts from a file and attempts to exploit each by sending a crafted HTTP GET request to the '/remote_agent.php' endpoint. The exploit injects an arbitrary command (provided by the user) into the 'poller_id' parameter, leveraging the vulnerability to execute system commands on the target server. The script uses threading to attack multiple hosts in parallel and provides console output indicating whether each host appears vulnerable. The exploit is operational, requiring only a list of targets and a command to execute, and demonstrates real-world impact by achieving remote code execution. No hardcoded IPs or domains are present, but the endpoint '/remote_agent.php' is fingerprintable. The repository is structured simply, with a single Python exploit file, a README, and a license.

SystemVllDisclosed Jan 2, 2023pythonnetwork
CVE-2022-46169MaturityPoCVerified exploit

This repository contains a Python exploit script (CVE-2022-46169.py) targeting Cacti v1.2.22, specifically exploiting an unauthenticated command injection vulnerability (CVE-2022-46169) in the /remote_agent.php endpoint. The script first checks if the target is vulnerable, then brute-forces required host and data IDs, and finally delivers a reverse shell payload to the attacker's specified IP and port using a bash command injection. The exploit is operational and provides remote code execution if successful. The repository also includes a brief README referencing the vulnerability and the original PoC author.

lof1secDisclosed Jan 4, 2025pythonnetwork
CVE-2022-46169_unauth_remote_code_executionMaturityPoCVerified exploit

This repository contains a Python exploit script (exploit.py) targeting CVE-2022-46169, an unauthenticated remote code execution vulnerability in Cacti versions prior to 1.2.23 and 1.3.0. The exploit leverages an authentication bypass (using spoofed HTTP headers such as X-Forwarded-For) and a command injection vulnerability in the 'remote_agent.php' endpoint. The script attempts to enumerate valid host_id and data_id values to trigger the vulnerability, and upon success, injects a base64-encoded bash reverse shell payload via the poller_id parameter. The attacker must provide their own IP and port to receive the shell. The script supports both targeted and aggressive exploitation modes. The repository also includes a README.md describing the exploit and a LICENSE file. The main exploit logic is contained in exploit.py, which is the only code file.

JacobEbbenDisclosed Apr 9, 2023pythonnetwork
CVE-2022-46169MaturityPoCVerified exploit

This repository contains a single Python script (CVE-2022-46169.py) that serves as a proof-of-concept exploit for CVE-2022-46169, an unauthenticated remote code execution vulnerability in Cacti versions up to 1.2.22. The exploit works by sending crafted HTTP GET requests to the /remote_agent.php endpoint of a vulnerable Cacti installation, injecting arbitrary shell commands via the poller_id parameter. The script allows the attacker to specify the target URL, the command to execute (either directly or from a file), and the range of host_id and local_data_id values to try. The X-Forwarded-For header is set to 127.0.0.1 to bypass authentication. The repository also includes a README with usage instructions and a standard GPLv2 license file. The exploit is a functional PoC and does not include advanced payloads or post-exploitation features.

sAsPeCt488Disclosed Jan 5, 2023pythonnetwork
CVE-2022-46169MaturityPoCVerified exploit

This repository contains a Python exploit script (cacti.py) targeting CVE-2022-46169 in Cacti version 1.2.22. The exploit works by interacting with the 'remote_agent.php' endpoint of a vulnerable Cacti installation. It first checks if the target is vulnerable, then brute-forces host and local data IDs to find exploitable parameters. If successful, it delivers a bash reverse shell payload to the attacker's specified IP and port, granting remote code execution. The script requires the attacker to provide the target URL, their own IP, and a listening port. The repository is simple, with only a README and the exploit script, and is focused solely on exploiting this specific vulnerability in Cacti.

ruycr4ftDisclosed May 1, 2023pythonnetwork
CVE-2022-46169MaturityPoCVerified exploit

This repository contains a Python exploit script (cve_2022_46169.py) targeting CVE-2022-46169, an unauthenticated remote code execution vulnerability in Cacti version 1.2.19. The exploit works by bypassing authentication using various X-Forwarded headers, brute-forcing valid host_id and local_data_ids[] parameters, and then performing command injection via the remote_agent.php endpoint. The script can operate in two modes: 'check' (to test for vulnerability) and 'exploit' (to attempt exploitation). The payload is a bash reverse shell, which, if successful, grants the attacker remote shell access to the target. The README.md provides usage instructions and references. The main fingerprintable endpoint is /remote_agent.php on the target Cacti instance. The exploit is operational, requiring some manual configuration (such as setting the attacker's IP and port for the reverse shell).

c3rrberu5Disclosed Jan 13, 2023pythonnetwork
cacti-cve-2022-46169-exploitMaturityPoCVerified exploit

This repository provides a Python proof-of-concept exploit for CVE-2022-46169, targeting Cacti version 1.2.22. The exploit leverages an authentication bypass in the /remote_agent.php endpoint, using a spoofed X-Forwarded-For header to match an entry in the poller table. The script first checks if the target is vulnerable, then brute-forces host_id and local_data_id parameters to find valid values. Once found, it delivers a command injection payload via the 'polldata' action, resulting in remote code execution. The default payload opens a reverse shell to the attacker's machine. The repository consists of a single exploit script (cacti.py) and a README.md with usage instructions and background information. The exploit is operational and requires the attacker to supply their own IP and port for the reverse shell connection.

ariyaadinathaDisclosed Mar 11, 2023pythonnetwork
CVE-2022-46169-CACTI-1.2.22MaturityPoCVerified exploit

This repository contains a Python exploit script (CVE-2022-46169.py) and a README for CVE-2022-46169, a remote code execution vulnerability in Cacti 1.2.22. The exploit targets the '/remote_agent.php' endpoint on the victim server, attempting to bypass authorization and brute-force valid 'host_id' and 'local_data_ids' parameters. Upon success, it injects a payload that opens a reverse shell to the attacker's machine using a bash command. The script requires the attacker to specify the target URL, their own IP (LHOST), and a listening port (LPORT). The README provides usage instructions and an example of a successful reverse shell session. The exploit is operational, providing a working reverse shell if the target is vulnerable and properly configured.

FredBraveDisclosed May 1, 2023pythonnetwork
CVE-2022-46169MaturityPoCVerified exploit

This repository contains a Python exploit script (xplt_fixed.py) targeting Cacti versions 1.2.2x up to 1.2.22, exploiting CVE-2022-46169 for unauthenticated remote command execution (RCE). The exploit works by sending crafted HTTP GET requests to the Cacti server's /remote_agent.php endpoint, injecting a base64-encoded bash reverse shell payload via URL parameters. The attacker must specify the target URL, their own IP and port for the reverse shell, and a value for the X-Forwarded-For header (likely to bypass access controls). The script iterates over possible host_id and local_data_ids values to maximize the chance of successful exploitation. If successful, the attacker receives a reverse shell from the Cacti server. The repository structure is simple, containing only a README and the main exploit script.

icebreackDisclosed Apr 13, 2023pythonnetwork
EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
CactiCactiapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware2

Malware families riding this exploit, with evidence and IOCs.

Detection signatures2

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity

Community discussion across Reddit, Mastodon, and other social sources.