Windows Uploads
Windows Uploads Using Windows Scripting Languages
In certain scenarios, we may need to exfiltrate data from a target network using a Windows client.
If outbound HTTP traffic is allowed we can create the following PHP script and save it as upload.php in our Kali webroot directory, /var/www/html:
Next, we must create the uploads folder and modify its permissions, granting the www-data user ownership and subsequent write permissions:
With Apache and the PHP script ready to receive our file, we move to the compromised Windows host and invoke the UploadFile method from the System.Net.WebClient class to upload the document we want to exfiltrate, in this case, a file named important.docx:
Uploading Files with TFTP
We first need to install and configure a TFTP server in Kali and create a directory to store and serve files. Next, we update the ownership of the directory so we can write files to it. We will run atftpd as a daemon on UDP port 69 and direct it to use the newly created /tftp directory:
The final command is similar to the one shown below:
Last updated