-
Notifications
You must be signed in to change notification settings - Fork 1
/
bsod.cs
27 lines (25 loc) · 885 Bytes
/
bsod.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
// made by https://github.com/chainski
// C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /unsafe /platform:x64 /preferreduilang:en-US /out:bsod.exe /target:exe bsod.cs
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
namespace NTRaiseHardError
{
public class Program
{
[DllImport("ntdll.dll", SetLastError = true)]
static extern void RtlSetProcessIsCritical(UInt32 v1, UInt32 v2, UInt32 v3);
public static void Main()
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("[+] RtlSetProcessIsCritical is ENABLED, terminating this process will result in a BSOD");
Process.EnterDebugMode();
RtlSetProcessIsCritical(1, 0, 0);
while (true)
{
Thread.Sleep(1);
}
}
}
}