|
| 1 | +name: Activation Context memory section hijacking |
| 2 | +id: 3d56281e-9608-4a70-b7b7-7651ccd3752b |
| 3 | +version: 1.0.0 |
| 4 | +description: | |
| 5 | + Detects abuses of a legitimate Windows feature present in most processes |
| 6 | + called Activation Contexts with the objective of loading an arbitrary DLL |
| 7 | + into signed executables. |
| 8 | + Adversaries can unmap the legitimate read-only memory section view backing |
| 9 | + the process Activation Context, then map a new pagefile-backed section at |
| 10 | + the exact same base address containing a malicious Activation Context. |
| 11 | +labels: |
| 12 | + tactic.id: TA0005 |
| 13 | + tactic.name: Defense Evasion |
| 14 | + tactic.ref: https://attack.mitre.org/tactics/TA0005/ |
| 15 | + technique.id: T1055 |
| 16 | + technique.name: Process Injection |
| 17 | + technique.ref: https://attack.mitre.org/techniques/T1055/ |
| 18 | +references: |
| 19 | + - https://github.com/r3xmax/PhantomCtx |
| 20 | + - https://learn.microsoft.com/en-us/windows/win32/sbscs/activation-contexts |
| 21 | + |
| 22 | +condition: > |
| 23 | + sequence |
| 24 | + maxspan 40s |
| 25 | + by ps.uuid, file.view.base |
| 26 | + |unmap_view_file and |
| 27 | + file.view.type = 'PAGEFILE' and file.view.protection = 'READONLY' and |
| 28 | + (file.view.size = 12288 or (file.view.size = 4096 and |
| 29 | + not (ps.parent.exe imatches '?:\\Windows\\System32\\svchost.exe' and ps.exe imatches '?:\\Windows\\System32\\taskhostw.exe') and |
| 30 | + not (ps.parent.exe imatches '?:\\Windows\\explorer.exe' and ps.exe imatches '?:\\Program Files\\WindowsApps\\*.exe') and |
| 31 | + not (ps.parent.exe imatches '?:\\Windows\\System32\\winlogon.exe' and ps.exe imatches '?:\\Windows\\System32\\dwm.exe') and |
| 32 | + not (ps.parent.exe imatches '?:\\Windows\\System32\\winlogon.exe' and ps.exe imatches '?:\\Windows\\System32\\csrss.exe') and |
| 33 | + not (ps.parent.exe imatches '?:\\Windows\\System32\\svchost.exe' and ps.exe imatches '?:\\Program Files\\Microsoft Office\\*\\ActionsServer\\ActionsServer.exe') and |
| 34 | + not (ps.parent.exe imatches '?:\\Program Files\\Mozilla Firefox\\firefox.exe' and ps.exe imatches '?:\\Program Files\\Mozilla Firefox\\firefox.exe' and ps.cmdline imatches concat('*-contentproc -parentBuildID* -parentPid ', ps.ppid))) |
| 35 | + ) |
| 36 | + | |
| 37 | + |map_view_file and file.view.size = 12288 and file.view.type = 'PAGEFILE' and file.view.protection = 'READWRITE'| |
| 38 | +
|
| 39 | +severity: high |
| 40 | + |
| 41 | +min-engine-version: 3.0.0 |
0 commit comments