Transferring Files to and from Windows
Getting tools onto a Windows target and loot off it are constant tasks throughout an engagement. The right method depends on what is available on the target, what outbound connections are allowed, and how much noise you can tolerate. This page covers every practical transfer method from fastest to most restricted.
HTTP — pulling files from your attack box
The fastest and most reliable method when the target has outbound HTTP access. Serve files from your attack box with a Python server, then pull them down with whatever client is available on the target.
SMB — direct share access
When the target has outbound SMB access (port 445), serve an SMB share from your attack box and access it directly. No file copy needed — you can run binaries directly from the share, which avoids writing to disk.
FTP
FTP is available on most Windows systems and is useful when HTTP or SMB is blocked. The built-in FTP client is old and limited, but reliable for basic transfers.
Base64 encode and decode
When all network protocols are blocked or you only have a command shell with no direct transfer capabilities, base64 encode the file, paste the string through the shell, and decode it on the target. Works in any shell including restricted ones.
Uploading files back to attack box
Getting loot off the target uses the same channels in reverse. The simplest approach is writing to an SMB share. When that is not available, use a PowerShell HTTP POST or nc.
For moving files between hosts during lateral movement rather than back to your attack box see PsExec and SMB Lateral Movement. For exfiltrating data out of the network environment entirely see Windows Exfiltration over HTTP and HTTPS.
Was this helpful?
Your feedback helps improve this page.