Skip to content

Commit ce80755

Browse files
authored
Merge pull request #2009 from HackTricks-wiki/research_update_src_network-services-pentesting_pentesting-rdp_20260316_025459
Research Update Enhanced src/network-services-pentesting/pen...
2 parents 738bcf0 + 029eff3 commit ce80755

1 file changed

Lines changed: 56 additions & 1 deletion

File tree

src/network-services-pentesting/pentesting-rdp.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,24 @@ nmap --script "rdp-enum-encryption or rdp-vuln-ms12-020 or rdp-ntlm-info" -p 338
2424

2525
It checks the available encryption and DoS vulnerability (without causing DoS to the service) and obtains NTLM Windows info (versions).
2626

27+
### Security Layer / NLA Checks
28+
29+
RDP can negotiate different security layers (native RDP, TLS, or CredSSP/NLA). You can quickly fingerprint the server-side settings and whether NLA is required:
30+
31+
```bash
32+
# Security layer and encryption info
33+
nmap --script rdp-enum-encryption -p 3389 <IP>
34+
35+
# Quick auth check (also reports if NLA is required)
36+
nxc rdp <IP> -u <user> -p <password>
37+
38+
# Pre-auth screenshot only works if NLA is disabled
39+
nxc rdp <IP> --nla-screenshot
40+
41+
# Authenticated screenshot after valid login
42+
nxc rdp <IP> -u <user> -p <password> --screenshot
43+
```
44+
2745
### [Brute force](../generic-hacking/brute-force.md#rdp)
2846

2947
**Be careful, you could lock accounts**
@@ -90,6 +108,38 @@ ts::sessions #Get sessions
90108
ts::remote /id:2 #Connect to the session
91109
```
92110

111+
### RDP Shadowing (Remote Control)
112+
113+
If **Remote Desktop Services shadowing** is enabled, you can **view or control** another user's active session (sometimes **without consent**) using built-in `mstsc` switches.
114+
115+
```bash
116+
# List sessions on a remote host
117+
qwinsta /server:<IP>
118+
quser /server:<IP>
119+
120+
# Shadow a specific session (consent required if policy enforces it)
121+
mstsc /v:<IP> /shadow:<SESSION_ID> /control
122+
123+
# Shadow without consent if policy allows it
124+
mstsc /v:<IP> /shadow:<SESSION_ID> /noconsentprompt /prompt
125+
126+
# Check current shadowing policy on the target
127+
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v Shadow
128+
```
129+
130+
### RDP Virtual Channel Tunneling
131+
132+
RDP supports **virtual channels** that can be abused for **pivoting/tunneling** over an established RDP session. One option is **rdp2tcp** (client/server) which can multiplex TCP forwards over RDP (works with FreeRDP).
133+
134+
```bash
135+
# Start FreeRDP with rdp2tcp virtual channel
136+
xfreerdp /u:<user> /v:<IP> /rdp2tcp:/path/to/rdp2tcp/client/rdp2tcp
137+
```
138+
139+
{{#ref}}
140+
../generic-hacking/tunneling-and-port-forwarding.md
141+
{{#endref}}
142+
93143
### Sticky-keys & Utilman
94144

95145
Combining this technique with **stickykeys** or **utilman you will be able to access a administrative CMD and any RDP session anytime**
@@ -150,6 +200,11 @@ Entry_2:
150200
```
151201

152202

153-
{{#include ../banners/hacktricks-training.md}}
154203

155204

205+
## References
206+
207+
- [https://swarm.ptsecurity.com/remote-desktop-services-shadowing/](https://swarm.ptsecurity.com/remote-desktop-services-shadowing/)
208+
- [https://www.errno.fr/rdptunneling/](https://www.errno.fr/rdptunneling/)
209+
210+
{{#include ../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)