File Transfers
This scenario is a perfect example of how important it is for penetration testers and red teamers to understand multiple file transfer methods, and more importantly, how to adapt when common techniques are blocked.
Hereβs a breakdown and summary of key lessons and techniques highlighted in your scenario:
βοΈ Scenario Summary: File Transfer Challenges in a Hardened Environment
Initial Access:
Gained Remote Code Execution (RCE) on an IIS web server via unrestricted file upload.
Uploaded a web shell to get a reverse shell for further enumeration.
Privilege Escalation Attempt:
Attempted to use PowerUp.ps1 via PowerShell β‘οΈ Blocked by App Control Policy.
Discovered SeImpersonatePrivilege manually.
Chose PrintSpoofer binary to escalate privileges.
File Transfer Hurdles:
PowerShell
β Blocked
App Control Policy
Certutil from GitHub
β Blocked
Web content filtering
FTP (port 21)
β Blocked
Firewall blocked outbound FTP
SMB (TCP 445) using smbserver.py
β Success
SMB allowed outbound
π§ Key Takeaways
Adaptability Is Critical:
You must pivot quickly to alternative transfer methods when blocked.
Common File Transfer Methods (Windows):
PowerShell Invoke-WebRequest
/ Invoke-Expression
HTTP
Powerful but often monitored
Certutil
HTTP
Common fallback, but may be disabled or filtered
bitsadmin
HTTP
Deprecated, but can be useful
Windows FTP Client
FTP
Needs port 21 open
smbserver.py
(Impacket)
SMB
β Often succeeds if port 445 is open
Encoding (Base64 / Hex)
Clipboard / Echo
Good in restricted shells
DNS Tunneling
DNS
Rare but stealthy
Wget / Curl (Linux)
HTTP/HTTPS
May be blocked by firewall or proxy
Email / Cloud Upload
SMTP/HTTPS
Often blocked by DLP solutions
Network Awareness:
Firewalls, proxies, IDS/IPS, and web filters can all block or alert on your transfer attempts.
Outbound restrictions are common; inbound traffic (SMB pull) may work better.
Tools to Know:
ncat
,scp
,curl
,wget
,socat
β all offer unique file transfer opportunities
π Practical Tip: Use a File Transfer Checklist
Whenever you're stuck on a target:
Can I use PowerShell?
Is
certutil
available?Are outbound ports like 80, 443, or 445 open?
Can I set up an SMB share with
smbserver.py
?Can I encode a small binary as Base64 and reconstruct it?
Are there any mapped drives or local tools I can abuse?
π― Final Thoughts
File transfer is a foundational red team skill. This module trains you to think like an attacker in a constrained environment.
Always have multiple options ready.
Think like a defender too: if you were defending this system, how would you stop these transfers?
Would you like a cheat sheet of file transfer methods for restricted environments or an interactive exercise plan based on this scenario?
Last updated