-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.ps1
More file actions
98 lines (92 loc) · 2.58 KB
/
script.ps1
File metadata and controls
98 lines (92 loc) · 2.58 KB
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
# ----------------------------------------------------------------
# CyberPatriot Windows PowerShell MEGAScript
# by Jackson Kauflin
#
# This is the SCRIPT, which runs
# every single function.
# ----------------------------------------------------------------
# Put functions in array
$functions = $(
"Open-Readme",
"Apply-GPO",
"Remove-Users",
"Remove-Admins",
"Set-Passwords",
"Enable-Firewall",
"Set-PasswordExpiration",
"Disable-BuiltInUsers",
"Enable-AllAuthorizedUsers",
"Remove-BadUserFolders",
"rd placeholder 10",
"Clear-HostsFile",
"Set-FirefoxConfig",
"Enable-IE",
"Remove-AppLockerPolicies",
"Set-UACHigh",
"Open-ForensicsQuestions"
)
# Functions that need to be run in seperate shell
$functions_sep = $(
"Start-WindowsUpdate",
"Disable-OptionalFeatures",
"Install-Malwarebytes",
"Install-MBSA",
"Install-IOBitUninstaller",
"Install-IOBitUnlocker",
"Disable-Services",
"Enable-Services",
"Start-CatLite"
)
# Functions part to (to run after functions_sep)
$functions_pt2 = $(
"Remove-Shares",
"Remove-UnwantedSoftware",
"Remove-Malware",
"Update-Applications",
"Remove-ProhibitedFiles",
"Find-ProhibitedFiles",
"Enable-Backup",
"Enable-ServerBackup",
"Set-FirewallExceptions",
"Set-RegHivePerms",
"Set-EventLogPerms",
"Run-Sysinternals"
)
# Check remote desktop enabled or disabled
if ((Test-Path "C:\rd_*") -eq $false) {
while ($true) {
$answer = Read-Host "Enable or Disable remote desktop? [e/d]"
if ($answer -eq "e") {
New-Item "C:\rd_enable" | Out-Null
$functions[10] = Enable-RemoteDesktop
break
}
if ($answer -eq "d") {
New-Item "C:\rd_disable" | Out-Null
$functions[10] = Disable-RemoteDesktop
break
} else {
Write-Output "Type 'e' or 'd', idiot."
}
}
}
# Check user list or no
if ((Test-Path "C:\ulist_*") -eq $false) {
while ($true) {
$answer = Read-Host "Create the user list? [y/n]"
if ($answer -eq "y") {
New-Item "C:\ulist_yes" | Out-Null
break
}
if ($answer -eq "n") {
New-Item "C:\ulist_no" | Out-Null
break
} else {
Write-Output "Type 'y' or 'n', idiot."
}
}
}
# Run the functions epic
$functions.foreach{Invoke-Expression $_}
$functions_sep.foreach{Start-Process powershell "$_"}
$functions_pt2.foreach{Invoke-Expression $_}