Repository navigation
Expand file tree
/
Copy pathsecurity-content.code-snippets
More file actions
350 lines (330 loc) · 10.8 KB
/
Copy pathsecurity-content.code-snippets
File metadata and controls
350 lines (330 loc) · 10.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
{
// Place your security-content workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
// use https://snippet-generator.app/
"datamodel how to implement": {
"prefix": "how_to_datamodel",
"body": [
"To successfully implement this search you need to be ingesting information on process that include the name of the process responsible for the changes from your endpoints into the `Endpoint` datamodel in the `Processes` node. In addition, confirm the latest CIM App 4.20 or higher is installed and the latest TA for the endpoint product."
],
"description": "datamodel how to implement"
},
"Original FileName": {
"prefix": "orig",
"body": [
"Processes.original_file_name"
],
"description": "Original FileName"
},
"tstat": {
"prefix": "tstat_example",
"body": [
"| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time)",
" as lastTime from datamodel=Endpoint.Processes where Processes.process_name=rundll32.exe",
" Processes.process=*start* by Processes.dest Processes.user Processes.parent_process_name Processes.process_name",
" Processes.process Processes.process_id Processes.parent_process_id",
" | `drop_dm_object_name(Processes)` ",
" | `security_content_ctime(firstTime)`",
" | `security_content_ctime(lastTime)`"
],
"description": "tstat datamodel query example"
},
"sysmon": {
"prefix": "sysmon_example",
"body": [
"'`sysmon` EventID=1 (OriginalFileName=RUNDLL32.EXE OR process_name=rundll32.exe) CommandLine=*advpack*",
" | stats count min(_time) as firstTime max(_time) as lastTime by Computer, User,",
" parent_process_name, process_name, OriginalFileName, process_path, CommandLine ",
" | rename Computer as dest ",
" | `security_content_ctime(firstTime)`",
" | `security_content_ctime(lastTime)`",
" | `detect_rundll32_application_control_bypass___advpack_filter`'"
],
"description": "sysmon query example"
},
"Sysmon query to detect No Command Line Arguments": {
"prefix": "no_cl_arguments",
"body": [
"'`sysmon` EventID=1 (process_name=rundll32.exe OR OriginalFileName=RUNDLL32.EXE)",
" | regex CommandLine=\"(rundll32\\.exe.{0,4}$)\" | stats count min(_time) as firstTime",
" max(_time) as lastTime by dest, User, ParentImage,ParentCommandLine, process_name,",
" OriginalFileName, process_path, CommandLine | rename Computer as dest | `security_content_ctime(firstTime)`",
" | `security_content_ctime(lastTime)` | `suspicious_rundll32_no_commandline_arguments_filter`'"
],
"description": "Sysmon query to detect No Command Line Arguments"
},
"Sysmon query to detect external netconn": {
"prefix": "sysmon_external_netconn",
"body": [
"'`sysmon` EventID=3 dest_ip!=10.0.0.0/12 dest_ip!=172.16.0.0/12 dest_ip!=192.168.0.0/16 process_name=regasm.exe",
" | rename Computer as dest ",
" | stats count min(_time) as firstTime max(_time) as lastTime by dest, User, process_name, src_ip, dest_host, dest_ip",
" | `security_content_ctime(firstTime)`",
" | `security_content_ctime(lastTime)`",
" | `detect_regasm_with_network_connection_filter`'"
],
"description": "Sysmon query to detect external netconn"
},
"tstat load from suspicious path": {
"prefix": "tstat_load_suspicious_path",
"body": [
"'| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time)",
" as lastTime from datamodel=Endpoint.Processes where Processes.process_name=regsvr32.exe",
" (Processes.process=*appdata* OR Processes.process=*programdata* OR Processes.process=*windows\\temp*)",
" (Processes.process!=*.dll Processes.process!=*.ax Processes.process!=*.ocx) by Processes.dest",
" Processes.user Processes.parent_process_name Processes.process_name Processes.process",
" Processes.process_id Processes.parent_process_id | `drop_dm_object_name(Processes)`",
" | `security_content_ctime(firstTime)`| `security_content_ctime(lastTime)` | `suspicious_regsvr32_register_suspicious_path_filter`'"
],
"description": "tstat load from suspicious path"
},
"sysmon how to implement": {
"prefix": "sysmon_how_to",
"body": [
"To successfully implement this search, you need to be ingesting",
" logs with the process name, parent process, and command-line executions from your",
" endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the",
" Sysmon TA."
],
"description": "sysmon how to implement"
},
"cloudtrail": {
"prefix": "cloudtrail_query",
"body": [
"`cloudtrail` eventSource=iam.amazonaws.com eventName=DeleteGroup errorCode=failure ",
"| stats count min(_time) as firstTime max(_time) as lastTime values(requestParameters.policyArn) as policy_arn by src requestParameters.versionId eventName eventSource aws_account_id errorCode userAgent eventID awsRegion userIdentity.principalId user_arn ",
"| `security_content_ctime(firstTime)`",
"| `security_content_ctime(lastTime)` "
],
"description": "cloudtrail"
},
"howto_cloudtrail": {
"prefix": "cloudtrail_howto",
"body": [
"The Splunk AWS Add-on and Splunk App for AWS is required to utilize this data. The search requires AWS Cloudtrail logs."
],
"description": "howto_cloudtrail"
},
"winword_spawn_tstat": {
"prefix": "winword_spawn_tstat",
"body": [
" | tstats `security_content_summariesonly` count values(Processes.process)",
" min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes",
" where Processes.parent_process_name=\"winword.exe\" Processes.process_name=rundll32.exe by Processes.parent_process_name Processes.process_name",
" Processes.user Processes.dest | `drop_dm_object_name(\"Processes\")` | `security_content_ctime(firstTime)`|`security_content_ctime(lastTime)`"
],
"description": "winword_spawn_tstat"
},
"dns_datamodel": {
"prefix": "dns_datamodel",
"body": [
"To successfully implement this search, you will need to ensure that",
" DNS data is populating the Network_Resolution data model."
],
"description": "dns_datamodel"
},
"Required fields for datamodel": {
"prefix": "datamodel_required_fields",
"body": [
" - Processes.dest",
" - Processes.user",
" - Processes.parent_process_name #parent process name",
" - Processes.parent_process #parent cmdline",
" - Processes.original_file_name",
" - Processes.process_name #process name",
" - Processes.process #process cmdline",
" - Processes.process_id",
" - Processes.parent_process_path",
" - Processes.process_path",
" - Processes.parent_process_id"
],
"description": "Required fields for datamodel"
},
"risk_impact": {
"prefix": "risk",
"body": [
" impact: 80",
" confidence: 100",
" # (impact * confidence)/100",
" risk_score: 80",
" context:",
" - Source:Endpoint",
" - Stage:Defense Evasion",
" message: An instance of $parent_process_name$ spawning process_name$ was identified on endpoint $Computer$ by user user$ attempting to decode a file.",
" observable:",
" - name: user",
" type: User",
" role:",
" - Victim",
" - name: Computer",
" type: Hostname",
" role:",
" - Victim",
" - name: parent_process_name",
" type: Process",
" role:",
" - Parent Process",
" - name: process_name",
" type: Process",
" role:",
" - Child Process"
],
"description": "risk_impact"
},
"certutil macro": {
"prefix": "certutil macro",
"body": [
"`process_certutil`"
],
"description": "certutil macro"
},
"hh macro": {
"prefix": "hh macro",
"body": [
"`process_hh`"
],
"description": "hh macro"
},
"powershell macro": {
"prefix": "powershell macro",
"body": [
"`process_powershell`"
],
"description": "powershell macro"
},
"net macro": {
"prefix": "net macro",
"body": [
"`process_net`"
],
"description": "net macro"
},
"mshta macro": {
"prefix": "mshta macro",
"body": [
"`process_mshta`"
],
"description": "mshta macro"
},
"cmd macro": {
"prefix": "cmd macro",
"body": [
"`process_cmd`"
],
"description": "cmd macro"
},
"reg macro": {
"prefix": "reg macro",
"body": [
"`process_reg`"
],
"description": "reg macro"
},
"wmic macro": {
"prefix": "wmic macro",
"body": [
"`process_wmic`"
],
"description": "wmic macro"
},
"rundll32 macro": {
"prefix": "rundll32 macro",
"body": [
"`process_rundll32`"
],
"description": "rundll32 macro"
},
"regsvr32 macro": {
"prefix": "regsvr32 macro",
"body": [
"`process_regsvr32`"
],
"description": "regsvr32 macro"
},
"bitsadmin macro": {
"prefix": "bitsadmin macro",
"body": [
"`process_bitsadmin`"
],
"description": "bitsadmin macro"
},
"dllhost macro": {
"prefix": "dllhost macro",
"body": [
"`process_dllhost`"
],
"description": "dllhost macro"
},
"dsquery macro": {
"prefix": "dsquery macro",
"body": [
"`process_dsquery`"
],
"description": "dsquery macro"
},
"fodhelper macro": {
"prefix": "fodhelper macro",
"body": [
"`process_fodhelper`"
],
"description": "fodhelper macro"
},
"gpupdate macro": {
"prefix": "gpupdate macro",
"body": [
"`process_gpupdate`"
],
"description": "gpupdate macro"
},
"msbuild macro": {
"prefix": "msbuild macro",
"body": [
"`process_msbuild`"
],
"description": "msbuild macro"
},
"microsoftworkflowcompiler macro": {
"prefix": "microsoftworkflowcompiler macro",
"body": [
"`process_microsoftworkflowcompiler`"
],
"description": "microsoftworkflowcompiler macro"
},
"netsh macro": {
"prefix": "netsh macro",
"body": [
"`process_netsh`"
],
"description": "netsh macro"
},
"date version": {
"prefix": "date version",
"body": [
"version: 4",
"date: '2023-04-27'",
],
"description": "date version"
},
"time": {
"prefix": "time",
"body": [
"| `security_content_ctime(firstTime)`",
"| `security_content_ctime(lastTime)`",
],
"description": "time"
}
}