|
6 | 6 | experimental::[]
|
7 | 7 |
|
8 | 8 | This example tutorial shows you how you can use EQL to detect security threats
|
9 |
| -and other suspicious behavior. |
| 9 | +and other suspicious behavior. In the scenario, you're tasked with detecting |
| 10 | +https://attack.mitre.org/techniques/T1218/010/[regsvr32 misuse] in Windows |
| 11 | +event logs. |
| 12 | + |
| 13 | +`regsvr32.exe` is a built-in command-line utility used to register `.dll` |
| 14 | +libraries in Windows. As a native tool, `regsvr32.exe` has a trusted status in |
| 15 | +Windows, letting it bypass most allowlist software and script blockers. |
| 16 | +Attackers with access to a user's command line can use `regsvr32.exe` to run |
| 17 | +malicious scripts using `.dll` libraries, even on machines that otherwise |
| 18 | +disallow such scripts. |
| 19 | + |
| 20 | +One common variant of regsvr32 misuse is a |
| 21 | +https://attack.mitre.org/techniques/T1218/010/[Squiblydoo attack]. In a |
| 22 | +Squiblydoo attack, a `regsvr32.exe` command uses the `scrobj.dll` library to |
| 23 | +register and run a remote script. These commands often look like this: |
10 | 24 |
|
11 |
| -In the scenario, you're tasked with detecting |
12 |
| -https://attack.mitre.org/techniques/T1218/010/[`regsvr32` misuse] in Windows event |
13 |
| -logs. `regsvr32` misuse is a known adversary technique documented in the |
14 |
| -https://attack.mitre.org[MITRE ATT&CK®] knowledge base. |
| 25 | +[source,sh] |
| 26 | +---- |
| 27 | +"regsvr32.exe /s /u /i:<script-url> scrobj.dll" |
| 28 | +---- |
15 | 29 |
|
16 | 30 | [discrete]
|
17 | 31 | [[eql-ex-threat-detection-setup]]
|
18 | 32 | === Setup
|
19 | 33 |
|
20 |
| -This tutorial uses a test dataset for `regsvr32` misuse from |
| 34 | +This tutorial uses a test dataset for regsvr32 misuse from |
21 | 35 | https://github.com/redcanaryco/atomic-red-team[Atomic Red Team]. The dataset has
|
22 | 36 | been normalized and mapped to use fields from the {ecs-ref}[Elastic Common
|
23 | 37 | Schema (ECS)], including the `@timestamp` and `event.category` fields. The
|
24 |
| -dataset includes events that imitate behaviors related to `regsvr32` misuse, as |
25 |
| -documented by MITRE ATT&CK®. |
| 38 | +dataset includes events that imitate behaviors of a Squiblydoo attack, as |
| 39 | +documented by the https://attack.mitre.org[MITRE ATT&CK®] knowledge base. |
26 | 40 |
|
27 | 41 | To get started, download and index the dataset:
|
28 | 42 |
|
@@ -58,9 +72,9 @@ yellow open my-index-000001 150
|
58 | 72 |
|
59 | 73 | [discrete]
|
60 | 74 | [[eql-ex-get-a-count-of-regsvr32-events]]
|
61 |
| -=== Get a count of `regsvr32` events |
| 75 | +=== Get a count of regsvr32 events |
62 | 76 |
|
63 |
| -Since you're looking for `regsvr32` misuse, start by getting a count of any |
| 77 | +Since you're looking for regsvr32 misuse, start by getting a count of any |
64 | 78 | events associated with a `regsvr32.exe` process.
|
65 | 79 |
|
66 | 80 | The following <<eql-search-api,EQL search API>> request uses an EQL query to
|
@@ -112,11 +126,11 @@ query.
|
112 | 126 | [[eql-ex-check-for-command-line-artifacts]]
|
113 | 127 | === Check for command line artifacts
|
114 | 128 |
|
115 |
| -Based on your previous query, you know `regsvr32` processes were associated with |
| 129 | +Based on your previous query, you know regsvr32 processes were associated with |
116 | 130 | 143 events. But how was `regsvr32.exe` first called? And who called it?
|
117 | 131 |
|
118 |
| -`regsvr32` is a command-line utility so it may help to narrow your results to |
119 |
| -processes where the command line was used. |
| 132 | +`regsvr32.exe` is a command-line utility so it may help to narrow your results |
| 133 | +to processes where the command line was used. |
120 | 134 |
|
121 | 135 | Update the previous EQL query as follows:
|
122 | 136 |
|
@@ -144,8 +158,7 @@ The query matches one process event. The event has an `event.type` of
|
144 | 158 |
|
145 | 159 | Based on the `process.command_line` value in the response, `regsvr32.exe` used
|
146 | 160 | `scrobj.dll` to register a script, `RegSvr32.sct`. This fits the behavior of a
|
147 |
| -https://attack.mitre.org/techniques/T1218/010/["Squiblydoo" attack], a known |
148 |
| -variant of `regsvr32` misuse. |
| 161 | +Squiblydoo attack. |
149 | 162 |
|
150 | 163 | The response also includes other valuable information about how the
|
151 | 164 | `regsvr32.exe` process started, such as the `@timestamp`, the associated
|
|
0 commit comments