# T1068 - Exploitation for Privilege Escalation

## SOC Recommendation
Investigate Exploitation for Privilege Escalation activity in the context of Privilege Escalation: confirm scope, affected host/identity, and whether it matches expected administrative behaviour before deciding this is benign.

## D3FEND Mappings
| D3FEND Technique | Relationship | Practical SOC Action |
|---|---|---|
| Memory Boundary Tracking | Detect | Monitor for Memory Boundary Tracking indicators relevant to this technique. |
| Process Segment Execution Prevention | Harden | Apply Process Segment Execution Prevention to reduce this technique's viability before an incident occurs. |

## Investigation Steps
1. Review Defender for Endpoint / Defender XDR alerts and timeline for the affected host or identity.
2. Check Sentinel analytics rules and incidents correlated with this technique.
3. Review Entra ID sign-in and audit logs if the technique involves an identity or cloud resource.

## Evidence to Collect
- Host or resource affected
- Account or identity involved
- Timestamp of the activity
- Related process, file, or network artifact
- Any preceding or follow-on alerts

## Response Actions
| Action | Risk | Automation Safe | Approval Required |
|---|---|---|---|
| Contain the affected host or account | Medium | No | Yes |
| Collect and preserve evidence | Low | Yes | No |

## KQL
```kql
let KnownVulnerableDrivers = dynamic([
    "gdrv.sys",
    "rtcore64.sys",
    "dbutil_2_3.sys",
    "atillk64.sys",
    "winring0x64.sys",
    "asrdrv104.sys",
    "kprocesshacker.sys",
    "procexp152.sys",
    "zamguard64.sys",
    "viragt64.sys"
]);
DeviceEvents
| where TimeGenerated >= ago(1d)
| where ActionType == "DriverLoad"
| extend DriverFileName = tostring(AdditionalFields.DriverFileName)
| where isnotempty(DriverFileName)
| where DriverFileName has_any (KnownVulnerableDrivers)
| project
    TimeGenerated,
    DeviceName,
    DeviceId,
    AccountName,
    DriverFileName,
    InitiatingProcessFileName,
    InitiatingProcessCommandLine,
    InitiatingProcessSHA256,
    FolderPath,
    SHA256
| extend timestamp = TimeGenerated,
         HostCustomEntity = DeviceName,
         AccountCustomEntity = AccountName
| order by TimeGenerated desc
```
```kql
Authomize_v2_CL
| where ingestion_time() >= ago(30m)
| extend EventID = id_s, Policy = policy_name_s, Severity = severity_s,Description = description_s,Recommendation = recommendation_s,URL = url_s,Tactics = tactics_s
| where Policy has "Unused IaaS Policy"
| project  EventID, Policy, Severity, Description, Recommendation, URL, Category, Tactics
```
```kql
Syslog
  | where ProcessName == 'gw-audit'
  | extend
      TenantName = extract("\"vportal\":\"([^\"]*)\"", 1, SyslogMessage),
      UserName = extract("user=([^|]*)", 1, SyslogMessage),
      Operation = extract("op=([^|]*)", 1, SyslogMessage),
      EdgeFiler = extract("\"client\":\"([^\"]*)\"", 1, SyslogMessage),
      RootPath = extract("rootPath=([^|]*)", 1, SyslogMessage),
      Share = extract("share=([^|]*)", 1, SyslogMessage),
      LocalPath = extract("path=([^|]*)", 1, SyslogMessage),
      Timestamp = todatetime(extract("\"@timestamp\":\"([^\"]*)\"", 1, SyslogMessage))
  | where Operation in ('ACLAdded', 'ACLDeleted', 'ACLProtectionAdded','chown', 'setsd', 'ACLProtectionDeleted', 'ACEChanged', 'setdacl')
  | summarize Count = count() by UserName, bin(Timestamp, 5m)
  | where Count > 5000
```

## Escalation Criteria
- Exploitation for Privilege Escalation activity observed on a privileged account or critical system.
- Activity follows or precedes other suspicious behaviour in the same investigation.
- Automated triage cannot confidently rule out malicious intent.

## False Positive Considerations
- Legitimate administrative or maintenance activity matching this pattern.
- Approved security testing or red team exercise.
- Known benign software producing similar telemetry.

Generated by SOC Response Atlas by Basyrix.
