File Transfer
Powershell
Download file
For this example, first start a web service on the server side. To do so, run the following command in the directory containing the file(s) to be downloaded:
With writing on disk
Without saving on disk
Upload file
First, start a PHP web server (apache or nginx) on the attacker machine. Then, create an upload.php file on this web server:
Do not forger to create a specific repository for uploaded files:
Finally, on the Windows host from which you want to upload a file, invoke the upload file method:
Powercat
Powercat is a powershell function which can be useful to establish remote shell, to generate payloads, to create network relays, or to transfer files. First, load the function before you can execute it.
If the machine has access to the Internet, you can download and load Powercat as follows:
Send local file
Receive remote file
FTP
For both of the following examples, an FTP server has to be start on the attacker machine.
Download file
From a Windows command prompt, execute the following instructions:
The previous operation can also be done with a one liner command:
Upload file
To upload a file via FTP, the procedure is similar to that presented for downloading. Instead of using the GET command, simply replace it with the PUT command with the path of the local file to be uploaded.
SMB Share (via Impacket)
On the attacker machine, start an SMB server. It can be done via Impacket as follows:
Then, on the remote host, mount this network share and copy local files on this share.
Last updated