0x00 背景
最近发现osxpmem在我的mac上会时不时panic,于是对panic日志进行了分析,提了一个pull request: https://github.com/google/rekall/pull/486。下面介绍我是如何分析这个panic日志的。kext部分的分析可以直接参考这个pull request的comment。
0x01 手法
- 下载你的Mac版本对应的kernel debug kit https://developer.apple.com/download/more/?q=Kernel%20Debug%20Kit,并安装。
- lldb /Library/Developer/KDKs/KDK_10.13.6_17G6022.kdk/System/Library/Kernels/kernel
- (lldb) target create "/Library/Developer/KDKs/KDK_10.13.6_17G6022.kdk/System/Library/Kernels/kernel"
- (lldb) settings set target.load-script-from-symbol-file true
- 这里根据你的panic report调整kernel的slide:
(lldb) target modules load --file kernel --slide 0x0000000018c00000 - (lldb) image lookup -a 0xffffff8019420136
如果你想查看对应的kernel的源代码,可以用uname -a
先列出xnu kernel的版本,然后在https://github.com/apple/darwin-xnu上对应的branch查看源代码。
0x02 参考
https://lists.apple.com/archives/darwin-kernel/2014/Jan/msg00011.html