Transfer files
To linux
Python
Transfer files
Using Python, in the folder that contain the file to send on the source machine. E.g. file.txt
#flashcard
python -m http.server 4545
On the destination machine
wget http://IP_SOURCE_MACHINE:4545/file.txt
Netcat
Transfer files
- On the destination machine
nc -lnvp 1234 > file.txt
- On the source machine
nc -nv IP_destination 1234 < file.txt
SSH - SCP
- Secure Copy Protocol
- Transferring Files From Your Host
- MITM
Secure copy, or SCP, is just that -- a means of securely copying files. Unlike the regular cp command, this command allows you to transfer files between two computers using the SSH protocol to provide both authentication and encryption.
Working on a model of SOURCE and DESTINATION, SCP allows you to:
- Copy files & directories from your current system to a remote system
- Copy files & directories from a remote system to your current system
Send a file
Send file1.txt from my machine to the target machine with the name file2.txt
scp file1.txt <target_username>@<target_IP>:/home/ubuntu/file2.txt
Download a file
Get the documents.txt from the target machine to my machine. (To my current directory .
)
scp <target_username>@<target_IP>:/home/ubuntu/documents.txt .
Change the name to notes.txt
scp <target_username>@<target_IP>:/home/ubuntu/documents.txt notes.txt
Examples to get all files from a folder
scp <target_username>@<target_IP>:/home/ubuntu/* .
scp <target_username>@<target_IP>:/home/ubuntu/* ~
To windows
Certutil
- Transfer files to windows from a HTTP server
General use
certutil.exe -urlcache -f http://IP:PORT//file.exe file.exe