# FTP Downloads

**Installing the FTP Server Python3 Module - pyftpdlib**

```shell-session
$ sudo pip3 install pyftpdlib
```

#### Setting up Python3 FTP Server

```shell-session
$ sudo python3 -m pyftpdlib --port 21
```

#### Transfering Files from an FTP Server Using PowerShell

{% code overflow="wrap" %}

```batch
PS C:\htb> (New-Object Net.WebClient).DownloadFile('ftp://192.168.49.128/file.txt', 'ftp-file.txt')
```

{% endcode %}

#### **Create a Command File for the FTP Client and Download the Target File**

```batch
C:\htb> echo open 192.168.49.128 > ftpcommand.txt
C:\htb> echo USER anonymous >> ftpcommand.txt
C:\htb> echo binary >> ftpcommand.txt
C:\htb> echo GET file.txt >> ftpcommand.txt
C:\htb> echo bye >> ftpcommand.txt
C:\htb> ftp -v -n -s:ftpcommand.txt
ftp> open 192.168.49.128
Log in with USER and PASS first.
ftp> USER anonymous

ftp> GET file.txt
ftp> bye

C:\htb>more file.txt
This is a test file
```

\\

#### &#x20;
