Detecting Privilege Escalation Attempts
Overview
Cybersecurity skill for detecting privilege escalation attempts. Follows industry best practices and security standards.
When to Use
Trigger phrases:
"detecting privilege escalation attempts"
"When proactively hunting for indicators of detecting privilege escalation attemp"
"After threat intelligence indicates active campaigns using these techniques"
"During incident response to scope compromise related to these techniques"
When proactively hunting for indicators of detecting privilege escalation attempts in the environment
After threat intelligence indicates active campaigns using these techniques
During incident response to scope compromise related to these techniques
When EDR or SIEM alerts trigger on related indicators
During periodic security assessments and purple team exercises
When NOT to Use
- When you lack proper authorization for testing
- For production systems without change management
- When the task requires legal or compliance expertise beyond technical scope
Prerequisites
- EDR platform with process and network telemetry (CrowdStrike, MDE, SentinelOne)
- SIEM with relevant log data ingested (Splunk, Elastic, Sentinel)
- Sysmon deployed with comprehensive configuration
- Windows Security Event Log forwarding enabled
- Threat intelligence feeds for IOC correlation
Workflow
# Example: IOC detection
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": r"\b[a-f0-9]{32}\b",
"hash_sha256": r"\b[a-f0-9]{64}\b",
}
def extract_iocs(text: str) -> dict:
return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}
- Define Detection Scope — Identify the specific privilege escalation attempts techniques or indicators to hunt. Map to MITRE ATT&CK tactics/techniques where applicable.
- Collect Baseline Data — Gather historical logs and establish normal behavior patterns for privilege escalation attempts.
- Build Detection Queries — Write detection rules, Sigma rules, or SIEM queries targeting privilege escalation attempts indicators.
- Execute Hunts — Run queries against the collected data, starting with broad filters and narrowing down.
- Triage Results — Investigate alerts, filter false positives, and validate findings against known-good behavior.
- Document Findings — Record confirmed detections, IOCs, and affected systems. Update detection rules based on findings.
Tools
- SIEM Platform — Central log aggregation and query execution
- Sigma Rules — Vendor-agnostic detection rule format
- MITRE ATT&CK Navigator — Technique mapping and coverage analysis
Process
- Reconnaissance — Gather target information, identify attack surface, enumerate services
- Analysis/Exploitation — Execute the technique, analyze results, document findings
- Reporting — Document IOCs, write findings, provide remediation recommendations
Verification
Anti-Rationalization Table
| Rationalization |
Reality |
| "We are too small to be targeted" |
Automated attacks target everyone. Size does not matter. |
| "Security slows us down" |
A breach slows you down 100x more. Build security in from the start. |
| "We will fix it after launch" |
Vulnerabilities in production are exploited within hours. Fix before deploy. |
1---2name: detecting-privilege-escalation-attempts3description: Use when detect privilege escalation attempts including token manipulation,4 UAC bypass, unquoted service paths, kernel exploits, and sudo/doas abuse across5 Windows and Linux. Use when detecting privilege escalation attempts including token6 manipulation, uac bypass, unquoted.7domain: cybersecurity8tags:9- threat-hunting10- mitre-attack11- privilege-escalation12- token-manipulation13- uac-bypass14- proactive-detection15subdomain: threat-hunting16version: '1.0'17author: oyi7718license: Apache-2.019d3fend_techniques:20- Token Binding21- Executable Denylisting22- Execution Isolation23- Restore Access24- Reissue Credential25nist_csf:26- DE.CM-0127- DE.AE-0228- DE.AE-0729- ID.RA-0530category: cybersecurity31metadata:32 source: https://skillmd.com/skills/oyi77/detecting-privilege-escalation-attempts33---3435# Detecting Privilege Escalation Attempts3637## Overview3839Cybersecurity skill for detecting privilege escalation attempts. Follows industry best practices and security standards.4041## When to Use4243**Trigger phrases:**44- "detecting privilege escalation attempts"45- "When proactively hunting for indicators of detecting privilege escalation attemp"46- "After threat intelligence indicates active campaigns using these techniques"47- "During incident response to scope compromise related to these techniques"484950- When proactively hunting for indicators of detecting privilege escalation attempts in the environment51- After threat intelligence indicates active campaigns using these techniques52- During incident response to scope compromise related to these techniques53- When EDR or SIEM alerts trigger on related indicators54- During periodic security assessments and purple team exercises555657## When NOT to Use5859- When you lack proper authorization for testing60- For production systems without change management61- When the task requires legal or compliance expertise beyond technical scope626364## Prerequisites6566- EDR platform with process and network telemetry (CrowdStrike, MDE, SentinelOne)67- SIEM with relevant log data ingested (Splunk, Elastic, Sentinel)68- Sysmon deployed with comprehensive configuration69- Windows Security Event Log forwarding enabled70- Threat intelligence feeds for IOC correlation7172## Workflow7374```python75# Example: IOC detection76import re7778IOC_PATTERNS = {79 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",80 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",81 "hash_md5": r"\b[a-f0-9]{32}\b",82 "hash_sha256": r"\b[a-f0-9]{64}\b",83}8485def extract_iocs(text: str) -> dict:86 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}87```88891. **Define Detection Scope** — Identify the specific privilege escalation attempts techniques or indicators to hunt. Map to MITRE ATT&CK tactics/techniques where applicable.902. **Collect Baseline Data** — Gather historical logs and establish normal behavior patterns for privilege escalation attempts.913. **Build Detection Queries** — Write detection rules, Sigma rules, or SIEM queries targeting privilege escalation attempts indicators.924. **Execute Hunts** — Run queries against the collected data, starting with broad filters and narrowing down.935. **Triage Results** — Investigate alerts, filter false positives, and validate findings against known-good behavior.946. **Document Findings** — Record confirmed detections, IOCs, and affected systems. Update detection rules based on findings.9596## Tools9798- **SIEM Platform** — Central log aggregation and query execution99- **Sigma Rules** — Vendor-agnostic detection rule format100- **MITRE ATT&CK Navigator** — Technique mapping and coverage analysis101102103## Process1041051. **Reconnaissance** — Gather target information, identify attack surface, enumerate services1061. **Analysis/Exploitation** — Execute the technique, analyze results, document findings1071. **Reporting** — Document IOCs, write findings, provide remediation recommendations108109## Verification110111- [ ] All privilege escalation attempts procedures executed completely and documented112- [ ] Findings validated against multiple data sources113- [ ] False positives identified and filtered114- [ ] Results documented with evidence and timestamps115- [ ] Recommendations provided with risk-based prioritization116117## Anti-Rationalization Table118119| Rationalization | Reality |120|---|---|121| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |122| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |123| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |