ring0层api调用流程分析

1.用windbg反汇编查看下KiFastCallEntry函数




2.查看下_KPCR结构,ebx偏移124指向_ETHREAD结构


3.知道esi 指向_ETHREAD这个结构,esi偏移0x0bc,指向系统服务描述符表(ssdt)




4.ssdt表查看分析
   结构
   typedef struct _tagSSDT {   
    PVOID pvSSDTBase;   //“系统服务描述符表”的基地址
    PVOID pvServiceCounterTable;   //指向另一个索引表
    ULONG ulNumberOfServices;   //当前系统所支持的服务个数
    PVOID pvParamTableBase;   //系统服务参数表
   } SSDT, *PSSDT;

5.内核api分析 ZwQuerySystemInformation

6.内核api经过KiSystemService->KiFastCallEntry




7.最后的函数调用


8.总结
其实不管是用户层api(SYSENTER从ring3层跨到ring0层)还是内核层的api都会经过KiFastCallEntry进行处理(KiFastCallEntry主要是完成在ssdt表里寻找具体的函数),平常在ring3层看到的只是简单的外壳,没有具体实现的代码。
用户层api流程:ring3层api->SYSENTER从ring3层跨到ring0层,再经过KiFastCallEntry.
内核层api流程:ring0层api->KiSystemService->KiFastCallEntry

评论

此博客中的热门博文

Opencart-v3-0-3-0 user changes password at csrf vulnerability

Docker's latest version of privilege escalation vulnerability

Charles 4.2.7 XML External Entity