<?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; Reversing</title>
	<atom:link href="http://www.evilsocket.net/category/hacking/reversing-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>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>
		<item>
		<title>Megavideo FLV Downloader</title>
		<link>http://www.evilsocket.net/94/megavideo-flv-downloader.html</link>
		<comments>http://www.evilsocket.net/94/megavideo-flv-downloader.html#comments</comments>
		<pubDate>Mon, 18 May 2009 01:47:32 +0000</pubDate>
		<dc:creator>evilsocket</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Reversing]]></category>
		<category><![CDATA[Sorgenti]]></category>
		<category><![CDATA[decoder]]></category>
		<category><![CDATA[direct download]]></category>
		<category><![CDATA[downloader]]></category>
		<category><![CDATA[flv]]></category>
		<category><![CDATA[megavideo]]></category>
		<category><![CDATA[reverse]]></category>

		<guid isPermaLink="false">http://www.evilsocket.net/?p=94</guid>
		<description><![CDATA[Ormai il gestore Megavideo sta prendendo sempre piÃ¹ piede, cosÃ¬ tempo fa mi sono incuriosito e ho deciso di studiare un po la loro tecnologia, in particolare i sistemi di protezione che impediscono agli utenti NON paganti di visualizzare oltre 70 minuti di filmato . CosÃ¬ reversando sia i pacchetti di comunicazione tra il player [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Ormai il gestore Megavideo sta prendendo sempre piÃ¹ piede, cosÃ¬ tempo fa mi sono incuriosito e ho deciso di studiare un po la loro tecnologia, in particolare i sistemi di protezione che impediscono agli utenti NON paganti di visualizzare oltre 70 minuti di filmato .</p>
<p>CosÃ¬ reversando sia i pacchetti di comunicazione tra il player flash che il codice dello stesso (opportunamente decompilato dalla sua forma swf originaria) ho tirato fuori questo script, che in pratica dato un link megavideo restituirÃ  oltre ad alcune info sul video, il link diretto al file flv usato per lo streaming .</p>
<p><strong>NOTA 1 : </strong>Il link cambia ogni volta ed Ã¨ legato all&#8217;indirizzo ip, quindi scordatevi di usare questo script lato server (da una pagina web in php per intenderci), i link generati dall&#8217;ip del server non sarebbero validi per l&#8217;ip dell&#8217;utente essendo diversi <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  &#8230; con un po di script lato client perÃ² &#8230; <img src='http://www.evilsocket.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><strong>NOTA 2 : </strong>Questa non Ã¨ la cura definitiva, probabilmente (non ho testato fino in fondo) anche il download dell&#8217;flv Ã¨ limitato, ma Ã¨ un inizio, probabilmente un algoritmo molto simile (se non lo stesso con chiavi diverse) Ã¨ utilizzato per collegare il codice del video al link al file originale (disponibile per gli utenti premium), link quest&#8217;ultimo che invece Ã¨ sempre fisso &#8230; presto (spero) ulteriori aggiornamenti .</p>
<p><a href="http://www.evilsocket.net/sources/megavideo_flv_downloader_php.txt" target="_blank">Scarica</a></p>

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

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilsocket.net/94/megavideo-flv-downloader.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Realtime Source Auditing</title>
		<link>http://www.evilsocket.net/70/realtime-source-auditing.html</link>
		<comments>http://www.evilsocket.net/70/realtime-source-auditing.html#comments</comments>
		<pubDate>Wed, 13 May 2009 07:33:51 +0000</pubDate>
		<dc:creator>evilsocket</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Papers]]></category>
		<category><![CDATA[Programmazione]]></category>
		<category><![CDATA[Reversing]]></category>
		<category><![CDATA[Exploiting]]></category>
		<category><![CDATA[ld_preload]]></category>
		<category><![CDATA[reversing]]></category>
		<category><![CDATA[source auditing]]></category>

		<guid isPermaLink="false">http://www.evilsocket.net/?p=70</guid>
		<description><![CDATA[Un paper nel quale illustro una tecnica abbastanza semplice ma che ci puÃ² dare una panoramica piÃ¹ttosto completa di come un applicazione che vogliamo reversare funzioni. Scarica Related posts:Shellcode Generator MySpace Protocol Reversing &#8211; Band Auto Clicker


Related posts:<ol><li><a href='http://www.evilsocket.net/34/shellcode-generator.html' rel='bookmark' title='Permanent Link: Shellcode Generator'>Shellcode Generator</a></li>
<li><a href='http://www.evilsocket.net/731/myspace-protocol-reversing-band-auto-clicker.html' rel='bookmark' title='Permanent Link: MySpace Protocol Reversing &#8211; Band Auto Clicker'>MySpace Protocol Reversing &#8211; Band Auto Clicker</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Un paper nel quale illustro una tecnica abbastanza semplice ma che ci puÃ² dare una panoramica piÃ¹ttosto completa di come un applicazione che vogliamo reversare funzioni.</p>
<p><a href="http://www.evilsocket.net/papers/realtimesourceauditing.pdf" target="_blank">Scarica</a></p>

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

<p>Related posts:<ol><li><a href='http://www.evilsocket.net/34/shellcode-generator.html' rel='bookmark' title='Permanent Link: Shellcode Generator'>Shellcode Generator</a></li>
<li><a href='http://www.evilsocket.net/731/myspace-protocol-reversing-band-auto-clicker.html' rel='bookmark' title='Permanent Link: MySpace Protocol Reversing &#8211; Band Auto Clicker'>MySpace Protocol Reversing &#8211; Band Auto Clicker</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.evilsocket.net/70/realtime-source-auditing.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
