-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRansomwareTestGUI.ps1
More file actions
47 lines (40 loc) · 1.35 KB
/
RansomwareTestGUI.ps1
File metadata and controls
47 lines (40 loc) · 1.35 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
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
# --- OKNO ---
$form = New-Object System.Windows.Forms.Form
$form.Text = "Ransomware Simulation Launcher"
$form.Size = New-Object System.Drawing.Size(400,250)
$form.StartPosition = "CenterScreen"
# --- PRZYCISKI ---
$btnLow = New-Object System.Windows.Forms.Button
$btnLow.Text = "Run LOW test"
$btnLow.Width = 300
$btnLow.Height = 40
$btnLow.Location = New-Object System.Drawing.Point(50,20)
$form.Controls.Add($btnLow)
$btnMed = New-Object System.Windows.Forms.Button
$btnMed.Text = "Run MEDIUM test"
$btnMed.Width = 300
$btnMed.Height = 40
$btnMed.Location = New-Object System.Drawing.Point(50,80)
$form.Controls.Add($btnMed)
$btnHigh = New-Object System.Windows.Forms.Button
$btnHigh.Text = "Run HIGH test"
$btnHigh.Width = 300
$btnHigh.Height = 40
$btnHigh.Location = New-Object System.Drawing.Point(50,140)
$form.Controls.Add($btnHigh)
# --- FUNKCJA URUCHAMIAJĄCA ---
function Run-Test($file) {
if (-Not (Test-Path $file)) {
[System.Windows.Forms.MessageBox]::Show("Brak skryptu: $file")
return
}
powershell -NoProfile -ExecutionPolicy Bypass -File $file
}
# --- AKCJE ---
$btnLow.Add_Click({ Run-Test "Test-Low.ps1" })
$btnMed.Add_Click({ Run-Test "Test-Medium.ps1" })
$btnHigh.Add_Click({ Run-Test "Test-High.ps1" })
# --- START ---
$form.ShowDialog()