Giter Site home page Giter Site logo

skyn9ne / sharprdp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 0xthirteen/sharprdp

1.0 0.0 0.0 369 KB

Remote Desktop Protocol .NET Console Application for Authenticated Command Execution

License: BSD 3-Clause "New" or "Revised" License

C# 100.00%

sharprdp's Introduction

SharpRDP - Remote Desktop Protocol Console Application for Authenticated Command Execution

Building

To compile open the project in Visual Studio and build for release. Two DLLs will be output to the Release directory, you do not need those because the DLLs are in the assembly. If you do not want to use the provided DLLs you will need to .NET SDK to create the AxMSTSCLib.dll DLL. To create it you'll need to run aximp from the SDK on mstscax.dll. %<SDK dir>%\aximp.exe %windir%\system32\mstscax.dll. Those DLLs will need to be referenced by the project to get the Interop DLLs created. You will also need to compress the DLLs with Deflate and name them AxInterop.MSTSCLib.dll.bin and Interop.MSTSCLib.dll.bin

Usage

Regular RDP connection and execution
  SharpRDP.exe computername=target.domain command="C:\Temp\file.exe" username=domain\user password=password
Exec program as child process of cmd or powershell
  SharpRDP.exe computername=target.domain command="C:\Temp\file.exe" username=domain\user password=password exec=cmd
Use restricted admin mode
  SharpRDP.exe computername=target.domain command="C:\Temp\file.exe"
Connect first host drives
  SharpRDP.exe computername=domain.target command="\\tsclient\C\Temp\file.exe" username=domain\user password=password connectdrive=true
Execute command elevated through Run Dialog - CURRENTLY BUGGED
  SharpRDP.exe computername=domain.target command="C:\Temp\file.exe" username=domain\user password=password elevated=winr
Execute command elevated through task manager
  SharpRDP.exe computername=domain.target command="C:\Temp\file.exe\" username=domain\user password=password elevated=taskmgr
Add Network Level Authentication
  SharpRDP.exe computername=domain.target command="C:\Temp\file.exe\" username=domain\user password=password nla=true
Ask to take over logon session
  SharpRDP.exe computername=domain.target command="C:\Temp\file.exe\" username=domain\user password=password takeover=true

If restricted admin mode is enabled on the target do not specify any credentials and it will use the current user context. Can PTH or make_token in beacon or runas /netonly on a Windows system.

All execution starts with the Windows run dialog (Win+R). There will be a registry key created at HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU with the command that you executed. If you want to remove this you can use: CleanRunMRU: Get or clear RunMRU values

Keep in mind if you execute a program like msbuild (I'm sure there are others) a cmd window will pop up while the process is running. If you do it would probably be best to migrate the process and kill the original.

The required DLLs are compiled into the assembly and app domain assembly resolve event is used. Because of the size of the DLLs they are compressed and decompressed at runtime (so they could meet beacon's 1MB size limit).

Blog about it found here SharpRDP

Also part of MoveKit

sharprdp's People

Contributors

0xthirteen avatar

Stargazers

SkyN9ne avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.