> For the complete documentation index, see [llms.txt](https://ivalexev.gitbook.io/rednote/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ivalexev.gitbook.io/rednote/utility/service/ftp-21.md).

# FTP (21)

<details>

<summary>Protocol Information</summary>

FTP is a network protocol used to transfer files between a client and a server on a network. It allows files to be uploaded, downloaded and managed remotely, facilitating the transfer of data between connected devices.

</details>

## Port

<table data-header-hidden><thead><tr><th width="166">Port</th><th>Description</th></tr></thead><tbody><tr><td><mark style="color:green;"><strong>21</strong></mark><strong> TCP</strong></td><td>FTP</td></tr><tr><td><mark style="color:green;"><strong>20</strong></mark><strong> TCP</strong></td><td>FTP-data</td></tr></tbody></table>

## Config File

* `/etc/vsftpd.conf`

## FTP root

* `/var/ftp`

## Interact

If **anonymous access** is enabled, it's possible log in with username `“Anonymous”` and password `“”`.

{% code overflow="wrap" %}

```bash
ftp <IP> <PORT>
> [passive] [binary]
> mget *
```

{% endcode %}

{% code overflow="wrap" %}

```bash
wget -m ftp://<USER>:<PASSWORD>@<IP>:<PORT>
```

{% endcode %}

## Attacks

### FTP Bounce

An FTP bounce attack is a network attack that uses an FTP server to send outbound traffic to another device on the network. Suppose we targeted an FTP server FTP\_DMZ exposed to the Internet. Another device within the same network, Internal\_DMZ, is not exposed to the Internet. We can use the connection to the FTP\_DMZ server to scan Internal\_DMZ via the FTP Bounce attack and obtain information about the server's open ports.

{% code overflow="wrap" %}

```bash
nmap -Pn -v -n -p80 -b Anonymous:@10.10.110.213 172.17.0.2
# Scan internal host 172.17.0.2 via FTP of host 10.10.110.213
```

{% endcode %}

### [Backdoor in vsFTPd 2.3.4](https://www.exploit-db.com/exploits/49757)


---

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

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

```
GET https://ivalexev.gitbook.io/rednote/utility/service/ftp-21.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
