FILE TRANSFER // WINDOWS // LINUX // AUTHORIZED LABS // FILE TRANSFER // WINDOWS // LINUX //
← ALL CHEAT SHEETS

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.

LAB SAFETY
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.
00 / SETUP

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 route

Windows — find an address

ipconfig

Confirm routing and firewall rules first. A server listening on 0.0.0.0 may be reachable on every interface, not just your lab interface.

01 / SIMPLE AND FAST

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.10

Download 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.txt

On 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.txt

Verify the result

# Linux
sha256sum evidence.txt

# Windows PowerShell
Get-FileHash .\evidence.txt -Algorithm SHA256

A Python HTTP server is a simple download server, not an upload service. Do not expose its directory to untrusted networks.

02 / WINDOWS SHARES

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 -smb2support

From Windows, copy a file from the share:

copy \\192.0.2.10\labshare\evidence.txt .\evidence.txt

For 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.txt

An unauthenticated share can permit unintended access. Confirm the tool's access-control options before using it beyond an isolated lab.

03 / ENCRYPTED TRANSFER

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.txt

Directory 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.

04 / LEGACY PROTOCOL

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.10

At the FTP prompt:

ls
get evidence.txt
put local-file.txt
bye

FTP 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.

05 / RAW TCP STREAM

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.bin

Sender — Linux

nc 192.0.2.10 5555 < evidence.bin

For 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.

06 / QUICK CHECKS

Troubleshooting checklist

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.