1 / 26

About MS Windows?

About MS Windows?. IDF Lab Advisor (www.idf.cn) CISRG Leader (www.cisrg.cn) Author : 7all (r00t ). 本议题讨论以下方面. 介绍 逆向工程 Windows 启动过程 结束. This paper discuss some popularization technic only. Not any new technic. But nobody write this similar paper. So, I’m write this paper for fun .

lynne
Download Presentation

About MS Windows?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. About MS Windows? IDF Lab Advisor (www.idf.cn) CISRG Leader (www.cisrg.cn) Author: 7all (r00t )

  2. 本议题讨论以下方面 • 介绍 • 逆向工程 • Windows启动过程 • 结束 This paper discuss some popularization technic only. Not any new technic. But nobody write this similar paper. So, I’m write this paper for fun 

  3. Windows is not security? • 介绍 • Windows是否缺乏安全性? • Windows的安全性:网络、注册表、文件系统 • 黑客的思想 • 黑客讨厌闭源软件 • 黑客更喜欢挑战-导致Windows漏洞增多 • 黑客因此鄙视MS的做法 • 由此,很多脚本小子也跟着起哄 • 脚本小子的起哄存在戏剧性

  4. Windows is not security? • 操作系统之间的战争 • Unix、Linux也有很多漏洞,只是因为其免费,没有人开骂。 • MS在漏洞处理方面更加的强大。 • MSRC的做法更完善。 • 小节 • 热爱BSD的内核代码 • 却也喜欢研究下Windows的内部机理 • Windows的内部机理很有意思

  5. 逆向工程 • 为何选择逆向工程? • Windows系统是闭源软件 • 喜欢看汇编代码:如抱女友在怀中的感觉 • 熟悉MS的内部机理需要大量的逆向工作 • Vista需要我们搞逆向工作 • 业余生活无聊 • 测试自己的智商

  6. 逆向工程 • Some useful tools • IDA 5.0 • Windbg • VmWare • Process Explorer

  7. 逆向工程 • Some useful books • 《深入解析Windows操作系统》 • 《Windows.Internals.Fourth.Edition》 • 《Programming the Microsoft Windows Driver Model(2nd)》 • 《X86汇编语言程序设计(英文版)》 • 《Intel指令手册(英文版)》 • Other Help Document:DDK、SDK、MSDN etc…

  8. Windows Startup Process • 启动所需组件

  9. Windows Startup Process • 启动所需组件

  10. Windows Startup Process • 启动阶段 • MBR加载ntldr • Ntldr加载ntoskrnl.exe、hal.dll etc… • Ntoskrnl.exe开始运行 • 内核初始化开始 • Winlogon -> 登陆屏幕 • 启动结束

  11. Windows Startup Process • Ntoskrnl.exe的阶段 • 入口点函数为 KiSystemStartup 通过右边的图示 大家可以很清楚的 看到该函数原型

  12. Windows Startup Process • 判断处理器个数 XP SP2首先判断处理器(CPU)个数,以此做为启动开始的处理动作。如果有多个CPU,则以CPU0为第一顺序处理器;如果只有一个CPU则仅有CPU0可用。

  13. Windows Startup Process • 初始化GDT、IDT、etc…

  14. Windows Startup Process • 经过以下几个处理函数 • KiInitializeTSS(x) • KiInitializePcr(x,x,x,x,x,x,x) • KiSwapIDT()

  15. Windows Startup Process • 初始化HAL • 经过以上几个函数,开始初始化HAL • 把控制权提交给HAL • 只有把控制器提交给HAL,ntoskrnl.exe才能更好的实现内核初始化过程。因为内核仅仅处理内存管理、进程管理、I/O管理等动作,而HAL实现了操作系统内核与硬件的交互。 • HAL:硬件描述层

  16. Windows Startup Process • 依次经过以下函数,进入一关键函数

  17. Windows Startup Process • KdInitSystem(x,x) • Windows判断是否开启内核调试选项 • 从此处开始允许进行内核调试 • 使用Windbg可以开始内核调试 • 内核调试需要双机调试 • 使用VmWare创建双机调试环境

  18. Windows Startup Process • 经过以下处理函数 • KfRaiseIrql(x)

  19. Windows Startup Process • KiInitializeKernel(x,x,x,x,x,x) • 执行内核初始化 • 经过若干函数…… • KiInitSystem(),该函数实现了SSDT初始化 • SSDT在WIN内核是连接用户态、内核态的桥梁 • SSDT:系统服务描述表 • 经过若干函数…… • 该函数结束使命

  20. Windows Startup Process • 跳入IDLE无限循环内 • jmp KiIdleLoop() • IDLE为空闲进程

  21. Windows Startup Process • XP启动过程结束 • Startup Process End

  22. Windbg debug • Windbg调试 • 需双机调试 • VmWare虚拟机的使用

  23. Windbg debug • 经过

  24. Thanks 

  25. Thanks 

  26. Thanks 

More Related