07 — CROSS-PLATFORM REFERENCE
FILE TRANSFER CHEAT SHEET
From shell to shell, one command at a time. A practical reference for moving files between Linux and Windows during authorized penetration tests, red-team exercises, and isolated lab work. Replace the example addresses, usernames, paths, and filenames with values from your own environment.
Use only on systems you own or are explicitly authorized to assess. Temporary HTTP, SMB, FTP, and Netcat listeners can expose files or accept untrusted input. Bind services to a lab interface where possible, restrict firewall access, avoid sensitive data, and stop the listener when finished. FTP, TFTP, and raw Netcat transfers do not provide transport encryption.
Set your lab values
Examples below use a Linux transfer host at 192.0.2.10 (documentation-only address) and a sample file named evidence.txt. Substitute your actual reachable lab IP.
Linux — find an address
ip -br addr
ip routeWindows — find an address
ipconfigConfirm routing and firewall rules first. A server listening on 0.0.0.0 may be reachable on every interface, not just your lab interface.
HTTP file transfer
Use a temporary HTTP server to make files available for download. Run it from the directory containing only the files you intend to share.
Linux — start a Python HTTP server
cd /path/to/share
python3 -m http.server 8000 --bind 192.0.2.10Download from Windows PowerShell:
Invoke-WebRequest -Uri "http://192.0.2.10:8000/evidence.txt" -OutFile ".\evidence.txt"Or use curl on Windows or Linux:
curl -fL "http://192.0.2.10:8000/evidence.txt" -o evidence.txtOn Windows, curl.exe explicitly selects the curl binary in case PowerShell aliases differ. PowerShell's wget may be an alias for Invoke-WebRequest, so use -OutFile to save the response.
Windows built-in certutil (download)
certutil.exe -urlcache -split -f "http://192.0.2.10:8000/evidence.txt" evidence.txtVerify the result
# Linux
sha256sum evidence.txt
# Windows PowerShell
Get-FileHash .\evidence.txt -Algorithm SHA256A Python HTTP server is a simple download server, not an upload service. Do not expose its directory to untrusted networks.
SMB file transfer
SMB is useful on a trusted lab network. Share a dedicated staging directory rather than your home directory, and use authentication or firewall restrictions when appropriate.
Linux — create a temporary Impacket share
mkdir -p /tmp/lab-share
cp evidence.txt /tmp/lab-share/
impacket-smbserver labshare /tmp/lab-share -smb2supportFrom Windows, copy a file from the share:
copy \\192.0.2.10\labshare\evidence.txt .\evidence.txtFor Linux clients, connect with smbclient (authentication depends on how the share is configured):
smbclient //192.0.2.10/labshare
# At the smb: prompt:
ls
get evidence.txt
put local-file.txtAn unauthenticated share can permit unintended access. Confirm the tool's access-control options before using it beyond an isolated lab.
SCP over SSH
Prefer SCP when the destination already runs an SSH server and you have valid credentials. Traffic is encrypted in transit.
Local file → Linux host
scp evidence.txt user@192.0.2.10:/tmp/Linux host → local machine
scp user@192.0.2.10:/tmp/evidence.txt ./evidence.txtDirectory transfer
scp -r ./artifacts user@192.0.2.10:/tmp/Windows 10/11 commonly includes OpenSSH client support; check with ssh -V and enable/install the optional feature if needed. SCP requires SSH connectivity and write permission at the destination.
FTP (lab use only)
FTP is unencrypted by default. Use it only in an isolated environment with non-sensitive test files; prefer SFTP or SCP for real credentials and data.
Connect from a client
ftp 192.0.2.10At the FTP prompt:
ls
get evidence.txt
put local-file.txt
byeFTP needs both a control connection and data connections; host firewalls and active/passive mode mismatches are common causes of failure. Do not expose anonymous write access.
Netcat — one-way lab transfer
Netcat sends a raw byte stream; it has no built-in authentication, encryption, or file-integrity checking. Use only between trusted lab hosts and verify the resulting hash.
Receiver — Linux
nc -lv 5555 > received.binSender — Linux
nc 192.0.2.10 5555 < evidence.binFor Windows, a compatible Netcat binary must already be installed and permitted by policy. Do not download or execute unknown binaries merely to use this method.
Troubleshooting checklist
- Address: use the receiver's reachable interface IP, not
127.0.0.1from another host. - Listener: confirm the server is running and listening on the expected port.
- Firewall: allow only the required source, destination, protocol, and port.
- Path / permissions: confirm the source file exists and the destination directory is writable.
- Protocol: HTTP download servers do not automatically support upload; use a protocol and server configured for the required direction.
- Integrity: compare SHA-256 hashes after transfer for important files.
- Cleanup: stop temporary listeners, remove test files, and review firewall changes.
Reference maintained by 0x0ps. Commands and tool behavior can vary by operating-system version and package release; validate them in your own lab before an engagement.