<?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>It should work... &#187; linux</title>
	<atom:link href="http://vierito.es/wordpress/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://vierito.es/wordpress</link>
	<description>Cuando cualquier trasto es útil</description>
	<lastBuildDate>Sat, 09 Jul 2011 02:34:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Port-Knocking y Crypt-Port-Knocking</title>
		<link>http://vierito.es/wordpress/2009/09/25/port-knocking-y-crypt-port-knocking/</link>
		<comments>http://vierito.es/wordpress/2009/09/25/port-knocking-y-crypt-port-knocking/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 16:28:05 +0000</pubDate>
		<dc:creator>vierito5</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Crypt Port Knocking]]></category>
		<category><![CDATA[hping]]></category>
		<category><![CDATA[OpenSSL]]></category>
		<category><![CDATA[Port Knocking]]></category>
		<category><![CDATA[Replay Attack]]></category>
		<category><![CDATA[Single Packet Authentication]]></category>

		<guid isPermaLink="false">http://vierito.es/wordpress/?p=687</guid>
		<description><![CDATA[Estaba curioseando por foros de Gentoo cuando me encontré un post interesante sobre una evolución del clásico Port-Knocking,  pero vayamos por pasos. Port-Knocking Cuando nosotros tenemos un servicio en un servidor, éste, escucha en uno o varios puertos las peticiones externas. Este puerto deberá estar abierto en el firewall para que se puedan efectuar estas [...]]]></description>
			<content:encoded><![CDATA[<p>Estaba curioseando por <a title=\"Gentoo Forums\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2ZvcnVtcy5nZW50b28ub3JnLw==">foros de Gentoo</a> cuando me encontré un post interesante sobre una <a title=\"Crytp Port Knocking\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2ZvcnVtcy5nZW50b28ub3JnL3ZpZXd0b3BpYy10LTY4Nzk1Ni5odG1s">evolución del clásico Port-Knocking</a>,  pero vayamos por pasos.</p>
<h3><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA5L3ByaXNvbi5qcGc="></a></h3>
<p style="text-align: center;"><img class="size-full wp-image-688  aligncenter" title="prison" src="http://vierito.es/wordpress/wp-content/uploads/2009/09/prison.jpg" alt="prison" width="470" height="300" /></p>
<h2>Port-Knocking</h2>
<p>Cuando nosotros tenemos un servicio en un servidor, éste, escucha en uno o varios puertos las peticiones externas. Este puerto deberá estar abierto en el firewall para que se puedan efectuar estas conexiones. La idea del <strong>Port Knocking</strong> es que el puerto del servicio permanece cerrado y <strong>sólo se abrirá bajo una petición externa basada en un paquete o grupo de paquetes específicos</strong>, previamente conocidos por el cliente, que serán enviados al servidor. Es decir, yo tendría mi servidor ssh con el puerto 22 cerrado y cuando un cliente envíe un paquete con ciertas características a otro puerto entonces el puerto 22 se abriría temporalmente para ese cliente. De este modo permanecería <strong>escondido</strong> antes escaneos de puertos e intentos automatizados de fuerza bruta, por ejemplo. Este sistema se podría ir mejorando:</p>
<ul>
<li>que tenga que ser <strong>una secuencia</strong> de puertos y no uno sólo</li>
<li>que además tengan que ser unos <strong>puertos de origen específicos</strong></li>
<li>combinarlo con otras herramientas: <strong>Portsentry</strong>, denyhost, fail2ban (destaco la primera herramienta  ya que es una forma fácil de banear intentos de escaneos sin el uso de un IDS completo ni cortafuegos)</li>
<li>jugar con las FLAGs TCP y opciones poco comunes de los paquetes</li>
<li><strong>abrir el puerto sólo para la IP llamante</strong>, no todas</li>
<li>&lt;paranoic&gt;requerir una <strong>temporización</strong> determinada (algo elástica, claro está) entre en el envío de los paquetes&lt;/paranoic&gt;</li>
<li>y mil cosas que se nos puedan ocurrir</li>
</ul>
<p><span id="more-687"></span></p>
<p>Para estos menesteres existen varias herramientas pero todo suelen terminar siendo scripts que escuchan los puertos y van cambiando reglas del cortafuegos y los servicios. Pero no todo es bonito e ideal, imaginad que no tienes una <em>puerta trasera</em>, ¿qué ocurre si cae el servicio encargado de escuchar el portknocking? Te quedas tú sin poder acceder. Deberías dejarte una <em>IP blanca</em> por ejemplo, que siempre tuviera acceso al puerto sin mayor barrera. O tener otro servicio que compruebe si el primer servicio está online y haga de watchdog xD.</p>
<p>Pero ¿cuál es la debilidad clave un sistema así? <strong>Replay Attack</strong>. Me explico, si mi máquina está en una subred y otra máquina de esa subred ha sido comprometida, ésta podría estar usando un sniffer (tcpdump, wireshark) y capturar la secuencia usada para la apertura de puertos. Y aquí es donde entra lo que he venido a contar.</p>
<h2>Crypt-Port-Knocking</h2>
<p>Vamos a cortar por lo sano esa debilidad: <strong>Single Packet Authentication</strong>. Esta manera de proceder difiere en que vamos a llamar a un <strong>puerto aleatorio cada vez</strong> y la conexión con el servicio también se hará en un puerto aleatorio cada vez pero lo que es más importante añadiremos i<strong>nformación cifrada</strong> en el paquete gracias a <strong>OpenSSL</strong> con lo que se quiera hacer (en este caso usando <span>256-bit AES-cbc, se podría mejorar para ultraparanoicos™  usando un cifrado asimétrico</span> con GPG, por ejemplo). Podríamos pensar que para evitar ataques replay en la información cifrada se podría incluir datos variantes en el tiempo, cambios preacordados de la clave de cifrado, usar iteraciones en una función de hashing pero se complica el tema cuando hay muchos usuarios. Para ello, es mejor opción aprovechar que podemos tener 16bytes de datos aleatorios en el paquete que luego podemos identificar gracias a un hash del mismo e ignorar todos los paquetes duplicados. Para crear los paquetes a medida podremos usar <strong>hping</strong>.</p>
<p>Para hacer uso de las características del Single Packet Authentication el autor del post, BoneKracker, ha creado una serie de <strong>scripts en bash</strong>, formados por un cliente y un servidor de una forma bastante clara y transparente. <a title=\"Crytp Port Knocking\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2ZvcnVtcy5nZW50b28ub3JnL3ZpZXd0b3BpYy10LTY4Nzk1Ni5odG1s">Echadle un vistazo</a> que ahí está todo el código y con una explicación más extensa.<br/><br/><i>&#8211;<br/>Fuente original en <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNz">http://vierito.es/wordpress</a></i><br/><br/><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMTEvMjEvcGFyYS1sb3MtYW1hbnRlcy1kZS14a2NkLWxsZWdhLw==" rel=\"bookmark\" title=\"November 21, 2008\">Para los amantes de XKCD llega&#8230;</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDkvMDgvMTAvY3Vlc3Rpb24tZGUtb3B0aW1pemFjaW9uLw==" rel=\"bookmark\" title=\"August 10, 2009\">Cuestión de optimización</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDkvMDgvMjgvY3JhY2tlYWRvci1kZS1oYXNoZXMtbWQ1LWVuLWMteS1vcGVuc3NsLw==" rel=\"bookmark\" title=\"August 28, 2009\">Crackeador de hashes MD5 en C y OpenSSL</a></li>
</ul>
<p><!-- Similar Posts took 17.001 ms --></p>
 <img src="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=687" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://vierito.es/wordpress/2009/09/25/port-knocking-y-crypt-port-knocking/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Arduino MEGA y módulo XBee &#8211; Instalación en gentoo</title>
		<link>http://vierito.es/wordpress/2009/09/19/arduino-mega-y-modulo-xbee-instalacion-en-gentoo/</link>
		<comments>http://vierito.es/wordpress/2009/09/19/arduino-mega-y-modulo-xbee-instalacion-en-gentoo/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 23:37:13 +0000</pubDate>
		<dc:creator>vierito5</dc:creator>
				<category><![CDATA[electronics]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino Mega]]></category>
		<category><![CDATA[Arduino XBee Shield]]></category>
		<category><![CDATA[ATMEL]]></category>
		<category><![CDATA[AVR]]></category>
		<category><![CDATA[avr-gcc]]></category>
		<category><![CDATA[crossdev]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[microcontrolador]]></category>

		<guid isPermaLink="false">http://vierito.es/wordpress/?p=675</guid>
		<description><![CDATA[Mageles, Jaime y Bea me regalaron una Arduino MEGA! Fue una gran sorpresa y además la acompañaron del módulo wireless XBee Shield que usa tecnología Zigbee, que proporciona comunicación inalámbrica entre placas de este tipo u otros dispositivos Zigbee. Para quien no lo conozca, las Arduino son una plataforma de desarrollo electrónico enfocada al prototipado [...]]]></description>
			<content:encoded><![CDATA[<p><a title=\"Mageles\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21hZ2VsZXMud29yZHByZXNzLmNvbQ==">Mageles</a>, Jaime y <a title=\"Kuasar\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2t1YXNhci5lcy9ibG9n">Bea</a> me regalaron una Arduino MEGA! Fue una gran sorpresa y además la acompañaron del módulo wireless XBee Shield que usa tecnología Zigbee, que proporciona comunicación inalámbrica entre placas de este tipo u otros dispositivos Zigbee.</p>
<p style="text-align: center;"><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA5L0FyZHVpbm9NZWdhLmpwZw=="><img class="size-medium wp-image-677  aligncenter" title="ArduinoMega" src="http://vierito.es/wordpress/wp-content/uploads/2009/09/ArduinoMega-480x249.jpg" alt="ArduinoMega" width="480" height="249" /></a><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA5L3hiZWUuanBn"><img class="size-full wp-image-680  aligncenter" title="xbee" src="http://vierito.es/wordpress/wp-content/uploads/2009/09/xbee.jpg" alt="xbee" width="300" height="300" /></a></p>
<p>Para quien no lo conozca, las <strong>Arduino</strong> son una plataforma de desarrollo electrónico enfocada al prototipado rápido <strong>cuyas especificaciones son totalmente libres</strong>. Existen varios modelos de placas para los diseños con características más o menos avanzadas y podremos trabajar con ellas tanto en Windows, Mac OS X ó GNU/Linux, sin tener que usar compiladores y/o herramientas de desarrollo de pago.</p>
<p>La mía es una <strong>Arduino MEGA</strong>, que es una mejora de la Duemilanove y la Diecimila gracias a su mayor I/O y capacidad de memoria, entre otras cosas. Las specs principales son:</p>
<ul>
<li>Microcontrolador Atmel AVR 8-bit MEGA1280 @16MHz</li>
<li>128kB FLASH MEM (4kB usados por el bootloader incluído, usado para poder cargar cógido directamente)</li>
<li>8kB SRAM</li>
<li>4kB EEPROM</li>
<li>54 pines digitales (soportan hasta 40mA): I/O, comunicación serie, interrupciones, 8-bit PWM, SPI, I2C, &#8230;</li>
<li>16 pines de entrada analógica con una resolución de 10bits, útil para todo tipo de sensores.</li>
</ul>
<p>Lo primero que tenemos que hacer para empezar a jugar es instalar las herramientas necesarias. En el árbol de paquete de Gentoo hay bastante para microcontroladores AVR (<em>$ eix -S avr</em> ) pero si además queremos afinar e ir a por el kit completo para Arduino tampoco tendremos problemas.</p>
<p><span id="more-675"></span></p>
<p>Necesitaremos una versión de Java (yo uso <em>sun-jdk-1.6</em>) además de los siguiente paquetes:</p>
<p><code># emerge crossdev jikes uisp rxtx</code></p>
<p>Yo, de antes, ya tenía instalado <em>avra</em> (AVR Assembler) y <em>avrdude</em> (para subir y bajar código a las microcontroladoras) que había usado para trastear con las <em>AVR Tiny2313</em>, <em>ATmega32</em> y <em>ATmega64</em> aunque en realidad casi siempre usé el IDE que te proporciona ATMEL de forma gratuita para Windows y alguna vez Bascom-AVR.</p>
<p>Una vez tengamos los paquetes básicos instalados <strong>necesitamos generar el <em>toolchain</em></strong> con el que vamos a trabajar para generar código compatible con la arquitectura AVR. Para ello nos ayudaremos de la herramienta crossdev:</p>
<p><code># crossdev -t avr -s4 --without-headers</code></p>
<p>Tardará un ratillo pero una vez termine ya dispondremos de nuestro flamante compilador <strong><em>avr-gcc</em>.</strong> Ahora nos bajamos el IDE que nos proporciona Arduino en <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5hcmR1aW5vLmNjL2VuL01haW4vU29mdHdhcmU=">http://www.arduino.cc/en/Main/Software</a>, lo descomprimimos y lo dejamos por ahora ahí. Dependiendo de versiones puede que algunos tengan que hacer un enlace (por supuesto respetando <em>paths</em> y versiones de tu sistema):</p>
<p><code>$ ln -s /usr/lib/binutils/avr/2.19.1/ldscripts/ ~/programs/arduino-0017/ldscripts</code></p>
<p>Dependiendo de distribuciones o la configuración será necesario estar en los grupos <em>tty</em> y <em>uucp</em>, pero para ahorrarte problemas añade el usuario a esos grupos.</p>
<p>Mmmm ¿qué mas necesitamos? Arduino se conecta por USB a nuestro ordenador y el kernel de linux nos proporciona el driver, yo ya lo tenía instalado pero si no:</p>
<p><code>Device Drivers -&gt; USB support -&gt; USB Serial Converter support -&gt; USB FTDI Single Port Serial Driver (EXPERIMENTAL)</code></p>
<p>Lo ponemos como módulo, compilamos y lo cargamos:</p>
<p><code># make &amp;&amp; make modules_install<br />
# modprobe ftdi_sio</code></p>
<p>Conectamos la Arduino y podremos ver si todo funciona:</p>
<p><code># dmesg<br />
usb 4-2: new full speed USB device using uhci_hcd and address 5<br />
usb 4-2: configuration #1 chosen from 1 choice<br />
ftdi_sio 4-2:1.0: FTDI USB Serial Device converter detected<br />
usb 4-2: Detected FT232RL<br />
usb 4-2: FTDI USB Serial Device converter now attached to ttyUSB0</code></p>
<p>OK! <img src='http://vierito.es/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Volvemos al IDE que ya tenemos descomprimido y lo ejectuamos</p>
<p><code>$ ./arduino<br />
Experimental:  JNI_OnLoad called.<br />
Stable Library<br />
=========================================<br />
Native lib Version = RXTX-2.1-7<br />
Java lib Version   = RXTX-2.1-7</code></p>
<p><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA5L2FyZHVpbm8wMS5wbmc="><img class="aligncenter size-full wp-image-678" title="arduino01" src="http://vierito.es/wordpress/wp-content/uploads/2009/09/arduino01.png" alt="arduino01" width="480" height="574" /></a></p>
<p>Ahora sólo nos faltará elegir en la configuración que queremos el <em>/dev/ttyUSB0</em> y que estamos usando una placa Arduino MEGA, et voilà!</p>
<p>Para probar el funcionamiento haremos un &#8220;Hello Word&#8221; al estilo electrónica, es decir, hacer parpadear un LED <img src='http://vierito.es/wordpress/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Hay ejemplos por ahí pero el código sería:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">const</span> <span style="color: #993333;">int</span> ledPin <span style="color: #339933;">=</span>  <span style="color: #0000dd;">13</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// LED connected to digital pin 13</span>
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	pinMode<span style="color: #009900;">&#40;</span>ledPin<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// set pin 13 as output</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	digitalWrite<span style="color: #009900;">&#40;</span>ledPin<span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">// set the LED on</span>
	delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                  <span style="color: #666666; font-style: italic;">// wait for a second</span>
	digitalWrite<span style="color: #009900;">&#40;</span>ledPin<span style="color: #339933;">,</span> LOW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// set the LED off</span>
	delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                  <span style="color: #666666; font-style: italic;">// wait for a second</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>A ver si busco ratos y hago algo interesante con mi nuevo juguete, ya no hay excusa. Si quieres saber por donde empezar acude a <a title=\"Arduino\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2FyZHVpbm8uY2M=">http://arduino.cc</a><br/><br/><i>&#8211;<br/>Fuente original en <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNz">http://vierito.es/wordpress</a></i><br/><br/><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMTAvMzAvZnByaW50LWxhLWltcGxlbWV0YWNpb24tZGVsLWRyaXZlci8=" rel=\"bookmark\" title=\"October 30, 2008\">[Fprint] La implemetación del driver</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMDkvMjgvaG93LXRvLWNvbW8tcmVjdXBlcmFyLWdydWIv" rel=\"bookmark\" title=\"September 28, 2008\">[HOW TO] Cómo recuperar GRUB</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMTEvMDYvZnByaW50LW1lam9yYXMtZW4tZWwtZHJpdmVycy15LWFsZ3Vub3MtZXh0cmFzLw==" rel=\"bookmark\" title=\"November 6, 2008\">[Fprint] Mejoras en el driver y algunos extras</a></li>
</ul>
<p><!-- Similar Posts took 33.811 ms --></p>
 <img src="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=675" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://vierito.es/wordpress/2009/09/19/arduino-mega-y-modulo-xbee-instalacion-en-gentoo/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Crackeador de hashes MD5 en C y OpenSSL</title>
		<link>http://vierito.es/wordpress/2009/08/28/crackeador-de-hashes-md5-en-c-y-openssl/</link>
		<comments>http://vierito.es/wordpress/2009/08/28/crackeador-de-hashes-md5-en-c-y-openssl/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 11:43:03 +0000</pubDate>
		<dc:creator>vierito5</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[crackeador]]></category>
		<category><![CDATA[cracker]]></category>
		<category><![CDATA[cracking]]></category>
		<category><![CDATA[criptografía]]></category>
		<category><![CDATA[diccionario]]></category>
		<category><![CDATA[EVP_DigestInit]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[MD5]]></category>
		<category><![CDATA[OpenSSL]]></category>
		<category><![CDATA[password cracking]]></category>

		<guid isPermaLink="false">http://vierito.es/wordpress/?p=642</guid>
		<description><![CDATA[Un hash es una función criptográfica de tipo resumen cuyo objetivo es identificar casi unívocamente un conjunto de datos. Pretende ser una función inyectiva, es decir, que para una salida (valor imagen) solo exista una entrada (valor origen) pero debido a que su salida está limitada en tamaño es posible que para entradas diferentes existan [...]]]></description>
			<content:encoded><![CDATA[<p>Un hash es una función criptográfica de tipo resumen cuyo objetivo es identificar <em>casi unívocamente</em> un conjunto de datos. Pretende ser una función inyectiva, es decir, que para una salida (valor imagen) solo exista una entrada (valor origen) pero debido a que su salida está limitada en tamaño es posible que para entradas diferentes existan claves resultantes iguales. Eso sería una colisión y una función hash deberá tener una salida pequeña equilibrada con su resistencia a colisiones. MD5 tiene una salida fija de 128 bits, lo que vienen siendo 32 dígitos en hexadecimal.</p>
<p>Primero de todo vamos a hacer un programa que nos permita calcular el hash md5 de un string que se le pase y luego ya pasaremos al crackeador.</p>
<p>Sería más fácil hacer un script en bash o perl gracias a la utilidad CLI de OpenSSL, a la hora de calcular un solo hash no importa mucho la velocidad pero si luego queremos hacer un pequeño crackeador no podemos partir de algo que ya sabemos que va a ser mucho más lento. Así que lo que vamos a usar es C y la librería de OpenSSL.</p>
<p>Si no sabemos por donde empezar un extracto del man:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">$ man md5
...
<span style="color: #202020;">SYNOPSIS</span>
&nbsp;
<span style="color: #339933;">#include &lt;openssl/md2.h&gt;</span>
&nbsp;
        <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>MD5<span style="color: #009900;">&#40;</span><span style="color: #993333;">const</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>d<span style="color: #339933;">,</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> n<span style="color: #339933;">,</span>
                         <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>md<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #993333;">int</span> MD5_Init<span style="color: #009900;">&#40;</span>MD5_CTX <span style="color: #339933;">*</span>c<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #993333;">int</span> MD5_Update<span style="color: #009900;">&#40;</span>MD5_CTX <span style="color: #339933;">*</span>c<span style="color: #339933;">,</span> <span style="color: #993333;">const</span> <span style="color: #993333;">void</span> <span style="color: #339933;">*</span>data<span style="color: #339933;">,</span>
                         <span style="color: #993333;">unsigned</span> <span style="color: #993333;">long</span> len<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #993333;">int</span> MD5_Final<span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>md<span style="color: #339933;">,</span> MD5_CTX <span style="color: #339933;">*</span>c<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
...
<span style="color: #202020;">DESCRIPTION</span>
...
<span style="color: #202020;">Applications</span> should use the higher level functions EVP_DigestInit<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#41;</span> etc. <span style="color: #202020;">instead</span> of calling the hash functions directly.
...</pre></div></div>

<p><span id="more-642"></span><br />
Vemos que podríamos añadir esa librería y usar las funciones MD5_Init(), MD5_Update y MD5_Final pero ya nos avisan que deberíamos usar unas funciones de más alto nivel así que: <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5vcGVuc3NsLm9yZy9kb2NzL2NyeXB0by9FVlBfRGlnZXN0SW5pdC5odG1s">EVP_DigestInit</a></p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">$ man EVP_DigestInit
...
<span style="color: #202020;">SYNOPSIS</span>
        <span style="color: #339933;">#include &lt;openssl/evp.h&gt;</span>
&nbsp;
        <span style="color: #993333;">void</span> EVP_MD_CTX_init<span style="color: #009900;">&#40;</span>EVP_MD_CTX <span style="color: #339933;">*</span>ctx<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        EVP_MD_CTX <span style="color: #339933;">*</span>EVP_MD_CTX_create<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #993333;">int</span> EVP_DigestInit_ex<span style="color: #009900;">&#40;</span>EVP_MD_CTX <span style="color: #339933;">*</span>ctx<span style="color: #339933;">,</span> <span style="color: #993333;">const</span> EVP_MD <span style="color: #339933;">*</span>type<span style="color: #339933;">,</span> ENGINE <span style="color: #339933;">*</span>impl<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #993333;">int</span> EVP_DigestUpdate<span style="color: #009900;">&#40;</span>EVP_MD_CTX <span style="color: #339933;">*</span>ctx<span style="color: #339933;">,</span> <span style="color: #993333;">const</span> <span style="color: #993333;">void</span> <span style="color: #339933;">*</span>d<span style="color: #339933;">,</span> size_t cnt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #993333;">int</span> EVP_DigestFinal_ex<span style="color: #009900;">&#40;</span>EVP_MD_CTX <span style="color: #339933;">*</span>ctx<span style="color: #339933;">,</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>md<span style="color: #339933;">,</span>
               <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> <span style="color: #339933;">*</span>s<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>De paso, aprovecho para desaconsejar el uso de MD5 a día de hoy y como mínimo usar SHA1 o incluso dejarte de monsergas y pasar a SHA256, SHA512.</p>
<p>He intentado que el programa sea bastante fácil de entender y seguir, ahí va:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;string.h&gt;</span>
&nbsp;
<span style="color: #339933;">#include &lt;openssl/evp.h&gt;</span>
&nbsp;
<span style="color: #339933;">#ifdef DEBUG</span>
<span style="color: #339933;">#define DBG 1</span>
<span style="color: #339933;">#else</span>
<span style="color: #339933;">#define DBG 0</span>
<span style="color: #339933;">#endif</span>
&nbsp;
<span style="color: #339933;">#define MAX_SIZE_WORD 200</span>
&nbsp;
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>simple_digest<span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> <span style="color: #339933;">*</span>algth<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>buffer<span style="color: #339933;">,</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> len<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> <span style="color: #339933;">*</span>olen<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	EVP_MD <span style="color: #339933;">*</span>m<span style="color: #339933;">;</span>
	EVP_MD_CTX ctx<span style="color: #339933;">;</span>
	<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>ret<span style="color: #339933;">;</span>
&nbsp;
	OpenSSL_add_all_digests <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>m <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>EVP_MD<span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span> EVP_get_digestbyname<span style="color: #009900;">&#40;</span>algth<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span> NULL<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>ret <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span> malloc<span style="color: #009900;">&#40;</span>EVP_MAX_MD_SIZE<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span> NULL<span style="color: #339933;">;</span>
&nbsp;
	EVP_DigestInit<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>ctx<span style="color: #339933;">,</span> m<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	EVP_DigestUpdate<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>ctx<span style="color: #339933;">,</span> buffer<span style="color: #339933;">,</span> len<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	EVP_DigestFinal<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>ctx<span style="color: #339933;">,</span> ret<span style="color: #339933;">,</span> olen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> ret<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> hex_print<span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>buff<span style="color: #339933;">,</span><span style="color: #993333;">int</span> len<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> i<span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>len<span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%02x&quot;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>buff<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">&amp;</span><span style="color: #208080;">0xFF</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">**</span>argv<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> buff<span style="color: #009900;">&#91;</span>MAX_SIZE_WORD<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> olen<span style="color: #339933;">;</span>
	<span style="color: #993333;">char</span> <span style="color: #339933;">*</span>out<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Usage: mymd5 word<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        	exit<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// copy arg string into a buffer</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>strlen<span style="color: #009900;">&#40;</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> MAX_SIZE_WORD <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
		strncpy<span style="color: #009900;">&#40;</span>buff<span style="color: #339933;">,</span> argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> strlen<span style="color: #009900;">&#40;</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// calculate string's md5 hash</span>
		out <span style="color: #339933;">=</span> simple_digest<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;md5&quot;</span><span style="color: #339933;">,</span>buff<span style="color: #339933;">,</span>strlen<span style="color: #009900;">&#40;</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,&amp;</span>olen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// print results	</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>DBG<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Word: %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Hash: &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		hex_print<span style="color: #009900;">&#40;</span>out<span style="color: #339933;">,</span>olen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Not computing hash<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>I can feel your dark side... ;)<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Compilamos y probamos:</p>
<pre>$ gcc mymd5.c -o mymd5 -l ssl
$ ./mymd5 passworddeelite
5b4f50aa173b977e4cd0850cf7c52bd0</pre>
<p>Podemos comprobar su correcto funcionamiento comparando con webs online que ofrecen utilidades para calcular hashes MD5 [<a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5taXJhY2xlc2FsYWQuY29tL3dlYnRvb2xzL21kNS5waHA=">1</a>], [<a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21kNS1oYXNoLW9ubGluZS53YXJheGUudXMv">2</a>].</p>
<p>Y ahora a por el crackeador. No vamos a intentar buscar colisiones sino a partir de un diccionario sacar la clave. Le pasaremos como parámetros un fichero con el hash y un diccionario con una palabra por línea.</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;string.h&gt;</span>
&nbsp;
<span style="color: #339933;">#include &lt;openssl/evp.h&gt;</span>
&nbsp;
<span style="color: #339933;">#ifdef DEBUG</span>
<span style="color: #339933;">#define DBG 1</span>
<span style="color: #339933;">#else</span>
<span style="color: #339933;">#define DBG 0</span>
<span style="color: #339933;">#endif</span>
&nbsp;
<span style="color: #339933;">#define MAX_SIZE_BUFF 200</span>
&nbsp;
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>simple_digest<span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> <span style="color: #339933;">*</span>algth<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>buffer<span style="color: #339933;">,</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> len<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> <span style="color: #339933;">*</span>olen<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	EVP_MD <span style="color: #339933;">*</span>m<span style="color: #339933;">;</span>
	EVP_MD_CTX ctx<span style="color: #339933;">;</span>
	<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>ret<span style="color: #339933;">;</span>
&nbsp;
	OpenSSL_add_all_digests <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>m <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>EVP_MD<span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span> EVP_get_digestbyname<span style="color: #009900;">&#40;</span>algth<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span> NULL<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span>ret <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span> malloc<span style="color: #009900;">&#40;</span>EVP_MAX_MD_SIZE<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span> NULL<span style="color: #339933;">;</span>
&nbsp;
	EVP_DigestInit<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>ctx<span style="color: #339933;">,</span> m<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	EVP_DigestUpdate<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>ctx<span style="color: #339933;">,</span> buffer<span style="color: #339933;">,</span> len<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	EVP_DigestFinal<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>ctx<span style="color: #339933;">,</span> ret<span style="color: #339933;">,</span> olen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> ret<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> hex_print<span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>buff<span style="color: #339933;">,</span><span style="color: #993333;">int</span> len<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> i<span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>len<span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%02x&quot;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>buff<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">&amp;</span><span style="color: #208080;">0xFF</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> strtohex<span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>in<span style="color: #339933;">,</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>out<span style="color: #339933;">,</span><span style="color: #993333;">int</span> len<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> i<span style="color: #339933;">;</span>
	<span style="color: #993333;">char</span> tmp<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	tmp<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>len<span style="color: #339933;">/</span><span style="color: #0000dd;">2</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		tmp<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>in<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #339933;">*</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		tmp<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>in<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #339933;">*</span>i<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		out<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span>strtol<span style="color: #009900;">&#40;</span>tmp<span style="color: #339933;">,</span>NULL<span style="color: #339933;">,</span><span style="color: #0000dd;">16</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">**</span>argv<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #993333;">int</span> tries<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> buff_words<span style="color: #009900;">&#91;</span>MAX_SIZE_BUFF<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> hash<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">16</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>line<span style="color: #339933;">=</span>NULL<span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> len<span style="color: #339933;">=</span><span style="color: #0000dd;">100</span><span style="color: #339933;">,</span>read<span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> olen<span style="color: #339933;">;</span>
	<span style="color: #993333;">char</span> <span style="color: #339933;">*</span>out<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>argc<span style="color: #339933;">&lt;</span><span style="color: #0000dd;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Usage: mymd5crack /path/to/hashfile /path/to/dictfile<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        	exit<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	FILE <span style="color: #339933;">*</span>hashfile<span style="color: #339933;">;</span>
	hashfile <span style="color: #339933;">=</span> fopen<span style="color: #009900;">&#40;</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>hashfile<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		perror<span style="color: #009900;">&#40;</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
	FILE <span style="color: #339933;">*</span>dictfile<span style="color: #339933;">;</span>
	dictfile <span style="color: #339933;">=</span> fopen<span style="color: #009900;">&#40;</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>dictfile<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		perror<span style="color: #009900;">&#40;</span>argv<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	read <span style="color: #339933;">=</span> getline<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>line<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>len<span style="color: #339933;">,</span> hashfile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>strlen<span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span><span style="color: #339933;">!=</span><span style="color: #0000dd;">33</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		fprintf<span style="color: #009900;">&#40;</span>stderr<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;ERROR: Invalid hash length %d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>strlen<span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>	
&nbsp;
	strtohex<span style="color: #009900;">&#40;</span>line<span style="color: #339933;">,</span>hash<span style="color: #339933;">,</span><span style="color: #0000dd;">32</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>DBG<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Input hash: %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> line<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Input buffer from hash: &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			hex_print<span style="color: #009900;">&#40;</span>hash<span style="color: #339933;">,</span><span style="color: #0000dd;">16</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//Read words in a loop</span>
	<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>read <span style="color: #339933;">=</span> getline<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span>line<span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>len<span style="color: #339933;">,</span> dictfile<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> strlen<span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">200</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			tries<span style="color: #339933;">++;</span>	
&nbsp;
			<span style="color: #666666; font-style: italic;">//Copy word into buffer</span>
			strcpy<span style="color: #009900;">&#40;</span>buff_words<span style="color: #339933;">,</span>line<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>DBG<span style="color: #009900;">&#41;</span>
				<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Input buffer from dict: %s <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>buff_words<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">// compute md5</span>
			out <span style="color: #339933;">=</span> simple_digest<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;md5&quot;</span><span style="color: #339933;">,</span>buff_words<span style="color: #339933;">,</span>strlen<span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,&amp;</span>olen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>DBG<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>	
				<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;For password %s MD5 is: &quot;</span><span style="color: #339933;">,</span>line<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				hex_print<span style="color: #009900;">&#40;</span>out<span style="color: #339933;">,</span>olen<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">//Compare computed md5 with hash</span>
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>memcmp<span style="color: #009900;">&#40;</span>out<span style="color: #339933;">,</span>hash<span style="color: #339933;">,</span><span style="color: #0000dd;">16</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
				<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;PASSWORD FOUND!! in %d tries: %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>tries<span style="color: #339933;">,</span>line<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				fclose<span style="color: #009900;">&#40;</span>hashfile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				fclose<span style="color: #009900;">&#40;</span>dictfile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				free<span style="color: #009900;">&#40;</span>out<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span>
					free<span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>	
			<span style="color: #009900;">&#125;</span>
			free<span style="color: #009900;">&#40;</span>out<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Words from dict too long... cough*, cough*...<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Password not found in %d tries!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>tries<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span>
		free<span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	fclose<span style="color: #009900;">&#40;</span>hashfile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	fclose<span style="color: #009900;">&#40;</span>dictfile<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Y comprobamos su funcionamiento metiendo en /tmp/hash el hash obtenido anteriormente:</p>
<pre>$ gcc mymd5cracker.c -o mymd5cracker -l ssl
$ ./mymd5cracker /tmp/hash /tmp/dict
PASSWORD FOUND!! in 6 tries: passworddeelite</pre>
<p>Premio! Podéis ir en paz.</p>
<p>Para descargar <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA4L215bWQ1LmM=">mymd5.c</a> y <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA4L215bWQ1Y3JhY2tlci5j">mymd5cracker.c</a></p>
<p>Gracias a <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R1eGVkLnNlcnZlYmxvZy5uZXQ=">TuXeD</a> que siempre está ahí para echar una mano.<br/><br/><i>&#8211;<br/>Fuente original en <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNz">http://vierito.es/wordpress</a></i><br/><br/><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDkvMDQvMTgvZGVzY2lmcmFuZG8tdW4tcmV0by1kZWwtZmJpLw==" rel=\"bookmark\" title=\"April 18, 2009\">Descifrando un reto del FBI</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDkvMDUvMjIvc29sdWNpb25lcy1kZWwtcmV0by1kZS1jcmlwdG9ncmFmaWEtcGFydGUtMi8=" rel=\"bookmark\" title=\"May 22, 2009\">Soluciones del reto de criptografía &#8211; Parte 2</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDkvMDkvMjUvcG9ydC1rbm9ja2luZy15LWNyeXB0LXBvcnQta25vY2tpbmcv" rel=\"bookmark\" title=\"September 25, 2009\">Port-Knocking y Crypt-Port-Knocking</a></li>
</ul>
<p><!-- Similar Posts took 6.023 ms --></p>
 <img src="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=642" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://vierito.es/wordpress/2009/08/28/crackeador-de-hashes-md5-en-c-y-openssl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cuestión de optimización</title>
		<link>http://vierito.es/wordpress/2009/08/10/cuestion-de-optimizacion/</link>
		<comments>http://vierito.es/wordpress/2009/08/10/cuestion-de-optimizacion/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 19:37:54 +0000</pubDate>
		<dc:creator>vierito5</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[Opinión]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[eficiencia]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[Matlab]]></category>
		<category><![CDATA[optimización]]></category>

		<guid isPermaLink="false">http://vierito.es/wordpress/?p=255</guid>
		<description><![CDATA[Y es que se ha perdido el romanticismo&#8230; xD A día de hoy contamos con ordenadores chorrecientas veces más rápidos que hace pocos años y cuando se programa haces pruebas con sistemas de 3GHz, varios MB de cache y 2GB de RAM mínimo y todo tira para adelante. Bueno, todo tira hasta cierto punto, tus [...]]]></description>
			<content:encoded><![CDATA[<p>Y es que se ha perdido el romanticismo&#8230; xD</p>
<p>A día de hoy contamos con ordenadores chorrecientas veces más rápidos que hace pocos años y cuando se programa haces pruebas con sistemas de 3GHz, varios MB de cache y 2GB de RAM mínimo y todo tira para adelante. Bueno, todo tira hasta cierto punto, tus programas luego se van a estar ejecutando juntos con otras decenas de programas o simplemente se van a estar ejecutando constantemente y vas a perder un gran porcentaje de la capacidad de proceso de cómo lo podrías estar haciendo.</p>
<p>Bueno, y es normal, cosas de la comodidad, <strong>yo el primero</strong>. Ahora te quedas tranquilo con que funcione, en los 80 tenía que funcionar y caber en 64kB de RAM. No digo que se programe peor (seguramente sí xD) pero ya no nos fijamos en muchos detalles que antes eran totalmente necesarios (la de trucos que usaba la gente para poder aprovechar el 100% del hardware del Commodore64) y ahora desperdiciamos por todos lados y al final <strong>sí que pasa factura</strong>. La gente que programe sistemas embebidos lo tiene muy claro aunque casi se va a acabar el asunto también ahí porque ya los procesadores de los móviles/PDAs/cosas_pequeñas tirán mucho.</p>
<p><span id="more-255"></span></p>
<p>Me he encontrado con programas que están al 100% de CPU en idle, con programas que daban su salida en unos 12~15 minutos cuando otro para el mismo propósito lo hacía en aproximadamente 1 segundo (no daré nombres xD), programas en los que notas el &#8216;refresco&#8217; de los elementos cuando lo usas cuando te sobra CPU para hacerlo bien, etc. Hay que intentar evitar marañas de bucles for anidados!</p>
<p>Al final todo pasa por conocer muy bien el lenguaje que usas, haber pasado horas y horas, pensar las cosas antes de hacerlas, incluso un poquito de sentido común, cosa que creo que es difícil de abstraer a veces cuando se programa.</p>
<p>Por ejemplo, en matlab es muy importante reservar el espacio para las variables antes y crear los vectores del tamaño que van a ser al final de las operaciones porque si aumentamos el tamaño de un vector[n], internamente lo que siempre hace es crear un nuevo vector[n+1] y copiar los datos del antiguo.</p>
<p>Hace unos meses me comentó un amigo que en el trabajo tenían un método númerico que disminuyó su tiempo de ejecución en más de un 20% (siendo su tiempo varias horas) al sustituir un resultado de una operación que siempre era el mismo por el valor guardado en una variable! Es de cajón pero hay que caer.</p>
<p>Y ahora vienen algunos ejemplos, por no meterme en un lenguaje tipo C en el que hay muchas posibilidades de hacer las cosas y hay que currarse más los ejemplo iré a algo más sencillo como es hacer scripts cerdos para administrar un máquinas o similares.</p>
<p>Un ejemplo sería un uso poco adecuado de las órdenes <em>cat, grep, ls, awk</em> y similares. Cuando manipulamos algo pequeño no pasa nada pero cuando se trata de varios ficheros logs y son decenas de MB pues la cosa empieza a tomar importancia.</p>
<p>Respecto a <em>grep</em> cuando una persona empieza y se plantea buscar una cadena lo primero que piensa es &#8216;muestro el archivo y luego saco las líneas coincidentes&#8217;:</p>
<p><code># cat tinyproxy.log | grep remote<br />
real    0m55.071s<br />
user    0m24.477s<br />
sys     0m0.727s</code></p>
<p>Luego descubres que en realidad lo puedes hacer &#8216;todo en uno&#8217; y es bastantes más rápido:</p>
<p><code># grep remote tinyproxy.log<br />
real    0m36.024s<br />
user    0m22.550s<br />
sys     0m0.527s</code></p>
<p>Luego, sin querer, entras en el man y te das cuenta de que existen varios tipos: <em>grep</em>, <em>egrep</em> (similar pero no idéntico a grep -E ) y  <em>fgrep</em> (idéntico a grep -F). Así que pruebas:</p>
<p><code># egrep remote tinyproxy.log<br />
real    0m55.122s<br />
user    0m25.029s<br />
sys     0m0.659s</code></p>
<p>Joder, vuelve a ser lento a pesar de no hacer un cat. ¿Por qué? Porque es una función más compleja.</p>
<ul>
<li>grep: soporta expresiones regulares básicas.</li>
<li>fgrep: no soporta expresiones regulares =&gt; el más rápido.</li>
<li>egrep: soporta expresiones regulares avanzadas =&gt; el más lento.</li>
</ul>
<p>Para los curiosos, el nombre grep viene de g/re/p y significa lo que hace tal cual, buscar una expresión regular y hacer print de las coincidencias. En realidad a una escala grande ni siquiera deberíamos usar <em>grep</em> sino <em>sed</em> que es más rápido.</p>
<p>Lo mucha gente desconoce es que hay otra manera de evitar el <em>cat </em>de antes y ganar tiempo, y es que en realidad las concatenaciones siempre están ahí&#8230; así que lo podríamos hacer del siguiente modo:</p>
<p><code># &lt;tinyproxy.log grep remote<br />
real    0m43.931s<br />
user    0m22.338s<br />
sys     0m0.578s</code></p>
<p>Del mismo modo estos conceptos se puede usar en otras órdenes</p>
<p><code># cat tinyproxy.log | wc -l<br />
104265</code></p>
<p>real    0m0.088s<br />
user    0m0.021s<br />
sys     0m0.053s</p>
<p><code># wc -l tinyproxy.log<br />
104265 tinyproxy.log</code></p>
<p>real    0m0.021s<br />
user    0m0.013s<br />
sys     0m0.006s</p>
<p>Y del mismo modo:</p>
<p><code># cat tinyproxy.log | tail -n 200<br />
real    0m0.121s<br />
user    0m0.026s<br />
sys     0m0.056s</code></p>
<p><code># tail -n 200 tinyproxy.log<br />
real    0m0.010s<br />
user    0m0.000s<br />
sys     0m0.003s</code></p>
<p>Cambiando de tercio también solemos usar <em>echo</em> más veces de las que toca. Por ejemplo si tenemos :</p>
<p><code>var="valor_o_resultado_de_una_evaluacion"<br />
command -options `echo $var`</code></p>
<p>en la mayoría de los casos podremos sustituirlo por:</p>
<p><code>var="valor_o_resultado_de_una_evaluacion"<br />
command -options $var</code></p>
<p>Y así mil chorradas. Por cierto, el que sólo se conozca la opción de awk para coger columnas le recomiendo que se mire manules que termina siendo muy útil.</p>
<p>Creo que este post lleva más de 6 meses en drafts y no he añadido nada (de hecho  tampoco tengo ganas), así que aunque es un tema que da mucho de sí ha quedado bastante descafeinado técnicamente, pero ajo y agua!<br/><br/><i>&#8211;<br/>Fuente original en <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNz">http://vierito.es/wordpress</a></i><br/><br/><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDkvMTEvMjUvZGVzY29kaWZpY2FyLXRvbm9zLWR0bWYtdXNhbmRvLW1hdGxhYi8=" rel=\"bookmark\" title=\"November 25, 2009\">Descodificar tonos DTMF usando Matlab</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDkvMDkvMjUvcG9ydC1rbm9ja2luZy15LWNyeXB0LXBvcnQta25vY2tpbmcv" rel=\"bookmark\" title=\"September 25, 2009\">Port-Knocking y Crypt-Port-Knocking</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMTEvMjEvcGFyYS1sb3MtYW1hbnRlcy1kZS14a2NkLWxsZWdhLw==" rel=\"bookmark\" title=\"November 21, 2008\">Para los amantes de XKCD llega&#8230;</a></li>
</ul>
<p><!-- Similar Posts took 7.208 ms --></p>
 <img src="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=255" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://vierito.es/wordpress/2009/08/10/cuestion-de-optimizacion/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>[Campus Party 09] Sistemas de Detección de Intrusos</title>
		<link>http://vierito.es/wordpress/2009/08/03/campus-party-09-sistemas-de-deteccion-de-intrusos/</link>
		<comments>http://vierito.es/wordpress/2009/08/03/campus-party-09-sistemas-de-deteccion-de-intrusos/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 13:26:34 +0000</pubDate>
		<dc:creator>vierito5</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[campus party]]></category>
		<category><![CDATA[HIDS]]></category>
		<category><![CDATA[IDS]]></category>
		<category><![CDATA[IPS]]></category>
		<category><![CDATA[NIDS]]></category>
		<category><![CDATA[seguridad y redes]]></category>
		<category><![CDATA[Sistemas de Detección de Intrusos]]></category>
		<category><![CDATA[snort]]></category>
		<category><![CDATA[vierito5]]></category>

		<guid isPermaLink="false">http://vierito.es/wordpress/?p=605</guid>
		<description><![CDATA[Aquí van las transparencias y el video de la charla del sábado en la Campus Party, no sabía que lo iban a subir a youtube. Muchas gracias a todos los que acudísteis a pesar de ser el último día y ser por la mañana, que el sueño hace mella&#8230; PDF:Sistemas de Detección de Intrusos CP2k9 [...]]]></description>
			<content:encoded><![CDATA[<p>Aquí van las transparencias y el video de la charla del sábado en la Campus Party, no sabía que lo iban a subir a youtube.</p>
<p>Muchas gracias a todos los que acudísteis a pesar de ser el último día y ser por la mañana, que el sueño hace mella&#8230;</p>
<p>PDF:<a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA4L2lkc19jcDJrOS5wZGY=">Sistemas de Detección de Intrusos CP2k9</a></p>
<p><object width="480" height="295" data="http://www.youtube.com/v/5rLfJhsO2CY&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/5rLfJhsO2CY&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /></object><br/><br/><i>&#8211;<br/>Fuente original en <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNz">http://vierito.es/wordpress</a></i><br/><br/><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDkvMDYvMjUvY2FtcHVzLXBhcnR5LTA5LXBsYW5uaW5nLw==" rel=\"bookmark\" title=\"June 25, 2009\">[Campus Party 09] Planning</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDkvMDkvMDcvY2FtcHVzLXBhcnR5LTA5LWxhcy1jcm9uaWNhcy8=" rel=\"bookmark\" title=\"September 7, 2009\">[Campus Party 09] Las crónicas</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMDkvMDcvY2FtcHVzLXBhcnR5LTA4LWRpYXJpby1kZS1hLWJvcmRvLXBhcnRlLTIv" rel=\"bookmark\" title=\"September 7, 2008\">[Campus Party 08] Diario de a bordo &#8211; Parte 2</a></li>
</ul>
<p><!-- Similar Posts took 7.691 ms --></p>
 <img src="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=605" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://vierito.es/wordpress/2009/08/03/campus-party-09-sistemas-de-deteccion-de-intrusos/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>CFLAGS y libgcrypt</title>
		<link>http://vierito.es/wordpress/2009/06/19/cflags-y-libgcrypt/</link>
		<comments>http://vierito.es/wordpress/2009/06/19/cflags-y-libgcrypt/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 20:21:30 +0000</pubDate>
		<dc:creator>vierito5</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[CFLAGS]]></category>
		<category><![CDATA[compilar]]></category>
		<category><![CDATA[CXXFLAGS]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[GnuPG]]></category>
		<category><![CDATA[libgcrypt]]></category>
		<category><![CDATA[safe cflags]]></category>

		<guid isPermaLink="false">http://vierito.es/wordpress/?p=479</guid>
		<description><![CDATA[Ya se sabe, cuando se tiene que &#8220;entregar&#8221; algo a tal hora, un ratito antes empezarán a salir fallos que hagan que no funcione. Cosas de Murphy. Estaba preparando la prueba 12 del reto cuando me encontré con un marrón que me costó darme cuenta 3horas de rayadas mentales diciendo &#8220;no puede ser, ¡si está [...]]]></description>
			<content:encoded><![CDATA[<p>Ya se sabe, cuando se tiene que &#8220;entregar&#8221; algo a tal hora, un ratito antes empezarán a salir fallos que hagan que no funcione. Cosas de Murphy. Estaba preparando la prueba 12 del reto cuando me encontré con un marrón que me costó darme cuenta 3horas de rayadas mentales diciendo &#8220;no puede ser, ¡si está bien!&#8221; Pero antes, una introducción para saber de qué va el asunto: las CFLAGS.</p>
<p><strong>¿Qué son las CFLAGS/CXXFLAGS?</strong></p>
<p>Son unas variables de entorno o unas variables en un Makefile que se le pasan al compilador para que compile el software aplicando un serie de optimizaciones. Herramientas como autoconf las cogerían del entorno para añadirlas a la sentencia que se usa al compilar. Las CFLAGS se usarían en C, y las CXXFLAGS en C++.</p>
<p>Según usemos un set distinto de CFLAGS los binarios de salida que nos dé el compilador podrán ser distintos partiendo de un mismo código fuente. Gracias a ellas podremos adecuar o intentar mejorar características de los binarios, ya sea para que sean más pequeños, más rápidos en ciertas arquitecturas u otras opciones. Para ello se podrán usar instrucciones específicas disponibles un procesador, podremos especificar por ejemplo que se &#8220;desenrrollen&#8221; bucles, etc.</p>
<p>Un ejemplo del primer caso sería usar instrucciones SSE3 disponibles en procesadores actuales pero no disponibles en un Pentium IV de primera generación. Para ello le pasaremos <code>-msse3</code><br />
<span id="more-479"></span></p>
<p>Un ejemplo del segundo caso sería, yo tengo un bucle que se ejecuta 1000 veces. Cogeríamos y, en ensamblador, tenemos un registro que se va decrementando, comprueba si lo ha hecho 1000 veces y si no, hace un salto para ejecutar el bucle de nuevo. Pues vamos a cambiar eso por &#8220;pegar&#8221; consecutivamente el código de dentro del bucle 1000 veces. Con eso nos ahorramos recodificaciones de punteros y cosas similares pero tendremos como inconvenientes que el binario será más grande. ¿Qué se ejecuta más rápido? ¿El código optimizado por no hacer esas recodificaciones o el código inicial porque se tarda menos en cargarlo al ser más pequeño? Eterna pregunta&#8230; pues depende, a veces uno, a veces el otro.</p>
<p>Por comodidad, para que no tener que pasarle 8 lineas de optimizaciones, de las cuales más de una no sabremos lo que hace y que algunas implican o excluyen otras, existen sets de optimizaciones: <code>-O, -O1, -O2, -O3, -Os</code>, etc. Eso es la letro &#8220;o&#8221; mayúscula seguida de un número, más allá del 3 no existe, se usaría -O3.</p>
<p>Por otro lado, a las arquitecturas existentes se les pone un nombre, para que cuando digamos qué arquitectura tiene nuestra máquina el compilador le aplique automáticamente lo que toca: <code>-march=athlon64, -march=pentium2, -march=pentium4, -march=prescott, -march=core2, </code>&#8230; Esta opción dependerá mucho de la versión de GCC que tengamos instalada, ya que dependiendo de lo nueva que sea tendrá soporte para nuevas arquitecturas o no, e incluso para una misma arquitectura dependiendo de si instalas un sistema de 32 o 64bits el nombre cambiará. Además está opción está íntimamente ligada con la variable CHOST que será del estilo: <code>i586-pc-linux-gnu, i686-pc-linux-gnu, x86_64-pc-linux-gnu</code>, etc.</p>
<p>La mayoría de las distribuciones que se usan son precompiladas, Debian/Ubuntu, RedHat, Mandriva, &#8230; y esto no es algo de lo que preocuparse pero esto cobra especialmente sentido en distros como Gentoo y LFS donde todo el código es compilado desde cero con las optimizaciones y opciones que se quieran, ajustadas al tipo de máquina que va a ejecutar el código.</p>
<p>Pero ya se sabe, la gente funciona del modo &#8220;a ver quien la tiene más larga&#8221;. Cuando Gentoo empezó a ganar terreno y adeptos con la versión 1.4  y la 2004 la gente se cascaba unas pedazos de CFLAGS que no tenían ni pies ni cabeza, ¡cuantas más le pase más guay!, ¡más rápido irá! ¡más todo! Estilo pajillero, el foro estaba lleno de hilos de discusión sobre las CFLAGS y que no sé quien se había puesto tales y podía viajar atrás en el tiempo con ellas. En realidad lo único que se consigue es tener como salida un código inestable, que puede funcionar mal y más lento. Por ejemplo, la opción <code>-ffast-math</code> además de no cumplir con el estándar hace que las raices negativas no existan en lugar de devolver números complejos. ¿y si compilamos octave/algo_tipo_matlab con <em>-ffast-math</em>? => fiesta del confeti.</p>
<p>Generalmente se recomienda usar <code>-O2 -pipe -fomit-frame-pointer</code> y poco más. La opción <em>-O3</em> se considera un poco insegura que ya de uvas a peras puede dar problemas. La opción <em>-pipe</em> en realidad no cambia el código de salida, sólo provoca que el compilador use tuberías entre las distintas etapas de una compilación en lugar de usar ficheros temporales, esto aumenta la velocidad de compilación pero puede provocar que en algunos sistemas donde el código ensamblador no pueda recibir de una tubería falle, algo poco común en realidad. La opción <em>-fomit-frame-pointer</em> reduce el tamaño del código bastante pero provoca que la depuración de código sea infinitamente más complicada, además, para gran parte de las arquitecturas, viene activada en el set -O2 así que no necesitaríamos ni ponerla xD</p>
<p>Por poner algunos ejemplos en las máquinas que tengo a mano uso:</p>
<p>AMD Ahtlon 3200+ (2GHz)<br />
<code>CHOST="x86_64-pc-linux-gnu"<br />
CFLAGS="-O2 -march=athlon64 -pipe -fomit-frame-pointer -msse3"</code></p>
<p>Intel Core Duo T2500 (2GHz)<br />
<code>CHOST="i686-pc-linux-gnu"<br />
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer -msse3"</code></p>
<p>Intel Pentium4 (3.2GHz)<br />
<code>CHOST="i686-pc-linux-gnu"<br />
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer -msse3"</code></p>
<p>Intel Pentium4 Celeron (2GHz)<br />
<code>CHOST="i686-pc-linux-gnu"<br />
CFLAGS="-O2 -march=i686 -pipe -fomit-frame-pointer"<br />
</code></p>
<p>Vamos, más simple y pobre imposible jejeje. Y ahora viene el tema, resulta que en el Athlon 3200+ de 64bits tenía -O3&#8230; yo ni me acordaba.</p>
<p>Quien no tenga ni amigos ni cosas que hacer que acuda al <code>man gcc</code> y se las estudie todas.</p>
<p><strong>El problema con libgcrypt</strong></p>
<p>Para la prueba 12, creé en mi portátil una par de pares de claves GPG para cifrar con clave asimétrica un mensaje, el objetivo de la prueba era recuperar la clave privada y la passphrase y a continuación descifrarlo. Al principio pensé hacerla más larga y que luego no estuviese enviado por quien decía ser y hubiera que encontrar más cosas pero bueno, lo deje en el primer stage, así que la clave pública del emisor ya no era ni necesaria.</p>
<p>Una vez creadas las clave y cifrado el mensaje procedí a probar que funcionaba&#8230;claro. Así que exporté las claves y las importé en el sobremesa (el Athlon). Procedo a descifrar y:<br />
<code>...<br />
AES-128 test encryption failed.<br />
...</code></p>
<p>Premio, ¿qué habré hecho mal? Venga a probar a importar de nuevo, crear de nuevo las claves, &#8230; Resulta que tenía versiones distintas de GnuPG en cada máquina, ¿afectará? O_o, no debería en absoluto pero bueno, compilo la misma versión, sigue fallando, creo otra vez la claves, me empiezo a desesperar, busco por internet, no encuentro nada, me bajo el código fuente donde sale esa cadena para ser mostrada, me lo empiezo a mirar para ver cuando y por qué sale. No veo nada raro, cambio a otra versión de libgcrypt, recompilo, más de lo mismo, sólo puede ser una cosa, que el algoritmo de AES no esté haciendo lo que toca, pero ¡el mismo código funciona en otra máquina!</p>
<p>Ya desesperadísimo a falta de 20 minutos para que demos comienzo el reto, la prueba 12 no funciona xD, genial. Asumiendo que el código es correcto sin bugs me meto en el make.conf y veo &#8220;<em>-O3</em>&#8220;, uhm, no me jodas, lo cambio por &#8220;<em>-O2</em>&#8221; y recompilo libgcrypt, que es el paquete que contiene la función con dicho código tocapelotas, y recompilo GnuPG, pruebo a descifrar, a la primera ¬¬</p>
<p>De normal cuando un paquete es propenso a funcionar mal por estas razones en el proceso de compilación te avisan de que no uses alguna optimización, éste no era el caso aunque después de lo visto quizá deberían avisarlo. O cambiarlo por <em>-O2</em> sin decir nada.</p>
<p>Así que ya sabéis, KISS (efe eeeeeeeeeeeeeeeeeeeeeeeeemeeeeeeee), <strong>Keep It Simple, Stupid!</strong><br/><br/><i>&#8211;<br/>Fuente original en <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNz">http://vierito.es/wordpress</a></i><br/><br/><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMDQvMTkvdGhlLW1hY2hpbmVzLw==" rel=\"bookmark\" title=\"April 19, 2008\">The Machines</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMDMvMjgvZGVqYXItYm9uaXRvLXVuLXNlcnZlci1zc2gtcGFydGUtMS8=" rel=\"bookmark\" title=\"March 28, 2008\">Dejar bonito un server SSH &#8211; Parte 1</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDkvMDkvMTkvYXJkdWluby1tZWdhLXktbW9kdWxvLXhiZWUtaW5zdGFsYWNpb24tZW4tZ2VudG9vLw==" rel=\"bookmark\" title=\"September 19, 2009\">Arduino MEGA y módulo XBee &#8211; Instalación en gentoo</a></li>
</ul>
<p><!-- Similar Posts took 11.916 ms --></p>
 <img src="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=479" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://vierito.es/wordpress/2009/06/19/cflags-y-libgcrypt/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Alternate Data Streams (ADS) con NTFS-3G en Linux</title>
		<link>http://vierito.es/wordpress/2009/06/01/alternate-data-streams-ads-con-ntfs-3g-en-linux/</link>
		<comments>http://vierito.es/wordpress/2009/06/01/alternate-data-streams-ads-con-ntfs-3g-en-linux/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 09:10:30 +0000</pubDate>
		<dc:creator>vierito5</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[ADS]]></category>
		<category><![CDATA[alternate data streams]]></category>
		<category><![CDATA[kriptopolis]]></category>
		<category><![CDATA[NTFS]]></category>
		<category><![CDATA[NTFS-3G]]></category>

		<guid isPermaLink="false">http://vierito.es/wordpress/?p=448</guid>
		<description><![CDATA[Ayer se publicó en portada de Kriptópolis un artículo muy interesante sobre ADS. El asunto es que NTFS almacena todo en streams (flujos), cada fichero tiene un stream sin nombre pero puede tener muchos con nombre. El tamaño del fichero será sin embargo el tamaño del stream sin nombre, el principal. Se podría resumir diciendo [...]]]></description>
			<content:encoded><![CDATA[<p>Ayer se publicó en portada de Kriptópolis un <a title=\"Alternate Data Streams\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5rcmlwdG9wb2xpcy5vcmcvYWx0ZXJuYXRlLWRhdGEtc3RyZWFtcy1udGZz">artículo muy interesante sobre ADS</a>.</p>
<p>El asunto es que NTFS almacena todo en streams (flujos), cada fichero tiene un stream sin nombre pero puede tener muchos con nombre. El tamaño del fichero será sin embargo el tamaño del stream sin nombre, el principal. Se podría resumir diciendo que ADS son ficheros dentro de ficheros.</p>
<p>Prácticamente ya todo el mundo usa <a title=\"NTFS-3G\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5udGZzLTNnLm9yZw==">NTFS-3G</a> para acceder desde linux a sus particiones en este sistema de fichero pero por defecto NTFS-3G sólo lee y escribe los flujos de datos sin nombre.</p>
<p>Si queremos acceder a los flujos secundarios tendremos que montar el sistema de ficheros con la opción <code>streams_interface=windows</code>. De este modo podremos acceder a esos datos del modo:</p>
<p><code>cat file.dat:label1</code></p>
<p>y de este modo tratarlo como otro fichero más, pudiendo usar directamente el resto de utilidades GNU. Para listar todos los streams que contiene un fichero tendremos que comprobar el contenido del atributo <em>ntfs.streams.list</em>.</p>
<p><br/><br/><i>&#8211;<br/>Fuente original en <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNz">http://vierito.es/wordpress</a></i><br/><br/><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMTAvMzAvZnByaW50LWxhLWltcGxlbWV0YWNpb24tZGVsLWRyaXZlci8=" rel=\"bookmark\" title=\"October 30, 2008\">[Fprint] La implemetación del driver</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMTAvMDIvZnByaW50LWxlY3RvcmVzLWRlLWh1ZWxsYXMtZW4tbGludXgv" rel=\"bookmark\" title=\"October 2, 2008\">[Fprint] Lectores de huellas en linux</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMDMvMjgvZGVqYXItYm9uaXRvLXVuLXNlcnZlci1zc2gtcGFydGUtMS8=" rel=\"bookmark\" title=\"March 28, 2008\">Dejar bonito un server SSH &#8211; Parte 1</a></li>
</ul>
<p><!-- Similar Posts took 6.865 ms --></p>
 <img src="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=448" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://vierito.es/wordpress/2009/06/01/alternate-data-streams-ads-con-ntfs-3g-en-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Kernel 2.6 Fun</title>
		<link>http://vierito.es/wordpress/2009/05/19/kernel-26-fun/</link>
		<comments>http://vierito.es/wordpress/2009/05/19/kernel-26-fun/#comments</comments>
		<pubDate>Tue, 19 May 2009 19:33:40 +0000</pubDate>
		<dc:creator>vierito5</dc:creator>
				<category><![CDATA[hacking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[2.6]]></category>
		<category><![CDATA[exploits]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[local]]></category>
		<category><![CDATA[root]]></category>

		<guid isPermaLink="false">http://vierito.es/wordpress/?p=401</guid>
		<description><![CDATA[Una pequeña recopilación de juguetes para escalar privilegios a root desde local. Aprovechan fallos distintos y de distintos tipos. Algunos no tienen por qué funcionar siempre, debido a su idiosincrasia y en realidad los posteo aquí para tenerlos más a mano y recopilados xD 2.6.29 ptrace_attach &#8211; shoryuken.c 2.6.x ptrace_attach &#8211; xploit_2.6.x.c &#60;2.6.29 exit_notify &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA1L2J1Zy5wbmc="><img class="aligncenter size-full wp-image-415" title="bug" src="http://vierito.es/wordpress/wp-content/uploads/2009/05/bug.png" alt="bug" width="300" height="346" /></a></p>
<p>Una pequeña recopilación de juguetes para escalar privilegios a root desde local. Aprovechan fallos distintos y de distintos tipos. Algunos no tienen por qué funcionar siempre, debido a su idiosincrasia y en realidad los posteo aquí para tenerlos más a mano y recopilados xD</p>
<p>2.6.29 ptrace_attach &#8211; <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA1L3Nob3J5dWtlbi5j">shoryuken.c</a></p>
<p>2.6.x ptrace_attach &#8211; <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA1L3hwbG9pdF8yNnguYw==">xploit_2.6.x.c</a></p>
<p>&lt;2.6.29 exit_notify &#8211; <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA1L3hwbG9pdF90aWxsMjYyOV9leGl0X25vdGlmeS5zaA==">xploit_till2.6.29_exit_notify.sh</a></p>
<p>2.6.23 ~ 2.6.24 vmsplice &#8211; <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA1L3hwbG9pdF8yNjIzMjRfdm1zcGxpY2UuYw==">xploit_2.6.23~24_vmsplice</a></p>
<p>2.6.17 ~ 2.6.24.1 vmsplice &#8211; <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA1L3hwbG9pdF8yNjE3MjRfdm1zcGxpY2UuYw==">xploit_2.6.17~24_vmsplice</a></p>
<p>2.6.13 ~ 2.6.17.4 prctl (made in Spain) &#8211; <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA1L3hwbG9pdF8yNjEzMTdfcHJjdGwuYw==">xploit_2.6.13~17_prctl.c</a></p>
<p>2.6.13 ~ 2.6.17.4 prctl &amp; logrotate &#8211; <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA1L3JhcHRvcl9wcmN0bDIuYw==">raptor_prctl2.c</a></p>
<p>2.6.13 ~ 2.6.17.4 prctl &#8211; <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA1L3JhcHRvcl9wcmN0bC5j">raptor_prctl.c</a></p>
<p>&lt;2.6.17.4 proc &#8211; <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA1L2gwMGx5c2hpdC5j">h00lyshit.c</a></p>
<p>Un poco más de prctl <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21pbHcwcm0uY29tL2V4cGxvaXRzLzIwMDU=">aquí</a>, <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21pbHcwcm0uY29tL2V4cGxvaXRzLzIwMDY=">aquí</a> y <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL21pbHcwcm0uY29tL2V4cGxvaXRzLzIwMTE=">aquí</a>, más de lo mismo.</p>
<p>&lt;2.6.11 CPL 0 &#8211; <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzL3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA5LzA1L2stcmFkMy5j">k-rad3.c</a></p>
<p>¡Qué post más scriptkiddie! ¿no?<br/><br/><i>&#8211;<br/>Fuente original en <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNz">http://vierito.es/wordpress</a></i><br/><br/><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMTAvMDkvZnByaW50LWxvcy1kaXNwb3NpdGl2b3Mv" rel=\"bookmark\" title=\"October 9, 2008\">[Fprint] Los dispositivos</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMDYvMDgvaHAtbW9iaWxlLWRhdGEtcHJvdGVjdGlvbi1zeXN0ZW0tM2Qv" rel=\"bookmark\" title=\"June 8, 2008\">HP Mobile Data Protection System 3D</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMDYvMDIvc2QtY2FyZC10aS1yZWFkZXItZW4tbG9zLXBvcnRhdGlsZXMtaHAtYmFqby1saW51eC8=" rel=\"bookmark\" title=\"June 2, 2008\">SD Card TI Reader en los portátiles HP bajo linux</a></li>
</ul>
<p><!-- Similar Posts took 47.307 ms --></p>
 <img src="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=401" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://vierito.es/wordpress/2009/05/19/kernel-26-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convertir vídeos con FFmpeg</title>
		<link>http://vierito.es/wordpress/2009/01/22/convertir-videos-con-ffmpeg/</link>
		<comments>http://vierito.es/wordpress/2009/01/22/convertir-videos-con-ffmpeg/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 23:02:14 +0000</pubDate>
		<dc:creator>vierito5</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[convertir]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[FullHD]]></category>
		<category><![CDATA[JVC]]></category>
		<category><![CDATA[TOD]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://vierito.es/wordpress/?p=271</guid>
		<description><![CDATA[Estos últimos días he tenido que usar un poquito la herramienta FFmpeg. La verdad es que es muy completa y te permite codificar todo tipo de audio y video. Hacer un ffmpeg -h asusta así que que mejor que unos ejemplos de guía rápida. Los videos venían de una cámara JVC que los grababa a [...]]]></description>
			<content:encoded><![CDATA[<p>Estos últimos días he tenido que usar un poquito la herramienta <a title=\"FFmpeg\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2ZmbXBlZy5vcmcv">FFmpeg</a>. La verdad es que es muy completa y te permite codificar todo tipo de audio y video. Hacer un ffmpeg -h asusta así que que mejor que unos ejemplos de guía rápida.</p>
<p>Los videos venían de una cámara JVC que los grababa a 1920&#215;1080 (lo que viene siendo <a title=\"FullHD 1920x1080 - 1080p\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2VuLndpa2lwZWRpYS5vcmcvd2lraS8xMDgwcA==">FullHD</a>). JVC usa un formato propio, el TOD, para codificar los vídeos (por lo menos en las cámaras de la serie Everio) y no todos los programas de edición lo importan/abren, así que el primer paso sería convertirlo a algo más común.</p>
<p><em>ffmpeg -i original_video.tod -acodec copy -vcodec copy video.avi</em></p>
<p>Como mi ordenador tiene bastante años y no necesitaba editarlo con calidad FullHD lo hice más pequeño pero sin perder calidad. Se podrían especificar todos los parámetros del audio/video:</p>
<ul>
<li>bitrate: -ab para el audio, -vb para el video, por defecto -b se refiere al video</li>
<li>tamaño: -s widthxheight</li>
<li>frames: -r num</li>
<li>etc</li>
</ul>
<p>para mí lo más cómodo fue usar la opción <em>-sameq</em> :</p>
<p><em>ffmpeg -i video.avi -s 1024&#215;600 -sameq -acodec copy video_small.avi</em></p>
<p>Si quisiéramos tener un formato PAL podríamos especificar <em>-s 720&#215;576 -r 25</em> y un bitrate pero es más sencillo pasarle <em>-tvstd pal</em></p>
<p>Convertir un wav a un mp3 sería tan sencillo como:</p>
<p><em>ffmpeg -i audio.wav -acodec mp3 -ab 192k audio.mp3</em></p>
<p>Ripear el audio de un video:</p>
<p><em>ffmpeg -i video.avi -vn -acodec mp3 audio.mp3</em></p>
<p>Si fuera un video cuyo audio ya estuviera en mp3 se podría haberle pasado<em> -acodec copy </em>directamente.</p>
<p>Si quisiéramos hacer una captura en video de lo que hacemos en el escritorio podríamos usar herramientas tipo xvidcap, recordmydesktop, etc pero esta es bien rápida y cómoda:</p>
<p><em>ffmpeg -f x11grab -s 1280&#215;1024 -i :0.0 mydesktop.avi</em></p>
<p>La suite completa de ffmpeg ofrece:</p>
<ul>
<li><tt>ffmpeg</tt>:  la herramienta CLI para convertir a diferentes formato ficheros multimedia.</li>
<li><tt>ffserve:</tt> un servidor de streaming para hacer broadcast.</li>
<li><tt>ffplay</tt>: un reproductor simple basado en <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5saWJzZGwub3JnLw==">SDL</a> y las librerías de ffmpeg.</li>
<li><tt>libavcodec</tt>: la libería que contiene decodificadores y codificadores para los codecs de audio y video.</li>
<li><tt>libavformat:</tt> la librería que contiene multiplexores y demultiplexores para los formatos tipo contenedor de los ficheros multimedia.</li>
</ul>
<p>He encontrado este estupendo tutorial de como crear un <a title=\"Small ffmpeg based video editor\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2RyYW5nZXIuY29tL2ZmbXBlZy8=">editor de video gracias a ffmpeg en menos de 1000 líneas de código.</a><br/><br/><i>&#8211;<br/>Fuente original en <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNz">http://vierito.es/wordpress</a></i><br/><br/><strong>Similar Posts:</strong>
<ul class="similar-posts">None Found
</ul>
<p><!-- Similar Posts took 8.907 ms --></p>
 <img src="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=271" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://vierito.es/wordpress/2009/01/22/convertir-videos-con-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>25C3: Nothing to Hide</title>
		<link>http://vierito.es/wordpress/2008/12/24/25c3-nothing-to-hide/</link>
		<comments>http://vierito.es/wordpress/2008/12/24/25c3-nothing-to-hide/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 23:49:40 +0000</pubDate>
		<dc:creator>vierito5</dc:creator>
				<category><![CDATA[electronics]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[25C3]]></category>
		<category><![CDATA[berlin]]></category>
		<category><![CDATA[Chaos Communication Congress]]></category>
		<category><![CDATA[cracking]]></category>
		<category><![CDATA[microcontrollers]]></category>
		<category><![CDATA[nothing to hide]]></category>
		<category><![CDATA[reversing]]></category>

		<guid isPermaLink="false">http://vierito.es/wordpress/?p=237</guid>
		<description><![CDATA[Un año más se celebra en Berlín, del 27 al 30 de diciembre, el Chaos Communication Congress en su vigésimo quinta edición. A pesar de mis intenciones iniciales de acudir a este evento el dinero y los estudios mandan así que me quedaré en casita, sniff. Os pongo una lista de conferencias que más me [...]]]></description>
			<content:encoded><![CDATA[<p>Un año más se celebra en <a title=\"Berlín\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMDgvMDkvZW4tYmVybGluLw==">Berlín</a>, del 27 al 30 de diciembre, el <strong><a title=\"25th Communication Chaos Congress - 25C3\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC8=">Chaos Communication Congress</a> </strong>en su vigésimo quinta edición. A pesar de mis intenciones iniciales de acudir a este evento el dinero y los estudios mandan así que me quedaré en casita, sniff.</p>
<p>Os pongo una lista de conferencias que más me llaman del <em>Fahrplan</em> que hay:</p>
<p>- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMjkwNC5lbi5odG1s">Solar-powering your Geek Gear</a>: Alternative and mobile power for your all you little toys.</p>
<p>- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMjkwMS5lbi5odG1s">FAIFA: A first open source PLC tool</a>: PowerLineCommunication has now their open source tool.</p>
<p class="subtitle">- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMjk1My5lbi5odG1s">Security Failures in Smart Card Payment Systems</a>: Tampering the Tamper-Proof. Esta para <a title=\"TuXeD\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3R1eGVkLnNlcnZlYmxvZy5uZXQ=">TuXeD</a> <img src='http://vierito.es/wordpress/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p class="subtitle">- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMjg5Ni5lbi5odG1s">Chip Reverse Engineering</a></p>
<p class="subtitle">- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMjgzOS5lbi5odG1s">Cracking the MSP430 BSL</a></p>
<p class="subtitle">- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMjkyMi5lbi5odG1s">Advanced memory forensics: The Cold Boot Attacks</a>: Recovering keys and other secrets after power off.</p>
<p class="subtitle">- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMjk5Ny5lbi5odG1s">Locating Mobile Phones using SS7</a></p>
<p class="subtitle">- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMjk3MC5lbi5odG1s">coreboot: Beyond The Final Frontier</a>: Open source BIOS replacement with a radical approach to boot.</p>
<p class="subtitle">- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMzAzMC5lbi5odG1s">Messing Around with Garage Doors</a>: Breaking Remote Keyless Entry Systems with Power Analysis.</p>
<p class="subtitle">- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMjg0My5lbi5odG1s">Algorithmic Music in a Box</a>: Doing music with microcontrollers.</p>
<p class="subtitle">- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMzAwOC5lbi5odG1s">Anatomy of smartphone hardware</a>: Dissecting contemporary cellphone hardware.</p>
<p class="subtitle">- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMjg5MC5lbi5odG1s">Scalable Swarm Robotics</a>: Formica: a cheap, open research platform.</p>
<p class="subtitle">- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMjc5OS5lbi5odG1s">Console Hacking 2008: Wii Fail</a>: Is implementation the enemy of design? Que gran pregunta.</p>
<p class="subtitle">- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMjg3NC5lbi5odG1s">The Ultimate Commodore 64 Talk</a>: Everything about the C64 in 64 Minutes. Brutal, enlace a su blog <a title=\"25C3 Commodore64 Talk\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5wYWdldGFibGUuY29tLz9wPTUz">http://www.pagetable.com/?p=53</a></p>
<p class="subtitle">- <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC9GYWhycGxhbi9ldmVudHMvMjk5NS5lbi5odG1s">Predictable RNG in the vulnerable Debian OpenSSL package</a>: the What and the How. Aunque ya esté muy visto&#8230; para echarse unas risas.</p>
<p class="subtitle">Me ha llamado la atención lo que han denominado como <a title=\"25C3 Lightning Talks\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC93aWtpL0xpZ2h0bmluZ19UYWxrcw==">Lightning Talks</a>, rondas de 10 presentaciones de 4 minutos donde puedes exponer tu idea más descabellada, presentar tu proyecto, enseñar un cacho de hardware que te emocione, etc y así ganar adeptos para colaborar o simplemente echarte unas risas.</p>
<p class="subtitle">Y por supuesto, además de todo lo anterior, workshops sobre <a title=\"25C3 Microcontrollers\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC93aWtpL01pY3JvY29udHJvbGxlcldvcmtzaG9w">microcontroladores</a>, el <a title=\"Quadrocopter\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL2V2ZW50cy5jY2MuZGUvY29uZ3Jlc3MvMjAwOC93aWtpL0J1aWxkX2FfUXVhZHJvY29wdGVy">quadrocopter</a>, etc.</p>
<p class="subtitle">En fin, otro año será, siempre me quedará <a title=\"Youtube.com\" href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3lvdXR1YmUuY29t">youtube.com</a> para ver las charlas.</p>
<p><br/><br/><i>&#8211;<br/>Fuente original en <a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNz">http://vierito.es/wordpress</a></i><br/><br/><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMTEvMjEvcGFyYS1sb3MtYW1hbnRlcy1kZS14a2NkLWxsZWdhLw==" rel=\"bookmark\" title=\"November 21, 2008\">Para los amantes de XKCD llega&#8230;</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMTAvMzAvZnByaW50LWxhLWltcGxlbWV0YWNpb24tZGVsLWRyaXZlci8=" rel=\"bookmark\" title=\"October 30, 2008\">[Fprint] La implemetación del driver</a></li>
<li><a href="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3ZpZXJpdG8uZXMvd29yZHByZXNzLzIwMDgvMDYvMDIvc2QtY2FyZC10aS1yZWFkZXItZW4tbG9zLXBvcnRhdGlsZXMtaHAtYmFqby1saW51eC8=" rel=\"bookmark\" title=\"June 2, 2008\">SD Card TI Reader en los portátiles HP bajo linux</a></li>
</ul>
<p><!-- Similar Posts took 42.465 ms --></p>
 <img src="http://vierito.es/wordpress/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=237" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://vierito.es/wordpress/2008/12/24/25c3-nothing-to-hide/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

