资源预览内容
第1页 / 共43页
第2页 / 共43页
第3页 / 共43页
第4页 / 共43页
第5页 / 共43页
第6页 / 共43页
第7页 / 共43页
第8页 / 共43页
第9页 / 共43页
第10页 / 共43页
亲,该文档总共43页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院信息安全技术信息安全技术信息安全技术信息安全技术隐藏进程和程序的实例隐藏进程和程序的实例隐藏进程和程序的实例隐藏进程和程序的实例主讲人:裴士辉 e_mail: shihui_peisina.com主讲人:裴士辉 e_mail: shihui_peisina.com信息安全技术信息安全技术信息安全技术信息安全技术计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院内容内容内容内容内核信息的查询的一个实例内核信息的查询的一个实例隐藏进程和程序隐藏进程和程序信息安全技术信息安全技术信息安全技术信息安全技术计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院内核信息的查询的一个实例内核信息的查询的一个实例信息安全技术信息安全技术信息安全技术信息安全技术计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院实例:内核信息的查询实例:内核信息的查询实例:内核信息的查询实例:内核信息的查询基础知识:基础知识: 用户模式和内核模式用户模式和内核模式 Windows API的执行过程Windows API的执行过程 KiServiceTableKiServiceTable Interrupt DescirptorTableInterrupt DescirptorTable编程过程编程过程信息安全技术信息安全技术信息安全技术信息安全技术计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院用户模式和内核模式用户模式和内核模式用户模式和内核模式用户模式和内核模式从Intel80386开始,分为ring0ring3四个级别。从Intel80386开始,分为ring0ring3四个级别。运行于较低级别的代码不能随意调用高级别的代码和访问较高级别的数据。运行于较低级别的代码不能随意调用高级别的代码和访问较高级别的数据。WindowsNT只运用了其中两个级别:WindowsNT只运用了其中两个级别: 内核模式:对应80x86的ring0层,是操作系统的核心部分;内核模式:对应80x86的ring0层,是操作系统的核心部分; 用户模式:对应80x86的ring3层,操作系统的用户接口部分。用户模式:对应80x86的ring3层,操作系统的用户接口部分。信息安全技术信息安全技术信息安全技术信息安全技术计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院Windows API的执行过程Windows API的执行过程Windows API的执行过程Windows API的执行过程信息安全技术信息安全技术信息安全技术信息安全技术计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院Windows API的执行过程Windows API的执行过程Windows API的执行过程Windows API的执行过程信息安全技术信息安全技术信息安全技术信息安全技术计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院Interrupt Descriptor TableInterrupt Descriptor TableInterrupt Descriptor TableInterrupt Descriptor TableThe Interrupt Descriptor Table (IDT) is a data structure used by the x86 architecture to implement an interrupt vector table. The IDT is used by the processor to determine the correct response to interrupts and exceptions. Use of the IDT is triggered by three types of events: hardware interrupts, software interrupts, and processor exceptions, which together are referred to as “interrupts“. The IDT consists of 256 interrupt vectorsthe first 32 (0-31 or 00-1F) of which are reserved for processor exceptions.信息安全技术信息安全技术信息安全技术信息安全技术计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院编程实现编程实现编程实现编程实现1、C kerneldriver. The kernel driver responds to three different IO requests: IOCTL_GET_MODULE_NAME: the driver tries to find a module name for a specific address. IOCTL_GET_SERVICE_TABLE: the driver copies the complete KiServiceTable into the output buffer. IOCTL_GET_INT_TABLE: the driver copies the complete Interrupt Descriptor Table into the output buffer. 2、C# GUI 信息安全技术信息安全技术信息安全技术信息安全技术计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院C# GUIC# GUIC# GUIC# GUIClass ServiceInstallerClass DriverClass MainForm信息安全技术信息安全技术信息安全技术信息安全技术计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院Class ServiceInstallerClass ServiceInstallerClass ServiceInstallerClass ServiceInstallerIt is a wrapper class for the Windows Service APIs. The class contains two methods: InstallService:load our little kerneldriver; UnInstallService. unload our little kerneldriver信息安全技术信息安全技术信息安全技术信息安全技术计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院Class DriverClass DriverClass DriverClass DriverThis is the core of the program. It interacts with the driver and evaluates the received data.public bool Open(string name) / opens a device with the CreateFileAPI private unsafe int Interact( / Interact method communicates with /the driver with the DeviceIoControlAPI uint IoControlCode, /control code for the driver byte inBuffer, /input buffer, send to the driver byte outBuffer) /output buffer, receive from the driver public unsafe KiServiceTable GetKiServiceTable() / IOCTL_GET_SERVICE_TABLE public unsafe InterruptTable GetInterruptTable() / IOCTL_GET_INT_TABLE public unsafe string GetModuleName(uint addr) / IOCTL_GET_MODULE_NAME信息安全技术信息安全技术信息安全技术信息安全技术计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院Class MainFormClass MainFormClass MainFormClass MainFormThis class handles the UI, calls the kernel service with the help of the Driver class, and fills the list views with the received and evaluated data.LookupDriver.Load(); /load driver as a servicekiServiceTable = LookupDriver.GetKiServiceTable() ;/create the kiServiceTableand get it from the kernel serviceLookupDriver.GetKiServiceNames(kiServiceTable); /resolve every service number into its name from ntdll.dllFillServiceTableList(); /put the entries into the list field信息安全技术信息安全技术信息安全技术信息安全技术计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院计算机科学与技术学院kernel driverkernel driverkernel driverkernel driverThe driver responds to three different IO requestsIOCTL_GET_MODULE_NAMEIOCTL_GET_SERVICE_TABLEIOCTL_GET_INT_TABLEcase IOCTL_GET_MODULE_NAME: /get a module name for a address /address from the input buffer, first dword addr = (DWORD *)inBuf)0; /call getmodulename name = GetModuleName(addr); / ZwQuerySystemInformation() if(name != 0) /module name found memcpy(outBuf, name, strlen(name); else memcpy(outBuf, “unkown0“, 7); Irp-IoStatus.Information = outBufLength; ntStatus = STATUS_SUCCESS; break; case IOCTL_GET_SERVICE_TABLE: /get complete service table /number of services avaiblein the c
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号