> 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/magento-cms-exploitation.md).

# Magento

{% hint style="info" %}
**Magento** 是一个开源电子商务平台，用于构建定制在线商店。它支持商品、订单和支付管理，并且通常通过模块和主题进行扩展。
{% endhint %}

## Magento 网站扫描器（magescan）

下载 [magescan（magescan.phar）](https://github.com/steverobbins/magescan/releases).

```bash
php magescan.phar scan:all http://site-web.com
```

## 用于窃取会话 Cookie 的 SQL 注入示例

* 使用 `wget` 用于下载原始内容 [Python 脚本](https://github.com/ambionics/magento-exploits/blob/master/magento-sqli.py) 来 **Cookie 劫持**.

1. 实际使用示例：

```bash
python3 magento-sqli.py http://localhost:8080/
```

<figure><img src="/files/963080bfe23f7f4c85fbd9f1f4005653d59798d2" alt=""><figcaption></figcaption></figure>

2. 通过 [Cookie 编辑器](https://chrome.google.com/webstore/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) 扩展，将当前 Cookie 替换为管理员 Cookie：

<figure><img src="/files/312c6467eaee78c76cb87a65d12d922378c2ae00" alt=""><figcaption></figcaption></figure>

3. 已被入侵 :)

<figure><img src="/files/394446ddf8cf4c94e77e402b0707738750cc55c6" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
