ring0 程序隱藏實現

2022-07-16 15:36:13 字數 1852 閱讀 6556

最近在學習核心程式設計,記錄一下最近的學習筆記。

原理:將當前程序從eprocess結構的鍊錶中刪除

無法被! process 0 0 看見 

#include 

"hideprocess.h

"#ifdef win64

#define activeprocesslinks_eprocess 0x188

#define imagefilename_eprocess 0x2e0 //

16個位元組組成的單字陣列

#else

#define activeprocesslinks_eprocess 0x088

#define imagefilename_eprocess 0x174 //

16個位元組組成的單字陣列

#endif

ntstatus

driverentry(pdriver_object driverobject,punicode_string registerpath)

status = iocreatesymboliclink(&linkname,&devicename);

for (i = 0; i)

driverobject->driverunload =unloaddriver;

if (hideprocess("

notepad.exe

") ==false)

#ifdef win64

dbgprint(

"win64: hideprocess is running!!!");

#else

dbgprint(

"win32: hideprocess sis running!!!");

#endif

return

status_success;

}ntstatus

defaultpassthrough(pdevice_object deviceobject,pirp irp)

void

unloaddriver(pdriver_object driverobject)

dbgprint(

"hideprocess is stopped!!!");

}boolean hideprocess(

char*processimagename)

imagefilename = (char*)((uint8*)v1 +imagefilename_eprocess);

dbgprint(

"currentimagefilename:%s\r\n

", imagefilename);

v1 = eprocess; //

system.exe eprocess

的前乙個 實際上是乙個空頭節點

listentry = (plist_entry)((uint8*)eprocess + activeprocesslinks_eprocess); //

0x188

emptyeprocess = (peprocess)(((ulong_ptr)(listentry->blink)) -activeprocesslinks_eprocess);

listentry =null;

while (v1 != emptyeprocess) //

system!=空頭節點

}v1 = (peprocess)(((ulong_ptr)(listentry->flink)) - activeprocesslinks_eprocess); //

calc

}

return

true;

}

Ring0 鍊錶

一般驅動層不使用資料結構,一般ring3層 雙向鍊錶可以將鍊錶形成乙個環.blink指標指向前乙個元素,flink指標指向下乙個元素.typedef struct list entry list entry,plist entry,restricted pointer prlist entry 初始...

列舉程序 暴力搜尋記憶體(Ring0)

上面說過了隱藏程序,這篇部落格我們就簡單描述一下暴力搜尋程序。乙個程序要執行,必然會載入到記憶體中,斷鏈隱藏程序只是把eprocess從鍊錶上摘除了,但它還是駐留在記憶體中的。這樣我們就有了找到它的方法。在核心中,傳入程序id,通過zwopenprocess得到控制代碼,再傳入控制代碼,通過obre...

ring0和ring3的區別

現在 核心程式和應用程式之間的本質區別。除了能用wdk編寫核心程式和閱讀一部分windows的核心 之外,我們還需要了解它們的本質是什麼,它們和我們熟悉的應用程式有什麼區別。intel的x86處理器是通過ring級別來進行訪問控制的,級別共分4層,從ring0到ring3 後面簡稱r0 r1 r2 ...