<?xml version="1.0" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="css/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Langouster 's   Blog(虾 窝) - 驱动开发</title><link>http://www.langouster.com/</link><description>欢迎来到“虾 窝”  - </description><generator>RainbowSoft Studio Z-Blog 2.0 bate Build</generator><language>zh-CN</language><copyright>Copyright langouster. Some Rights Reserved.&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;苏ICP备06046736号 &amp;amp;nbsp;&amp;amp;nbsp;</copyright><pubDate>Tue, 07 Sep 2010 14:41:24 +0800</pubDate><item><title>POOL驱动不能处理异常的解决方法</title><author>langouster@163.com (langouster)</author><link>http://www.langouster.com/HTML/116.html</link><pubDate>Sat, 28 Aug 2010 10:51:35 +0800</pubDate><guid>http://www.langouster.com/HTML/116.html</guid><description><![CDATA[<p>相信越来越多的人都喜欢把驱动代码放到Pool里执行，但由此会产生一个问题，在Pool里的驱动代码是不能出异常的，所有的异常处理都会失效，在有些我们不得不使用异常，如操作Ring3内存，这时我们就必须解决掉这个问题。</p><p>X86和x64在异常处理上稍有一些不同，先来看x86上的异常处理。</p><p>系统捕获到异常后会执行到函数<font face="Verdana">RtlDispatchException，函数<font face="Verdana">RtlDispatchException再调用<font face="Verdana">RtlLookupFunctionEntry，<font face="Verdana">RtlLookupFunctionEntry函数再调用<font face="Verdana">RtlLookupFunctionTable。<font face="Verdana">RtlLookupFunctionTable这个函数的作用是在<font face="Verdana">PsLoadedModuleList链在根据异常的EIP地址</font>找到发生异常的模块。由于Pool里执行的代码不属于任何一个模块，这个函数就会返回失败，异常处理就会失去作用，产生一个蓝屏。</font></font></font></font></font></font></p><p><font face="Verdana"><font face="Verdana"><font face="Verdana"><font face="Verdana"><font face="Verdana"><font face="Verdana">......</font></font></font></font></font></font></p>]]></description><category>驱动开发</category><comments>http://www.langouster.com/HTML/116.html#comment</comments><wfw:comment>http://www.langouster.com/</wfw:comment><wfw:commentRss>http://www.langouster.com/feed.asp?cmt=116</wfw:commentRss><trackback:ping>http://www.langouster.com/cmd.asp?act=tb&amp;id=116&amp;key=3fb3780a</trackback:ping></item><item><title>ObRegisterCallbacks返回0xC0000022(拒绝访问)解决方案</title><author>langouster@163.com (langouster)</author><link>http://www.langouster.com/HTML/115.html</link><pubDate>Tue, 24 Aug 2010 10:33:39 +0800</pubDate><guid>http://www.langouster.com/HTML/115.html</guid><description><![CDATA[<p><font face="Verdana">ObRegisterCallbacks这个函数是在Vista sp1之后的版本中添加的，可用来监控系统中对进线程句柄的操作，如打开进程、复制线程句柄等。</font></p><p>但是使用这个函数对驱动有特殊的要求，必须使用特殊的签名才行！否则这个函数会返回<font face="Verdana">0xC0000022(拒绝访问)，逆向此函数可以看到以下是有关是否加签名的判断：</font></p><p>...</p>]]></description><category>驱动开发</category><comments>http://www.langouster.com/HTML/115.html#comment</comments><wfw:comment>http://www.langouster.com/</wfw:comment><wfw:commentRss>http://www.langouster.com/feed.asp?cmt=115</wfw:commentRss><trackback:ping>http://www.langouster.com/cmd.asp?act=tb&amp;id=115&amp;key=707b877e</trackback:ping></item><item><title>Ring0上调用未导出Zw函数通用函数</title><author>langouster@163.com (langouster)</author><link>http://www.langouster.com/HTML/112.html</link><pubDate>Sun, 18 Jul 2010 21:46:13 +0800</pubDate><guid>http://www.langouster.com/HTML/112.html</guid><description><![CDATA[<p><font face="Verdana">前段时间写的一段无聊代码，可能对大家有点用。用于在驱动里调用一些没有直接导出的Zw函数，如ZwProtectVirtualMemory。在此感谢alpha提供思路。</font></p><p><font face="Verdana">BOOLEAN CallZwFunction(CONST CHAR *FunctionName,PVOID pCallRet,ULONG ArgNum,...)<br />{<br />&nbsp;char *vl;<br />&nbsp;BOOLEAN retval = FALSE;<br />&nbsp;ULONG FunctionIndex;<br />&nbsp;ULONG CallRet;<br />&nbsp;ULONG Argv[20],temp;<br />&nbsp;LONG i;<br />&nbsp;ULONG FunctionAddr;<br />&nbsp;BYTE Sign[]=&quot;\xb8\x44\x00\x00\x00&quot;;<br />&nbsp;BYTE *p;</font></p><p>...</p>]]></description><category>驱动开发</category><comments>http://www.langouster.com/HTML/112.html#comment</comments><wfw:comment>http://www.langouster.com/</wfw:comment><wfw:commentRss>http://www.langouster.com/feed.asp?cmt=112</wfw:commentRss><trackback:ping>http://www.langouster.com/cmd.asp?act=tb&amp;id=112&amp;key=31d02c77</trackback:ping></item><item><title>进程创建过程 关键函数执行顺序</title><author>langouster@163.com (langouster)</author><link>http://www.langouster.com/HTML/109.html</link><pubDate>Wed, 05 May 2010 16:45:36 +0800</pubDate><guid>http://www.langouster.com/HTML/109.html</guid><description><![CDATA[<P>监控下一个进程的创建过程，关键函数的执行先后关系如下：</P><P>XP sp3下:</P><P>1.NtCreateProcessEx</P><P>2.NtCreateThread</P><P>3.CreateProcessNotify，调用创建进程回调函数，在PspCreateThread中调用</P><P>4.CreateThreadNotify，调用创建线程回调函数，在PspCreateThread中调用</P><P>Vista、Win7下:</P><P>1.NtCreateUserProcess-&gt;PspInsertThread</P>...]]></description><category>驱动开发</category><comments>http://www.langouster.com/HTML/109.html#comment</comments><wfw:comment>http://www.langouster.com/</wfw:comment><wfw:commentRss>http://www.langouster.com/feed.asp?cmt=109</wfw:commentRss><trackback:ping>http://www.langouster.com/cmd.asp?act=tb&amp;id=109&amp;key=539f3ef9</trackback:ping></item><item><title>双向链表的添加、查找、删除算法</title><author>langouster@163.com (langouster)</author><link>http://www.langouster.com/HTML/105.html</link><pubDate>Sat, 27 Mar 2010 15:35:10 +0800</pubDate><guid>http://www.langouster.com/HTML/105.html</guid><description><![CDATA[<P><FONT face=Verdana>前段时间看一个很早前写的驱动，发现对双向链表的操作还有BUG，删除时会蓝屏，修正了一下，把修正后的代码贴出来，方便日后使用前直接复制，大牛不用看了。</FONT></P><DIV align=left>&nbsp;</DIV><DIV align=left>&nbsp;</DIV><DIV align=left>typedef struct _FILELIST</DIV><DIV align=left>{</DIV><DIV align=left>&nbsp;&nbsp;&nbsp;&nbsp; LIST_ENTRY ListEntry;</DIV>...]]></description><category>驱动开发</category><comments>http://www.langouster.com/HTML/105.html#comment</comments><wfw:comment>http://www.langouster.com/</wfw:comment><wfw:commentRss>http://www.langouster.com/feed.asp?cmt=105</wfw:commentRss><trackback:ping>http://www.langouster.com/cmd.asp?act=tb&amp;id=105&amp;key=85ab82dc</trackback:ping></item><item><title>利用0day在win7下从user权限提升到system权限演示</title><author>langouster@163.com (langouster)</author><link>http://www.langouster.com/HTML/104.html</link><pubDate>Sat, 20 Mar 2010 23:27:23 +0800</pubDate><guid>http://www.langouster.com/HTML/104.html</guid><description><![CDATA[<p>此演示完成user权限下以system权限运行指定程序,利用的是前几篇文章说的那个系统驱动的溢出漏洞。</p><p>利用成功后可看到Services.exe以system权限运行了C:\Users\test\Desktop\1.exe。</p>]]></description><category>驱动开发</category><comments>http://www.langouster.com/HTML/104.html#comment</comments><wfw:comment>http://www.langouster.com/</wfw:comment><wfw:commentRss>http://www.langouster.com/feed.asp?cmt=104</wfw:commentRss><trackback:ping>http://www.langouster.com/cmd.asp?act=tb&amp;id=104&amp;key=5a2fc872</trackback:ping></item><item><title>编写不影响继续执行的栈溢出shellcode，拒绝不返回，拒绝崩溃</title><author>langouster@163.com (langouster)</author><link>http://www.langouster.com/HTML/103.html</link><pubDate>Sat, 20 Mar 2010 23:04:36 +0800</pubDate><guid>http://www.langouster.com/HTML/103.html</guid><description><![CDATA[<p>上次说的溢出0day的shellcode终于写完了，开始遇到了不少困难，但都一一解决了。</p><p>一开始，像大多数其它溢出那样，执行完shellcode后就sleep等死，可是这里不行，在进入有漏洞的函数前，系统占了一个锁，如果等死了，整个系统也立马卡死。函数调用是像下面这样的：</p><p>call func2()<br />{<br />&nbsp;&nbsp;&nbsp; getlocker();<br />&nbsp;&nbsp;&nbsp; bugfunc();//存在溢出的函数<br />...</p>]]></description><category>驱动开发</category><comments>http://www.langouster.com/HTML/103.html#comment</comments><wfw:comment>http://www.langouster.com/</wfw:comment><wfw:commentRss>http://www.langouster.com/feed.asp?cmt=103</wfw:commentRss><trackback:ping>http://www.langouster.com/cmd.asp?act=tb&amp;id=103&amp;key=3ff459e4</trackback:ping></item><item><title>驱动枚举所有快捷键</title><author>langouster@163.com (langouster)</author><link>http://www.langouster.com/HTML/102.html</link><pubDate>Fri, 19 Mar 2010 20:48:48 +0800</pubDate><guid>http://www.langouster.com/HTML/102.html</guid><description><![CDATA[<p>在win32k中存在一个单向链表，这个链表中保存着当前子系统下的所有快捷键，保存这个单向链表的头的全局变量为_gphkFirst，这个全局变量在_RegisterHotKey、IsHotKey等函数中有使用。</p><p>下面是我在xp下逆向分析出的这个链表的结构：</p><p>typedef struct _HOTKEY<br />{<br />&nbsp;&nbsp;&nbsp; PVOID Win32Thread;<br />&nbsp;&nbsp;&nbsp; ULONG gptiCurrent;<br />...</p>]]></description><category>驱动开发</category><comments>http://www.langouster.com/HTML/102.html#comment</comments><wfw:comment>http://www.langouster.com/</wfw:comment><wfw:commentRss>http://www.langouster.com/feed.asp?cmt=102</wfw:commentRss><trackback:ping>http://www.langouster.com/cmd.asp?act=tb&amp;id=102&amp;key=29901919</trackback:ping></item><item><title>文件过滤驱动要小心分配内存</title><author>langouster@163.com (langouster)</author><link>http://www.langouster.com/HTML/97.html</link><pubDate>Thu, 11 Mar 2010 19:43:34 +0800</pubDate><guid>http://www.langouster.com/HTML/97.html</guid><description><![CDATA[<p>最近拿到一个DUMP，是个栈溢出蓝屏，罪魁祸首是一个文件过滤驱动，这个文件过滤驱动的过滤例程使用ExAllocatePool分配了一个可分页内存，这个行为看似非常正常与普通，却容易造成蓝屏。</p><p>原因如下：</p><p>文件过滤驱动申请可分页内存时，系统可能内存不足，使的这块内存从虚拟内存中分配，这就要操作虚拟内存文件PageFile.sys，<br />这个文件操作再次被文件过滤驱动监控到，并再次申请一块内存，造成重入，驱动栈内存使用光时就蓝了。。。。<br />&nbsp;</p><p>...</p>]]></description><category>驱动开发</category><comments>http://www.langouster.com/HTML/97.html#comment</comments><wfw:comment>http://www.langouster.com/</wfw:comment><wfw:commentRss>http://www.langouster.com/feed.asp?cmt=97</wfw:commentRss><trackback:ping>http://www.langouster.com/cmd.asp?act=tb&amp;id=97&amp;key=6a968a24</trackback:ping></item><item><title>64位下好神奇啊</title><author>langouster@163.com (langouster)</author><link>http://www.langouster.com/HTML/92.html</link><pubDate>Thu, 12 Nov 2009 16:40:18 +0800</pubDate><guid>http://www.langouster.com/HTML/92.html</guid><description><![CDATA[<p>近期可能会有一个64位平台的驱动开发任务，找了些资料，对64位平台下的驱动开发略知一二了，感觉好神奇。</p><p>一。在64位系统下，有一项PatchGuard技术，它是微软为了防止自己的代码被Patch，进而影响系统的稳定性引入的，这项技术会检查以下内容有没有被恶意修改过：</p><p>1- SSDT (System Service Descriptor Table)&nbsp;<br />2- GDT (Global Descriptor Table)&nbsp;<br />3- IDT (Interrupt Descriptor Table)&nbsp;<br />...</p>]]></description><category>驱动开发</category><comments>http://www.langouster.com/HTML/92.html#comment</comments><wfw:comment>http://www.langouster.com/</wfw:comment><wfw:commentRss>http://www.langouster.com/feed.asp?cmt=92</wfw:commentRss><trackback:ping>http://www.langouster.com/cmd.asp?act=tb&amp;id=92&amp;key=4c6bff86</trackback:ping></item></channel></rss>
