forked from blueteam0ps/AllthingsTimesketch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NR_DFIRFlow.json
673 lines (673 loc) · 17 KB
/
NR_DFIRFlow.json
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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
[
{
"id": "545e293e.4e6458",
"type": "tab",
"label": "Auto Process Triage Zips (UNZIP)",
"disabled": false,
"info": ""
},
{
"id": "a21786c3.24a7f8",
"type": "change",
"z": "545e293e.4e6458",
"name": "Set the Filename ",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "filename",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1530,
"y": 160,
"wires": [
[
"537eb989.cf1338"
]
]
},
{
"id": "f69259b2.a91318",
"type": "change",
"z": "545e293e.4e6458",
"name": "Set Proc Directory",
"rules": [
{
"t": "set",
"p": "filedir",
"pt": "msg",
"to": "config.start",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 390,
"y": 160,
"wires": [
[
"9f9ca2673cdf0488"
]
]
},
{
"id": "537eb989.cf1338",
"type": "function",
"z": "545e293e.4e6458",
"name": "Generate Dir Name",
"func": "var filenameUpper = msg.file.split(\".\")[0];\nfilename = filenameUpper.toLowerCase();\nmsg.tstamp = new Date().toISOString().substring(0,19).replace(/-/g,\"\").replace(/:/g,\"\");\ndirnameUpper = filename + msg.tstamp + \"Z\";\nmsg.dirname = dirnameUpper.toLowerCase();\nmsg.plasofname = msg.dirname;\nmsg.filename = msg.payload;\nmsg.unzipdir = msg.filedir + '/' + msg.dirname;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 370,
"y": 300,
"wires": [
[
"24c8cb33.f6d2d4"
]
]
},
{
"id": "3fca2583.81cb3a",
"type": "function",
"z": "545e293e.4e6458",
"name": "Set-Log2timeline CLI params",
"func": "var plasodir = \"/cases/plaso/\";\nvar plasoname = msg.dirname.replace('processor', 'plaso');\nmsg.l2tcli = \"--status_view none --parsers \\\"filestat,winiis,lnk,esedb,olecf,pe,prefetch,recycle_bin,recycle_bin_info2,winevtx,winfirewall,winjob,winreg,custom_destinations,chrome_cache,chrome_preferences,firefox_cache,firefox_cache2,msiecf\\\" --storage-file\" + \" \"+ plasoname + \".plaso\" + \" \" + msg.unzipdir;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 200,
"y": 440,
"wires": [
[
"598f0e43.5e474"
]
]
},
{
"id": "598f0e43.5e474",
"type": "exec",
"z": "545e293e.4e6458",
"command": "log2timeline.py",
"addpay": "l2tcli",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "Log2timeline Process",
"x": 480,
"y": 440,
"wires": [
[],
[],
[
"91572179.99bca"
]
]
},
{
"id": "91572179.99bca",
"type": "switch",
"z": "545e293e.4e6458",
"name": "Plaso Success",
"property": "payload.code",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "0",
"vt": "num"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 760,
"y": 440,
"wires": [
[
"dfa2b1ab.2de0e"
],
[
"9532d0252e634b91",
"883d9df4.78533",
"d0f0410536029177"
]
]
},
{
"id": "2f75f229.1e859e",
"type": "exec",
"z": "545e293e.4e6458",
"command": "timesketch_importer",
"addpay": "tsimport",
"append": "",
"useSpawn": "false",
"timer": "",
"oldrc": false,
"name": "Timesketch Import Process",
"x": 500,
"y": 560,
"wires": [
[],
[],
[
"9d6eccdb.04454"
]
]
},
{
"id": "b1f641f0.257c3",
"type": "function",
"z": "545e293e.4e6458",
"name": "Timesketch CLI params",
"func": "var plasofullpath = \"/cases/plaso/\"+ msg.plasofname + \".plaso\";\nmsg.tsimport = \"-u username -p pass --host http://127.0.0.1 --timeline_name \" + msg.plasofname + \"-triage\" + \" --sketch_id \" + \"1\" + \" \" + plasofullpath;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 190,
"y": 560,
"wires": [
[
"2f75f229.1e859e"
]
]
},
{
"id": "644493b3.8a91dc",
"type": "debug",
"z": "545e293e.4e6458",
"name": "Timesketch Error Status",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1060,
"y": 640,
"wires": []
},
{
"id": "aa774014.53c1a",
"type": "comment",
"z": "545e293e.4e6458",
"name": "Generates a folder with a unique name per zip (Unzip Destination)",
"info": "",
"x": 330,
"y": 260,
"wires": []
},
{
"id": "fccdf46f.dcf738",
"type": "comment",
"z": "545e293e.4e6458",
"name": "Update this node with ZIP upload location",
"info": "",
"x": 260,
"y": 120,
"wires": []
},
{
"id": "59011b6e.86f384",
"type": "comment",
"z": "545e293e.4e6458",
"name": "Adjust Max Zips to process at any given point",
"info": "Tweak the value to configure how many zips to process at any given time",
"x": 1430,
"y": 40,
"wires": []
},
{
"id": "262ec069.e07fa",
"type": "comment",
"z": "545e293e.4e6458",
"name": "Change Log2timeline params here",
"info": "",
"x": 200,
"y": 400,
"wires": []
},
{
"id": "bf30b26e.de9b2",
"type": "comment",
"z": "545e293e.4e6458",
"name": "Change Timesketch CLI params here",
"info": "",
"x": 210,
"y": 520,
"wires": []
},
{
"id": "9d6eccdb.04454",
"type": "switch",
"z": "545e293e.4e6458",
"name": "CheckTSComplete",
"property": "payload.code",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "0",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 810,
"y": 580,
"wires": [
[
"883d9df4.78533"
],
[
"644493b3.8a91dc",
"883d9df4.78533"
]
]
},
{
"id": "dfa2b1ab.2de0e",
"type": "exec",
"z": "545e293e.4e6458",
"command": "rm -rf ",
"addpay": "unzipdir",
"append": "",
"useSpawn": "false",
"timer": "300",
"winHide": false,
"oldrc": false,
"name": "Delete Unzip Dir",
"x": 1040,
"y": 420,
"wires": [
[],
[],
[
"197239e9.8d04f6"
]
]
},
{
"id": "9cdc2c031cb9079b",
"type": "exec",
"z": "545e293e.4e6458",
"command": "unzip",
"addpay": "unzipcli",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "Unzip Triage Zip",
"x": 1120,
"y": 300,
"wires": [
[],
[],
[
"40bb52206df8872b"
]
]
},
{
"id": "4739fce93d72c8fa",
"type": "function",
"z": "545e293e.4e6458",
"name": "Unzip CLI params",
"func": "msg.unzipcli = \"-qo \" + msg.filename + \" -d \" + msg.unzipdir;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 870,
"y": 300,
"wires": [
[
"9cdc2c031cb9079b"
]
]
},
{
"id": "40bb52206df8872b",
"type": "switch",
"z": "545e293e.4e6458",
"name": "UnzipStatus",
"property": "payload.code",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "0",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1370,
"y": 320,
"wires": [
[
"3fca2583.81cb3a"
],
[
"bf6968abac0fe524",
"883d9df4.78533"
]
]
},
{
"id": "bf6968abac0fe524",
"type": "debug",
"z": "545e293e.4e6458",
"name": "Unzip Errors",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1370,
"y": 260,
"wires": []
},
{
"id": "02d7c06bb6ed1c09",
"type": "comment",
"z": "545e293e.4e6458",
"name": "READ ME! Double Click",
"info": "**Following folders need to be created beforehand**\n/cases/processors - this is where Zips will be copied to. Note that zip files will be retained.\n/cases/plaso - this is where plaso files be generated\n\nMake sure Node-RED can write to those folders.\n\n**Unzip utility must be present on the Linux host**\nThis flow uses unzip command to decompress zip files. Make sure you have it pre-installed.\n\n**You need the following Node-RED nodes installed via the palette**\n\n-node-red-contrib-fs \n-node-red-contrib-fs-ops -node-red-contrib-simple-queue -node-red-contrib-watchdirectory \n\n**Change the Log2Timeline CLI Parameters and Timesketch CLI Parameters**\nYou should review the CLI parameters used for Log2timeline and Timesketch in their respective nodes. \n\n\n**FYI Only**\nNode-RED has a default memory cap of 2GB. You can increase this through the use of environment variables. Add the following to your bash.rc of the user in which Node-RED runs. Size is in MB.\n\nNODE_OPTIONS=--max_old_space_size=4096",
"x": 160,
"y": 40,
"wires": []
},
{
"id": "9532d0252e634b91",
"type": "debug",
"z": "545e293e.4e6458",
"name": "L2T Errors",
"active": true,
"tosidebar": true,
"console": true,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 830,
"y": 360,
"wires": []
},
{
"id": "155f06cb.71a199",
"type": "watch-directory",
"z": "545e293e.4e6458",
"folder": "/cases/processor",
"recursive": 0,
"typeEvent": "create",
"ignoreInitial": true,
"ignoredFiles": "",
"ignoredFilesType": "re",
"name": "Watch for Triage Zips",
"x": 120,
"y": 160,
"wires": [
[
"f69259b2.a91318"
]
]
},
{
"id": "883d9df4.78533",
"type": "simple-queue",
"z": "545e293e.4e6458",
"name": "Queue Zips",
"count": "2",
"x": 1410,
"y": 80,
"wires": [
[
"a21786c3.24a7f8"
]
]
},
{
"id": "24c8cb33.f6d2d4",
"type": "fs-ops-mkdir",
"z": "545e293e.4e6458",
"name": "Create Unzip Dir",
"path": "filedir",
"pathType": "msg",
"dirname": "dirname",
"dirnameType": "msg",
"recursive": false,
"mode": "777",
"fullpath": "dirname",
"fullpathType": "msg",
"x": 640,
"y": 300,
"wires": [
[
"4739fce93d72c8fa"
]
]
},
{
"id": "9f9ca2673cdf0488",
"type": "switch",
"z": "545e293e.4e6458",
"name": "Zip File Detection",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "regex",
"v": ".*\\.zip",
"vt": "str",
"case": true
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 590,
"y": 160,
"wires": [
[
"448deb2f9d89d4e8"
],
[
"c1d68e49480668af"
]
]
},
{
"id": "448deb2f9d89d4e8",
"type": "exec",
"z": "545e293e.4e6458",
"command": "unzip -t",
"addpay": "filename",
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "Zip Integrity Check",
"x": 870,
"y": 160,
"wires": [
[],
[],
[
"9572936abb73579f"
]
]
},
{
"id": "c1d68e49480668af",
"type": "debug",
"z": "545e293e.4e6458",
"name": "Unsupported File Error",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 780,
"y": 60,
"wires": []
},
{
"id": "9572936abb73579f",
"type": "switch",
"z": "545e293e.4e6458",
"name": "Post Zip Integrity Check Action",
"property": "payload.code",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "0",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1090,
"y": 80,
"wires": [
[
"883d9df4.78533"
],
[
"6942c391b7be7a5e"
]
]
},
{
"id": "6942c391b7be7a5e",
"type": "debug",
"z": "545e293e.4e6458",
"name": "Zip Integrity Error",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1090,
"y": 20,
"wires": []
},
{
"id": "197239e9.8d04f6",
"type": "switch",
"z": "545e293e.4e6458",
"name": "Delete Folder",
"property": "payload.code",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "0",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 1260,
"y": 440,
"wires": [
[
"b1f641f0.257c3"
],
[
"883d9df4.78533",
"6e355990aa202c01"
]
]
},
{
"id": "d0f0410536029177",
"type": "debug",
"z": "545e293e.4e6458",
"name": "Plaso Error",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 910,
"y": 500,
"wires": []
},
{
"id": "6e355990aa202c01",
"type": "debug",
"z": "545e293e.4e6458",
"name": "Folder Deletion Error",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1340,
"y": 500,
"wires": []
}
]