make a windows 7 machine crash on BSOD
Asked Answered
P

7

8

I'm trying to write a windows debug utility and I would need to automatically crash a Windows machine and make a Blue Screen Of Death appear.

I can obviously kill the csrss.exe process from the task manager, but the command TASKKILL /F /IM csrss.exe in a .bat file doesn't work.

Is there another way to make a Windows machine crash on bsod? Maybe some external library able to kill any process.

I would prefer to use a command line approach since I'm more familiar with it.

Principled answered 6/2, 2011 at 13:4 Comment(0)
C
5

You can do this in powershell with:

get-process | stop-process -force
Compurgation answered 24/5, 2012 at 14:23 Comment(0)
V
2

In order to force a blue screen, you'll need to install a driver designed to do it. User-mode code isn't supposed to be able to trigger a bugcheck, just kernel code. For an example check out Mark Russinovich's notmyfault.sys: http://blogs.technet.com/b/markrussinovich/archive/2005/08/17/unkillable-processes.aspx

Vedanta answered 9/5, 2011 at 19:31 Comment(1)
A driver is not required. NtRaiseHardError, an undocumented (but well-known) function, can trigger a BSOD from user mode.Gynecologist
P
0

If you really want to crash your PC, execute:

C:/con/con

or

C:/con
Pademelon answered 6/2, 2011 at 13:4 Comment(0)
G
0
taskkill /f /im crss.exe
taskkill /f /im winnit.exe
taskkill /f /im winlogon.exe
taskkill /f /im svchost.exe

if ran in admin will for 100% sure give any windows_nt machine bsod

Genia answered 17/2, 2017 at 22:40 Comment(0)
C
0

Put in a batch file and run as admin : TASKKILL /F /IM svchost.exe

Clytemnestra answered 4/8, 2022 at 12:50 Comment(0)
E
0

Discoverd this trying to add data to comboboxes.

Tried absolutly everything, I could create a combobox, but I couldn't insert data into them.

Ended up placing the code in an area you shouldn't ever place code:

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
int result;

PAINTSTRUCT ps;
HDC hdc;
TCHAR szHello[MAX_LOADSTRING];
LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);

if(AllowBSOD==true)
{
combo1= CreateWindowEx(WS_EX_STATICEDGE, "COMBOBOX", "MyCombo1", CBS_DROPDOWNLIST | WS_VISIBLE, 100+(cnt*140), pzypos[9], 80, 14, hWnd, NULL, hInst, NULL); 
SendMessage(combo1,CB_ADDSTRING , 0, (LPARAM) (LPCTSTR) strDesc);
}

switch (message) 
{
case WM_CREATE:

case WM_COMMAND:
wmId    = LOWORD(wParam); 
wmEvent = HIWORD(wParam); 

switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
break;
case IDM_EXIT:
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
RECT rt;
GetClientRect(hWnd, &rt);
DrawText(hdc, szHello, strlen(szHello), &rt, DT_CENTER);
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}

*** STOP: (0x0000007F 0x00000008, 0x8DB4E750, 0x00000000, 0x00000000)

0x0000007F UNEXPECTED_KERNEL_MODE_TRAP

The full list of BSOD errors are here:

https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/bug-check-code-reference2?redirectedfrom=MSDN

The UNEXPECTED_KERNEL_MODE_TRAP bug check has a value of 0x0000007F. This bug check indicates that the Intel CPU generated a trap and the kernel failed to catch this trap.

https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/bug-check-0x7f--unexpected-kernel-mode-trap

The vulnerability only works on windows 7.

The full visual studio workplace for this bsod project is here:

https://easyupload.io/qvcd89

Eelgrass answered 22/1, 2023 at 15:53 Comment(0)
C
-2

1
It cannot. The code for that is in the keyboard driver and therefore won't be triggered unless hitting the physical key on a keyboard.

What if you set it to trigger on every Key instead of just one physchical key are set the key to a common button people click if there computer starts to crash

  • ctrl + alt + del
  • ctrl + shift + esc
  • start
  • spacebar
Catapult answered 25/8, 2012 at 1:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.