> For the complete documentation index, see [llms.txt](https://endy.gitbook.io/endys-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://endy.gitbook.io/endys-notes/red-teaming/lateral-movement/cheatsheet.md).

# Cheatsheet

## General

<pre class="language-powershell"><code class="lang-powershell"># Open RDP
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
<strong>netsh advfirewall firewall set rule group="Remote Desktop" new enable=Yes
</strong># Open SMB
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
# Open RPC and allow DCOM over RPC
netsh advfirewall firewall add rule name="Allow RPC" dir=in action=allow protocol=TCP localport=135
netsh advfirewall firewall add rule name="Allow RPC Dynamic Ports" dir=in action=allow protocol=TCP localport=49152-65535
</code></pre>
