首页
社区
课程
招聘
[旧帖] [原创]发个老的 - 如何debug lsass.exe 0.00雪花
发表于: 2009-5-27 19:25 2051

[旧帖] [原创]发个老的 - 如何debug lsass.exe 0.00雪花

2009-5-27 19:25
2051
这两天需要调试lsass.exe, 昨天baidu竟然都查不到什么信息。lsass有它的一些特点。首先它是运行在user mode, 因此一般来讲应该用user mode的调试工具来调试。可是,如果用debuuger直接跟它相连,计算机就会自动重启,使得调试无法进行下去。其次,如果我们想在机器启动的时候调试lsass也比较麻烦,因为user mode debugger那个时候还不能工作。再次,调试lsass的时候,网络的访问不能进行,因此从网络上访问symbols and source code 也成为了不可能。经过认真研究,发现有三种方法可以用来调试lsass,并且各有优缺点。下面就一一讲解一下。

1. ntsd piped through KD

a. 修改注册表

HKLM\Software\Microsoft\Windows NT\CurrenVersion\Image File Execution Options\lsass.exe debugger = REG_SZ c:\debuggers\ntsd.exe -d -g -G

b. 用另一台机器通过kernal debugger和测试机相连

c.重起测试机

这样的话,在启动阶段,当系统调起lsass的时候,测试机的ntsd就开始工作,并且将输入,输出传送到kernal debugger上。这个属于在kernal debugger里进行user mode的调试。

优点:可以在启动的时候调试lsass。

缺点:symbols and source files 必须要copy在测试机上。(不太方便)

2.Debugging LSA via dbgsrv.exe

a.Find the PID for LSA via tlist.exe

b. C:\Program Files\Debugging Tools for Windows>dbgsrv.exe -t tcp:port=1234,password=spat

c.Run this command to attach to LSA on the remote machine.

I:\debugger>windbg.exe -premote tcp:server=192.168.1.102,port=1234,password=spat -p 596  -- where 596 = PID of LSASS

优点:symbols and source files 可以在调试机上

缺点:不能在启动的时候进行调试

3.Debugging LSA from Kernel

a. Get the process address for LSASS

0: kd> !process 0 0 lsass.exe

PROCESS 815196c0 SessionId: 0 Cid: 010c Peb: 7ffdf000 ParentCid: 00e4

DirBase: 042d2000 ObjectTable: 81519aa8 TableSize: 859.

Image: LSASS.EXE

b. Switch to the process context:

Either

.process /p /r 815196c0

Or

.process –i 815196c0 ;g;.reload /user

优点:symbols and source files 可以在调试机上,可以进行log out/ log on 过程的调试

缺点:不能在启动的时候进行调试

因此,如果想在启动的时候调试,就必然要选方法1。如果想在log on的时候调试,选择方法3。其他情况,可以选择方法2,或者方法3。

[课程]Android-CTF解题方法汇总!

收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 1334
活跃值: (15)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
无法给你,你没有邮箱信息
2009-5-28 17:48
0
雪    币: 75
活跃值: (10)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
3
可能我没有选接收管理员邮件,现在选上了。如果还不对,给你发邮件了,邮件里有。
2009-5-28 23:59
0
游客
登录 | 注册 方可回帖
返回
//