<?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>Q-Protex Blog</title>
	<atom:link href="http://blog.q-protex.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.q-protex.com</link>
	<description>Posts sobre Ingeniería Inversa de Software y Seguridad Informática en general</description>
	<lastBuildDate>Wed, 03 Aug 2011 01:31:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Hash database de palabras en español y jergas peruanas</title>
		<link>http://blog.q-protex.com/2010/12/27/hash-database-de-palabras-en-espanol-y-jergas-peruanas/</link>
		<comments>http://blog.q-protex.com/2010/12/27/hash-database-de-palabras-en-espanol-y-jergas-peruanas/#comments</comments>
		<pubDate>Tue, 28 Dec 2010 01:48:04 +0000</pubDate>
		<dc:creator>m.febres</dc:creator>
				<category><![CDATA[Seguridad Informática]]></category>

		<guid isPermaLink="false">http://blog.q-protex.com/?p=17</guid>
		<description><![CDATA[Desde hoy existe una nueva sección llamada Recursos donde aparecerán con el tiempo diferentes recursos relacionados a la seguridad informática. El día de hoy saco a la luz una pequeña base de datos de hashes de palabras en español y jergas peruanas que he recolectado de diferentes fuentes. Con el tiempo iré agregando diferentes tipos de hash, [...]]]></description>
			<content:encoded><![CDATA[<p>Desde hoy existe una nueva sección llamada <strong>Recursos</strong> donde aparecerán con el tiempo diferentes recursos relacionados a la seguridad informática. El día de hoy saco a la luz una pequeña base de datos de hashes de palabras en español y jergas peruanas que he recolectado de diferentes fuentes. Con el tiempo iré agregando diferentes tipos de hash, y si tienen alguna palabra en español o una jerga peruana que no aparezca en la lista no duden en mandarmela.</p>
<p>Esta base de datos la pueden encontrar en el menú Recursos bajo el nombre de <strong>Hash Database!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.q-protex.com/2010/12/27/hash-database-de-palabras-en-espanol-y-jergas-peruanas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Activar Broadcom BCM4322 en BT4</title>
		<link>http://blog.q-protex.com/2010/12/26/activar-broadcom-bcm4322-en-bt4/</link>
		<comments>http://blog.q-protex.com/2010/12/26/activar-broadcom-bcm4322-en-bt4/#comments</comments>
		<pubDate>Sun, 26 Dec 2010 06:11:40 +0000</pubDate>
		<dc:creator>m.febres</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.q-protex.com/?p=11</guid>
		<description><![CDATA[Una de las razones por la cual no usaba el Backtrack 4 que tenía instalado en mi netbook era que la tarjeta de red inalámbrica no era reconocida. Mi netbook es una HP Mini 2140 y viene con una tarjeta Broadcom BCM 4322 la cual sí era reconocida por BT3 y por todas las versiones [...]]]></description>
			<content:encoded><![CDATA[<p>Una de las razones por la cual no usaba el Backtrack 4 que tenía instalado en mi netbook era que la tarjeta de red inalámbrica no era reconocida. Mi netbook es una HP Mini 2140 y viene con una tarjeta Broadcom BCM 4322 la cual sí era reconocida por BT3 y por todas las versiones de Ubuntu.</p>
<p>Hace unos dias decidí intentar nuevamente configurar dicha tarjeta de red y esta vez si lo logré y fué mucho mas sencillo de lo que me esperaba tomando en cuenta que soy un completo novato en linux.</p>
<p>Primero probe instalar el driver <a href="http://www.broadcom.com/support/802.11/linux_sta.php" target="_blank">STA</a>  siguiendo las instrucciones que aparecen en el readme y luego probe instalar el ndiswrapper. En ambos casos no tuve éxito debido a diferentes errores que aparecían y que segúro podrían haber sido resueltos por alguien con algo de experiencia en linux.</p>
<p>Al final la solución que encontré fue la siguiente:</p>
<p>&nbsp;</p>
<p>1. Instalar Hardware Drivers: Asegúrense de escoger la versión para KDE si están usando BT.</p>
<p><a href="http://blog.q-protex.com/wp-content/uploads/2010/12/broadbt41.png"><img class="alignnone size-full wp-image-14" title="broadbt41" src="http://blog.q-protex.com/wp-content/uploads/2010/12/broadbt41.png" alt="" width="717" height="403" /></a></p>
<p>&nbsp;</p>
<p>2. Ejecutar Hardware Drivers: Seleccionar Broadcom STA wireless driver y activarla!</p>
<p><a href="http://blog.q-protex.com/wp-content/uploads/2010/12/broadbt42.png"><img class="alignnone size-full wp-image-15" title="broadbt42" src="http://blog.q-protex.com/wp-content/uploads/2010/12/broadbt42.png" alt="" width="414" height="504" /></a></p>
<p>&nbsp;</p>
<p>3. Reiniciar!</p>
<p>Con estos tres simples pasos conseguí hacer que mi BT R2 reconozca mi tarjeta Broadcom. Para mi era suficiente que pueda ser reconocida para navegar en internet y no para hacer auditorías wireless pues casi nunca las hago y las pocas veces que lo he intentado utilizo una tarjeta de red externa con chipset Realtek.</p>
<p>Espero que a alguien con la misma tarjeta le ayude este post!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.q-protex.com/2010/12/26/activar-broadcom-bcm4322-en-bt4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LimaHack 2010 este Jueves 16</title>
		<link>http://blog.q-protex.com/2010/12/14/limahack-2010-este-jueves-16/</link>
		<comments>http://blog.q-protex.com/2010/12/14/limahack-2010-este-jueves-16/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 23:03:06 +0000</pubDate>
		<dc:creator>m.febres</dc:creator>
				<category><![CDATA[Seguridad Informática]]></category>
		<category><![CDATA[limahack]]></category>
		<category><![CDATA[opensec]]></category>

		<guid isPermaLink="false">http://blog.q-protex.com/?p=29</guid>
		<description><![CDATA[Este Jueves 16 de Diciembre se llevará a cabo la segunda edición del LimaHack 2010 organizado principalmente por Open-Sec. Para esta ocasión han tenido la gentileza de invitarme a ser parte del panel de expositores y dar una charla sobre ingeniería inversa. Los ponentes y los temas a exponer son los siguientes: Andrés Morales &#8211; Consultor Senior en [...]]]></description>
			<content:encoded><![CDATA[<p>Este Jueves 16 de Diciembre se llevará a cabo la segunda edición del <a href="http://www.limahack.com/" target="_blank">LimaHack 2010</a> organizado principalmente por <a href="http://www.open-sec.com/" target="_blank">Open-Sec</a>. Para esta ocasión han tenido la gentileza de invitarme a ser parte del panel de expositores y dar una charla sobre ingeniería inversa.</p>
<p>Los ponentes y los temas a exponer son los siguientes:</p>
<ul>
<li>Andrés Morales &#8211; Consultor Senior en Ximark
<ul>
<li><em>PhD. en explotación con MetaSploit</em></li>
</ul>
</li>
<li><strong>César Cuadra  &#8211; Gerente de Consultoria en Open-Sec</strong>
<ul>
<li><em>La Fuerza está en ti : Desarrollo de Exploits II</em></li>
</ul>
</li>
<li><strong>Miguel Febres  - Experto en Ingeniería Reversa y propietario de Q-Protex</strong>
<ul>
<li><em>Mamá : De grande quiero ser Ingeniero Reverso</em></li>
</ul>
</li>
<li><strong>Juan Pablo Quiñe &#8211; Consultor en Seguridad de la Información</strong>
<ul>
<li><em>Lockpicking 101</em></li>
</ul>
</li>
<li><strong>Mauricio Urizar &#8211; Consultor Senior en Open-Sec</strong></li>
<ul>
<li><em>Top 10 : Los 10 casos más caseritos del 2010 en hacking</em></li>
</ul>
</ul>
<p>Para registrarse deben seguir los pasos que se mencionan en este <a href="http://www.limahack.com/index.aspx?pagina=registro.aspx" target="_blank">link</a>. La entrada es gratis! Los esperamos!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.q-protex.com/2010/12/14/limahack-2010-este-jueves-16/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chema Alonso en Lima</title>
		<link>http://blog.q-protex.com/2010/10/09/chema-alonso-en-lima/</link>
		<comments>http://blog.q-protex.com/2010/10/09/chema-alonso-en-lima/#comments</comments>
		<pubDate>Sun, 10 Oct 2010 00:04:36 +0000</pubDate>
		<dc:creator>m.febres</dc:creator>
				<category><![CDATA[Seguridad Informática]]></category>
		<category><![CDATA[chema alonso]]></category>
		<category><![CDATA[evento]]></category>
		<category><![CDATA[first]]></category>

		<guid isPermaLink="false">http://blog.q-protex.com/?p=31</guid>
		<description><![CDATA[El autor del blog Un informático en el lado del mal, Chema Alonso, estará en Lima la próxima semana para participar en la conferencia FIRST y dictar un taller sobre malware. Aprovechen que es un evento gratuito! Mas información en: http://www.elladodelmal.com/2010/10/la-fiesta-de-la-hispanidad-en-peru.html]]></description>
			<content:encoded><![CDATA[<p>El autor del blog <em>Un informático en el lado del mal, </em>Chema Alonso, estará en Lima la próxima semana para participar en la conferencia <a href="http://www.first.org/events/colloquia/lima2010/program/#d20101012" target="_blank">FIRST</a> y dictar un taller sobre malware. Aprovechen que es un evento gratuito!</p>
<p><strong>Mas información en:</strong> <a href="http://www.elladodelmal.com/2010/10/la-fiesta-de-la-hispanidad-en-peru.html">http://www.elladodelmal.com/2010/10/la-fiesta-de-la-hispanidad-en-peru.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.q-protex.com/2010/10/09/chema-alonso-en-lima/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Re-Lanzamiento 3er Reto Forense Comunidad DragonJAR</title>
		<link>http://blog.q-protex.com/2010/10/06/re-lanzamiento-3er-reto-forense-comunidad-dragonjar/</link>
		<comments>http://blog.q-protex.com/2010/10/06/re-lanzamiento-3er-reto-forense-comunidad-dragonjar/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 23:57:59 +0000</pubDate>
		<dc:creator>m.febres</dc:creator>
				<category><![CDATA[Seguridad Informática]]></category>
		<category><![CDATA[dragonjar]]></category>
		<category><![CDATA[forense]]></category>

		<guid isPermaLink="false">http://blog.q-protex.com/?p=34</guid>
		<description><![CDATA[Buenas noticias! Para los que no pudimos (me incluyo) terminar de ver el reto Forense que DragonJar lanzó en la EkoParty 2010, quiero informarles que se ha relanzado el reto públicamente y hay plazo hasta este 10 de octubre para entregar los informes con la explicacion a los siguientes puntos: Determinar si 0xBlack realmente se suicido Si [...]]]></description>
			<content:encoded><![CDATA[<p>Buenas noticias!</p>
<p>Para los que no pudimos (me incluyo) terminar de ver el reto Forense que <a href="http://www.dragonjar.org/" target="_blank">DragonJar</a> lanzó en la EkoParty 2010, quiero informarles que se ha relanzado el reto públicamente y hay plazo hasta este 10 de octubre para entregar los informes con la explicacion a los siguientes puntos:</p>
<ul>
<li>Determinar si 0xBlack realmente se suicido</li>
<li>Si fue un suicidio, identificar las causas que hicieron que 0xBlack, se suicidara</li>
<li>Si fue un homicidio, determinar el autor y el motivo por el cual se cometió el asesinato</li>
<li>Recuperar la información robada a la empresa PlanEx</li>
<li>Documentar todo en los informes técnico y ejecutivo.</li>
</ul>
<p>Los entregables a mandar son:</p>
<ul>
<li><strong>Reporte Ejecutivo:</strong> Debe explicar en un lenguaje entendible a cualquier persona, cuáles fueron las pruebas encontradas en la maquina y porque gracias a ellas puede estar seguro de lo que sucedió (no debe superar las 4 páginas).</li>
<li><strong>Reporte Técnico:</strong> Debe explicar de forma técnica, todos los pasos realizados para obtener la evidencia, realizar los análisis y sacar las conclusiones (20 páginas o más).</li>
</ul>
<p>Mas información en: <a href="http://www.dragonjar.org/re-lanzamiento-3er-reto-forense-comunidad-dragonjar.xhtml">http://www.dragonjar.org/re-lanzamiento-3er-reto-forense-comunidad-dragonjar.xhtml</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.q-protex.com/2010/10/06/re-lanzamiento-3er-reto-forense-comunidad-dragonjar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resumen de la EkoParty 2010</title>
		<link>http://blog.q-protex.com/2010/10/06/resumen-de-la-ekoparty-2010/</link>
		<comments>http://blog.q-protex.com/2010/10/06/resumen-de-la-ekoparty-2010/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 20:40:00 +0000</pubDate>
		<dc:creator>m.febres</dc:creator>
				<category><![CDATA[Seguridad Informática]]></category>
		<category><![CDATA[core]]></category>
		<category><![CDATA[crackslatinos]]></category>
		<category><![CDATA[ekoparty]]></category>
		<category><![CDATA[eset]]></category>
		<category><![CDATA[reverse]]></category>

		<guid isPermaLink="false">http://blog.q-protex.com/?p=20</guid>
		<description><![CDATA[Después de unas semanas de descanso (y de viajes) estoy de vuelta para compartir con ustedes un resumen de lo que fue mi viaje a EkoParty 2010, evento de seguridad informática que se realizó en Buenos Aires, Argentina. Llegué el miércoles 15 de Septiembre a Bs.As por la mañana y de inmediato me dirigí del hotel [...]]]></description>
			<content:encoded><![CDATA[<p>Después de unas semanas de descanso (y de viajes) estoy de vuelta para compartir con ustedes un resumen de lo que fue mi viaje a <a href="http://www.ekoparty.org/" target="_blank">EkoParty 2010</a>, evento de seguridad informática que se realizó en Buenos Aires, Argentina.</p>
<p>Llegué el miércoles 15 de Septiembre a Bs.As por la mañana y de inmediato me dirigí del hotel a las instalaciones donde se realizó el taller de <a href="http://www.ekoparty.org/training-modern-malware-reverse-engineering.php" target="_blank">Modern Malware Reverse Engineering</a> (taller al cual asistí gracias a que fuí unos de los ganadores del concurso <a href="http://www.ekoparty.org/Challenge-ESET.php" target="_blank">Desafío ESET 2010 &#8211; Crackme</a>). El taller duro casi 8 horas y lo dictó Joan Calvet, un colaborador de Eset que trabaja de forma independiente y que lamentablemente no se pudo quedar para la EkoParty ya que me contó que se iba a ir a Uruguay con su enamorada para esos días. El lugar donde se realizó el taller era un centro de estudios por lo que el salón contaba con todo lo necesario para dictar el taller. Fuimos alrededor de 15 personas y cada uno pudo seguir la clase usando un Windows virtual cargado con el material que estaba formado por herramientas, manuales y binarios de malware reales.</p>
<p>El sílabo del curso fue el siguiente:</p>
<ol>
<li>Basics on malware RE
<ol>
<li>Concepts and tools</li>
<li>UPX in-depth</li>
<li>Storm example</li>
</ol>
</li>
<li>Static analysis</li>
<li>Protections
<ol>
<li>Peerfrag</li>
<li>Waledac</li>
</ol>
</li>
<li>Swizzor in-depth</li>
<li>What happens once unpacked ?</li>
<li>Bonus exercises!</li>
</ol>
<p>A eso de las 02:00pm hicimos una pausa para el almuerzo y fue una grata noticia saber que Eset invitaba el almuerzo. Nos fuimos a una parrilla muy cerca del lugar y estuvimos departiendo un momento grato charlando entre todos. Ahi tuve la oportunidad de conocer un poco mas a Federico Pacheco de Eset y a Joan Calvet. Luego del almuerzo regresamos a seguir con el taller pero el tiempo no fue suficiente y el taller termino sin haber visto todos los slides de la presentación, sin embargo la información proporcionada durante el taller junto con los ejercicios fueron suficientes para que uno pueda seguir por su cuenta luego en casa.</p>
<p>&nbsp;</p>
<p>Al día siguiente me dirigí en metro a Ciudad Cultural Konex, lugar donde se realizó la EkoParty y conocí finalmente en persona a muchos amigos que tengo allá de la lista de CracksLatinos.</p>
<table border="0">
<tbody>
<tr>
<td id="" lang="" dir="" scope="" align="" valign="">
<p style="text-align: center;"><img src="http://lh6.ggpht.com/_0h2Gk5NiftE/TJTl5WI4HEI/AAAAAAAAACg/SynTk4VDCoY/s288/IMG_1005.JPG" alt="" width="288" height="216" /></p>
<p style="text-align: center;">Con los amigos de Crackslatinos! De iz. a de.<br />
X,X,UlisesSoft,Ztocker,Solid,Ricnar,Mauro,emadicius(yo)<br />
Mancu,NcR,TioPasta</p>
</td>
<td id="" lang="" dir="" scope="" align="" valign="top">Al bajar del metro me disponía a buscar la dirección del Centro Cultural Konex y me topé con Solid, un viejo conocido de la lista de Crackslatinos y juntos nos dirigimos a darle el encuentro a los demás que ya estaban en la cola esperando por entrar. Estuvimos esperando mucho ya que recién a eso de las 09:00am abrieron las puertas y habiamos estado esperando desde las 7:30am.Al entrar, nos dieron un brazalete, y la agenda en versión collar con las presentaciones a realizarse cada día. Al parecer uno de las agendas estaba premiada pero nunca me enteré quien fue el ganador o cual era el premio.</td>
</tr>
<tr>
<td colspan="1"></td>
<td colspan="1"></td>
</tr>
</tbody>
</table>
<p><strong>Las charlas</strong></p>
<p>Las charlas empezaron a eso de las 10:00am así que hubo un desfase entre las horas plasmadas en la agenda y la hora real en que empezaron las charlas. Aparte, hubieron algunos cambios de último minuto que fueron informadas debidamente en una segunda versión de la agenda. Estuve presente en la mayoría de charlas pero no en todas ya que estar 8 horas continuas sentado definitivamente produce un cansancio mental y a veces físico. Las que mas me llamaron la atención fueron:</p>
<ul>
<li>Understanding the Win SMB NTLM weak nonce vulnerability: Fue increíble saber que hay una vulnerabilidad de 17 años de antiguedad.</li>
<li><strong>Atacking VoIP… un paraíso!:</strong> Lo que sabíamos: VoIP estuvo relegado por mucho tiempo y recién desde hace poco se le ha puesto el ojo en cuanto a seguridad.</li>
<li><strong>Pentesting Driven por FOCA:</strong> La utilidad de la herramienta + el carisma de Chema hicieron de esta charla una de las mas entretenidas y curiosas.</li>
<li><strong>Exploiting Digital Cameras:</strong> Otra Proof of Concept (PoC) de un dispositivo de uso masivo.</li>
<li><strong>Padding Oracles Everywhere:</strong> A mi parecer esta fue la charla mas importante debido al revuelo que generó en los medios. Incluso distribuyeron un exploit 0day que afecta aplicaciones web hechas en .net en un par de memorias usb y las lanzaron al público.</li>
</ul>
<p><strong>Los stands</strong></p>
<p>Cuando uno no estaba en las charlas, seguro estaba paseando por uno de los stands de las empresas auspiciadoras:</p>
<ul>
<li><strong>ESET:</strong> Sortearon un PsP que se lo llevó un amigo (Tena) y también regalaban agendas y pelotas antistress con el logo de Eset a los que llegasen a cierto puntaje en un juego de captura de virus usando un juego especialmente hecho por Eset para el Wii.</li>
<li><strong>CORE:</strong> Me regalaron una navaja suiza con el logo de CORE!</li>
</ul>
<p><strong>Los retos</strong></p>
<p>Uno de los mas resaltantes fue el que organizó <a href="http://www.dragonjar.org/" target="_blank">DragonJar</a>. Era un reto de análisis forense que consitía en analizar una imagen vmware y tomar unas fotos del escenario armado como la escena del crimen. Luego se tenía que entregar un informe determinando si había sido un suicidio o un asesinato. Dicho reto me llamo mucho la atención y aunque no tengo ninguna experiencia en análisis forense trate de darle una mirada. Esto hizo que tome la desición de especializarme en esta rama en el futuro.</p>
<p>En conclusión fue una muy buena experiencia estar presente en esta conferencia por las charlas mismas, el conocer a mis amigos virtuales y establecer contactos con algunas empresas de allá para futuras oportunidades laborales.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.q-protex.com/2010/10/06/resumen-de-la-ekoparty-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Decompiling MMBuilder applications Part 3</title>
		<link>http://blog.q-protex.com/2010/08/04/decompiling-mmbuilder-applications-part-3/</link>
		<comments>http://blog.q-protex.com/2010/08/04/decompiling-mmbuilder-applications-part-3/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 03:12:06 +0000</pubDate>
		<dc:creator>m.febres</dc:creator>
				<category><![CDATA[Ingeniería Inversa]]></category>
		<category><![CDATA[Seguridad Informática]]></category>
		<category><![CDATA[decompiling]]></category>
		<category><![CDATA[mmbuilder]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.q-protex.com/?p=60</guid>
		<description><![CDATA[&#60;&#60; Part 2 Creating a python script With all the information we got in the previous articles let&#8217;s create a python script to automate this process: &#160; Requirementes and notes: python 2.6+ pefile # MMUnbuilder v0.1 # Based in MMBuilder file version 3.00 # Programmed by Miguel Febres # m.febres at q-protex.com # http://www.q-protex.com &#160; [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Part 2" href="http://blog.q-protex.com/2010/08/03/decompiling-mmbuilder-applications-part-2/">&lt;&lt; Part 2</a></p>
<h2>Creating a python script</h2>
<p>With all the information we got in the previous articles let&#8217;s create a python script to automate this process:</p>
<p>&nbsp;</p>
<p><span class="Apple-style-span" style="font-weight: bold;">Requirementes and notes:</span></p>
<ul>
<li>python 2.6+</li>
<li><a href="http://code.google.com/p/pefile/" target="_blank">pefile</a></li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># MMUnbuilder v0.1</span>
<span style="color: #808080; font-style: italic;"># Based in MMBuilder file version 3.00</span>
<span style="color: #808080; font-style: italic;"># Programmed by Miguel Febres</span>
<span style="color: #808080; font-style: italic;"># m.febres at q-protex.com</span>
<span style="color: #808080; font-style: italic;"># http://www.q-protex.com</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> pefile
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">zlib</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">binascii</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">struct</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">getopt</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> header<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
<span style="color: #ff7700;font-weight:bold;">print</span> u<span style="color: #483d8b;">&quot;&quot;&quot;<span style="color: #000099; font-weight: bold;">\</span>
&nbsp;
MMUnbuilder - v0.1
Programmed by Miguel Febres - http://www.q-protex.com
&quot;&quot;&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> usage<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
header<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> u<span style="color: #483d8b;">&quot;&quot;&quot;<span style="color: #000099; font-weight: bold;">\</span>
Usage: %s [option]
&nbsp;
Decompiles mmbuilder exe files.
&nbsp;
Options:
-u&amp;lt;File&amp;gt;       decompiles given file
-h             shows this help text
&quot;&quot;&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span>argv<span style="color: black;">&#41;</span>:
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
opts, args = <span style="color: #dc143c;">getopt</span>.<span style="color: black;">gnu_getopt</span><span style="color: black;">&#40;</span>argv, <span style="color: #483d8b;">&quot;u:hl:m:&quot;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #dc143c;">getopt</span>.<span style="color: black;">GetoptError</span>:
usage<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">for</span> o, a <span style="color: #ff7700;font-weight:bold;">in</span> opts:
<span style="color: #ff7700;font-weight:bold;">if</span> o == <span style="color: #483d8b;">&quot;-h&quot;</span>:
usage<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">elif</span> o == <span style="color: #483d8b;">&quot;-l&quot;</span>: <span style="color: #808080; font-style: italic;">#load new mbd to exe</span>
exeFile=a
<span style="color: #ff7700;font-weight:bold;">elif</span> o == <span style="color: #483d8b;">&quot;-m&quot;</span>: <span style="color: #808080; font-style: italic;">#load new mbd to exe</span>
loadMBD<span style="color: black;">&#40;</span>exeFile,a<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">elif</span> o == <span style="color: #483d8b;">&quot;-u&quot;</span>: <span style="color: #808080; font-style: italic;">#unbuild</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">exists</span><span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span>:
unbuild<span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">else</span>:
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;File doesn't exist!&quot;</span>
<span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">else</span>:
usage<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> loadMBD<span style="color: black;">&#40;</span>exeFile,mbdFile<span style="color: black;">&#41;</span>:
header<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;">#Open the exe file</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Opening &quot;</span> + exeFile
pe = pefile.<span style="color: black;">PE</span><span style="color: black;">&#40;</span>exeFile<span style="color: black;">&#41;</span>
&nbsp;
filebuffer = pe.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
s = pe.<span style="color: black;">sections</span><span style="color: black;">&#91;</span>-<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span> <span style="color: #808080; font-style: italic;">#get last section</span>
eof=s.<span style="color: black;">PointerToRawData</span> + s.<span style="color: black;">SizeOfRawData</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#if the size of the file is bigger than last section offset+length</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Checking size...&quot;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>filebuffer<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;</span> eof<span style="color: black;">&#41;</span>:
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Overlay data found in the end of PE file!&quot;</span>
<span style="color: #808080; font-style: italic;">#get mmb data</span>
mmbdata=filebuffer<span style="color: black;">&#91;</span>eof:<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#check header</span>
sizeHeader=<span style="color: #008000;">ord</span><span style="color: black;">&#40;</span>filebuffer<span style="color: black;">&#91;</span>eof<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Checking if overlay data is from Multimedia Builder...&quot;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> filebuffer<span style="color: black;">&#91;</span>eof+<span style="color: #ff4500;">1</span>:eof+sizeHeader-<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>==<span style="color: #483d8b;">&quot;MMBuilder&quot;</span>:
<span style="color: #808080; font-style: italic;">#print filebuffer[-4:]</span>
dataSize=<span style="color: #dc143c;">struct</span>.<span style="color: black;">unpack</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&amp;lt; I&quot;</span>, filebuffer<span style="color: black;">&#91;</span>-<span style="color: #ff4500;">4</span>:<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> dataSize<span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;</span><span style="color: #ff4500;">0</span>:
footerData=filebuffer<span style="color: black;">&#91;</span>eof+dataSize:-<span style="color: #ff4500;">4</span><span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> footerData
filebuffer=filebuffer<span style="color: black;">&#91;</span>:eof<span style="color: black;">&#93;</span> <span style="color: #808080; font-style: italic;">#discard overlay data</span>
&nbsp;
f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span>mbdFile, <span style="color: #483d8b;">'rb'</span><span style="color: black;">&#41;</span>
mbdContents=f.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
sizembdContents=<span style="color: #008000;">len</span><span style="color: black;">&#40;</span>mbdContents<span style="color: black;">&#41;</span>
f.<span style="color: black;">close</span>
&nbsp;
f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">splitext</span><span style="color: black;">&#40;</span>exeFile<span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> + <span style="color: #483d8b;">' MODIFIED.exe'</span>, <span style="color: #483d8b;">'wb'</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>filebuffer<span style="color: black;">&#91;</span>:eof<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>mbdContents<span style="color: black;">&#41;</span>
f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>footerData<span style="color: black;">&#41;</span>
f.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">struct</span>.<span style="color: black;">pack</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&amp;lt; I&quot;</span>,sizembdContents<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;">#size of footerdata</span>
f.<span style="color: black;">close</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">else</span>:
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] File is not made in MMbuilder!&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">else</span>:
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] File does not have overlay data!&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> unbuild<span style="color: black;">&#40;</span>name<span style="color: black;">&#41;</span>:
header<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;">#Open the exe file</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Opening &quot;</span> + name
pe = pefile.<span style="color: black;">PE</span><span style="color: black;">&#40;</span>name<span style="color: black;">&#41;</span>
&nbsp;
filebuffer = pe.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
s = pe.<span style="color: black;">sections</span><span style="color: black;">&#91;</span>-<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span> <span style="color: #808080; font-style: italic;">#get last section</span>
eof=s.<span style="color: black;">PointerToRawData</span> + s.<span style="color: black;">SizeOfRawData</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#if the size of the file is bigger than last section offset+length</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Checking size...&quot;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>filebuffer<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;</span> eof<span style="color: black;">&#41;</span>:
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Overlay data found in the end of PE file!&quot;</span>
<span style="color: #808080; font-style: italic;">#get mmb data</span>
mmbdata=filebuffer<span style="color: black;">&#91;</span>eof:<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#check header</span>
sizeHeader=<span style="color: #008000;">ord</span><span style="color: black;">&#40;</span>filebuffer<span style="color: black;">&#91;</span>eof<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Checking if overlay data is from Multimedia Builder...&quot;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> filebuffer<span style="color: black;">&#91;</span>eof+<span style="color: #ff4500;">1</span>:eof+sizeHeader-<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>==<span style="color: #483d8b;">&quot;MMBuilder&quot;</span>:
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Multimedia Builder format version &quot;</span> + filebuffer<span style="color: black;">&#91;</span>eof+<span style="color: #ff4500;">10</span>:eof+sizeHeader+<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span> + <span style="color: #483d8b;">&quot; found!&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Checking if data is compiled with security layer...&quot;</span>
<span style="color: #808080; font-style: italic;">#print ord(filebuffer[eof+sizeHeader+1:eof+sizeHeader+2])</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">ord</span><span style="color: black;">&#40;</span>filebuffer<span style="color: black;">&#91;</span>eof+sizeHeader+<span style="color: #ff4500;">1</span>:eof+sizeHeader+<span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>==0x01:
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Security Layer FOUND!&quot;</span>
newPointer = filebuffer<span style="color: black;">&#91;</span>eof+sizeHeader+<span style="color: #ff4500;">5</span>:eof+sizeHeader+<span style="color: #ff4500;">9</span><span style="color: black;">&#93;</span>
sizeProtectedData = <span style="color: #dc143c;">struct</span>.<span style="color: black;">unpack</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&amp;lt; I&quot;</span>, filebuffer<span style="color: black;">&#91;</span>eof+sizeHeader+<span style="color: #ff4500;">9</span>:eof+sizeHeader+<span style="color: #ff4500;">13</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Size of protected data: &quot;</span> + <span style="color: #dc143c;">repr</span><span style="color: black;">&#40;</span>sizeProtectedData<span style="color: black;">&#41;</span>
compressedData=filebuffer<span style="color: black;">&#91;</span>eof+sizeHeader+<span style="color: #ff4500;">13</span>:eof+sizeHeader+<span style="color: #ff4500;">13</span>+sizeProtectedData<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Uncompressing: &quot;</span>
mmbdata = <span style="color: #dc143c;">zlib</span>.<span style="color: black;">decompress</span><span style="color: black;">&#40;</span>compressedData<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Saving unprotected exe...&quot;</span>
f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">splitext</span><span style="color: black;">&#40;</span>name<span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> + <span style="color: #483d8b;">' UNPROTECTED.exe'</span>, <span style="color: #483d8b;">'wb'</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>filebuffer<span style="color: black;">&#91;</span>:eof<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># save original exe contents</span>
f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>mmbdata<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;">#save uncompressed data</span>
f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>filebuffer<span style="color: black;">&#91;</span>eof+sizeHeader+<span style="color: #ff4500;">13</span>+sizeProtectedData:-<span style="color: #ff4500;">4</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;">#save footer metadata without pointer</span>
f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>newPointer<span style="color: black;">&#41;</span>
f.<span style="color: black;">close</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">else</span>:
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Security Layer not found!&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Saving project...&quot;</span>
f = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">splitext</span><span style="color: black;">&#40;</span>name<span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span> + <span style="color: #483d8b;">'.mbd'</span>, <span style="color: #483d8b;">'wb'</span><span style="color: black;">&#41;</span>
f.<span style="color: black;">write</span><span style="color: black;">&#40;</span>mmbdata<span style="color: black;">&#41;</span>
f.<span style="color: black;">close</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Work done!&quot;</span>
<span style="color: #ff7700;font-weight:bold;">else</span>:
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] File is not made in MMbuilder!&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">else</span>:
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] File does not have overlay data!&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">&amp;</span>gt<span style="color: #66cc66;">;</span><span style="color: #ff4500;">1</span>:
main<span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span>:<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">else</span>:
usage<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p><a href="http://www.q-protex.com/index.php/descargas">Download it here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.q-protex.com/2010/08/04/decompiling-mmbuilder-applications-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Decompiling MMBuilder applications Part 2</title>
		<link>http://blog.q-protex.com/2010/08/03/decompiling-mmbuilder-applications-part-2/</link>
		<comments>http://blog.q-protex.com/2010/08/03/decompiling-mmbuilder-applications-part-2/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 22:59:39 +0000</pubDate>
		<dc:creator>m.febres</dc:creator>
				<category><![CDATA[Ingeniería Inversa]]></category>
		<category><![CDATA[Seguridad Informática]]></category>
		<category><![CDATA[decompiling]]></category>
		<category><![CDATA[mmbuilder]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.q-protex.com/?p=52</guid>
		<description><![CDATA[&#60;&#60; Part 1 Let&#8217;s dump this overlay data and analyze it: 0000h:0B 4D 4D 42 75 69 6C 64 65 72 33 30 00 00 00 00 .MMBuilder30.... 0010h:01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 0020h:00 00 01 00 00 00 00 00 00 00 [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Part 1" href="http://blog.q-protex.com/2010/08/02/decompiling-mmbuilder-applications-part-1/">&lt;&lt; Part 1</a></p>
<p>Let&#8217;s dump this overlay data and analyze it:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">0000h:0B 4D 4D 42 75 69 6C 64 65 72 33 30 00 00 00 00 .MMBuilder30....
0010h:01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0020h:00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0030h:00 00 00 00 00 00 00 00 08 57 65 6C 63 6F 6D 65 .........Welcome
0040h:21 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 !...............
0050h:00 00 01 00 00 00 06 50 61 67 65 20 31 01 00 00 .......Page 1...
0060h:00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 ................
0070h:00 00 FF FF FF 00 00 00 00 00 00 59 00 00 01 00 ..ÿÿÿ......Y....</pre></div></div>

<p>The format of the header is:</p>
<ul>
<li><strong>BYTE</strong>: Size of the string with the name and version of mmbuilder file format.</li>
<li><strong>LPCTSTR</strong>: String with the name and version of mmbuilder file format.</li>
<li><strong>DWORD</strong>: Boolean value the indicate if the source is compressed.</li>
</ul>
<p>After the header you will find the source code of the application! If you compare it with the original mbd file you will find that is almost the same file but the last 0&#215;14 bytes.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">0450h:53 54 41 4E 44 41 4C 4F 4E 45 53 04 00  ...STANDALONES..
0460h:00                                               .</pre></div></div>

<p>The format of this overlay data is:</p>
<ul>
<li><strong>LPCTSTR</strong>: STANDALONE will appear any time you choose to build an application as standalone. Otherwise the .mbd must be shipped together with the exe file.</li>
<li><strong>DWORD</strong>: Size of the source code. Any data after the source is metadata as StandAlone or AllowOneInstance</li>
</ul>
<h2>Secure Layer</h2>
<p>When the project is compiled with Secure Layer activated the source is still appended as overlay data into the exe but this time it is compressed.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">0000h:0B 4D 4D 42 75 69 6C 64 65 72 33 30 01 00 00 00 .MMBuilder30....
0010h:53 04 00 00 49 01 00 00 78                      S...I...x</pre></div></div>

<p>Now the dword value is 1 indicating the source is compressed. Now the format of the header is:</p>
<ul>
<li><strong>BYTE</strong>: Size of the string with the name and version of mmbuilder file format.</li>
<li><strong>LPCTSTR</strong>: String with the name and version of mmbuilder file format.</li>
<li><strong>DWORD</strong>: Boolean value the indicate if the source code is compressed.</li>
<li><strong>DWORD:</strong> Size of uncompressed source code.</li>
<li><strong>DWORD</strong>: Size of compressed source code.</li>
</ul>
<p>After the header you will find the compressed source code of the application! The format of the overlay data is the same.</p>
<p>Now the question is how to determine what algorithm was used to compress the source code? After unpack the file the plugin KANAL lists the following crypto signatures:</p>
<ul>
<li>ADLER32 :: 0009297C :: 0049297C</li>
<li>CRC32 :: 000EEEB8 :: 004EEEB8</li>
<li>CRC32b :: 001227EC :: 005227EC</li>
<li>ZLIB deflate [long] :: 000EFD28 :: 004EFD28</li>
<li>ZLIB deflate [word] :: 00129BD8 :: 00529BD8</li>
</ul>
<p>ADLER32 / CRC32 are hash algorithms and ZLIB is the only option for compression. With all this information it is possible to create a python script to automate the decompilation of MMBuilder applications.</p>
<p><a title="Part 3" href="http://blog.q-protex.com/2010/08/04/decompiling-mmbuilder-applications-part-3/">Part 3 &gt;&gt;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.q-protex.com/2010/08/03/decompiling-mmbuilder-applications-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Decompiling MMBuilder applications Part 1</title>
		<link>http://blog.q-protex.com/2010/08/02/decompiling-mmbuilder-applications-part-1/</link>
		<comments>http://blog.q-protex.com/2010/08/02/decompiling-mmbuilder-applications-part-1/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 23:27:49 +0000</pubDate>
		<dc:creator>m.febres</dc:creator>
				<category><![CDATA[Ingeniería Inversa]]></category>
		<category><![CDATA[Seguridad Informática]]></category>
		<category><![CDATA[decompiling]]></category>
		<category><![CDATA[mmbuilder]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.q-protex.com/?p=41</guid>
		<description><![CDATA[Automatic decompilation of Multimedia Builder applications through python script Introduction When reverse engineering binaries, compiler-specific tools are very important. There are plently of tools for almost all the compilers in the wild so it is very possible to find someone that has worked already in the development of a generic tool to interact with a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Automatic decompilation of Multimedia Builder applications through python script</strong></p>
<h2>Introduction</h2>
<p>When reverse engineering binaries, compiler-specific tools are very important. There are plently of tools for almost all the compilers in the wild so it is very possible to find someone that has worked already in the development of a generic tool to interact with a specific binary. We have DeDe-E2A for Delphi binaries, VB Decompiler-RaceVB6-Smartcheck for VB and Reflector for .NET among many others. In this article I will analyze the structure of the binaries made with Multimedia Builder and develop a python script to automate the decompilation of it.</p>
<h2>Requirements</h2>
<ul>
<li><a href="http://www.python.org/" target="_blank">Python 2.X</a></li>
<li><a href="http://code.google.com/p/pefile/" target="_blank">pefile</a></li>
<li>Multimedia Builder (I will use version 4.9.8 in this article)</li>
</ul>
<h2>Hello World! MMbuilder way</h2>
<p>I will not go deeper into how to use MMbuilder IDE tool and its syntax. I will assume you know how to use it (anyway it is very easy). Let&#8217;s create a new project, place a button and write the following script:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">Message(<span style="color: #800000;">&quot;Hello World!&quot;</span>,<span style="color: #800000;">&quot;&quot;</span>)</pre></div></div>

<p>Now compile the project with the following options:</p>
<ul>
<li>Create Stand-Alone file: YES</li>
<li>Compression Method: Any</li>
<li>Player: Full</li>
<li>Add Secure Layer: NO</li>
</ul>
<h2>Analysis</h2>
<p>Now let&#8217;s analyze the exe:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">C:\masm32\bin&amp;gt;dumpbin.exe /ALL /RAWDATA:none c:\Media1.exe
Microsoft (R) COFF Binary File Dumper Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
&nbsp;
Dump of file c:\Media1.exe
&nbsp;
PE signature found
&nbsp;
File Type: EXECUTABLE IMAGE
&nbsp;
FILE HEADER VALUES
14C machine (i386)
3 number of sections
473B220C time date stamp Wed Nov 14 11:27:56 2007
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
10F characteristics
Relocations stripped
Executable
Line numbers stripped
Symbols stripped
32 bit word machine
&nbsp;
OPTIONAL HEADER VALUES
10B magic #
6.00 linker version
7F000 size of code
3000 size of initialized data
113000 size of uninitialized data
192500 RVA of entry point
114000 base of code
193000 base of data
400000 image base
1000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
4.00 subsystem version
0 Win32 version
196000 size of image
1000 size of headers
0 checksum
2 subsystem (Windows GUI)
0 DLL characteristics
100000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
0 [       0] RVA [size] of Export Directory
195510 [     320] RVA [size] of Import Directory
193000 [    2510] RVA [size] of Resource Directory
0 [       0] RVA [size] of Exception Directory
0 [       0] RVA [size] of Certificates Directory
0 [       0] RVA [size] of Base Relocation Directory
0 [       0] RVA [size] of Debug Directory
0 [       0] RVA [size] of Architecture Directory
0 [       0] RVA [size] of Special Directory
0 [       0] RVA [size] of Thread Storage Directory
0 [       0] RVA [size] of Load Configuration Directory
0 [       0] RVA [size] of Bound Import Directory
0 [       0] RVA [size] of Import Address Table Directory
0 [       0] RVA [size] of Delay Import Directory
0 [       0] RVA [size] of Reserved Directory
0 [       0] RVA [size] of Reserved Directory
&nbsp;
SECTION HEADER #1
UPX0 name
113000 virtual size
1000 virtual address
0 size of raw data
400 file pointer to raw data
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
E0000080 flags
Uninitialized Data
Execute Read Write
&nbsp;
SECTION HEADER #2
UPX1 name
7F000 virtual size
114000 virtual address
7E800 size of raw data
400 file pointer to raw data
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
E0000040 flags
Initialized Data
Execute Read Write
&nbsp;
SECTION HEADER #3
.rsrc name
3000 virtual size
193000 virtual address
2A00 size of raw data
7EC00 file pointer to raw data
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write</pre></div></div>

<p>As we can see, there are 3 sections and the exe seems to be packed with UPX. (I used compression in the project so I can guess disabling compression will not use UPX. Anyway it doesn&#8217;t matter for this article.)<br />
If we take a look the size of the file we will see that is<br />
531,041 bytes long but it is not consisten with the data from dumpbin.We all know that the size of the file must fulfill the following<br />
formula:<strong>Size</strong> = <strong>Last section raw offset</strong> + <strong>Last section raw size</strong></p>
<p>In this case, the last section is the third section and its Raw offset is<br />
0x7EC00h and its size is 0x2A00.</p>
<p>Let&#8217;s probe:</p>
<p>0x7EC00h + 0x2A00 = 0x81600h (529920).</p>
<p>This confirms the existence of overlay data at the end of the file. I used<br />
Stud_PE to confirm this as you can see in the graphic.</p>
<p><a href="http://blog.q-protex.com/wp-content/uploads/2010/08/stud_pe.png"><img class="alignnone size-full wp-image-98" title="stud_pe" src="http://blog.q-protex.com/wp-content/uploads/2010/08/stud_pe.png" alt="" width="462" height="96" /></a></p>
<p><a title="Part 2" href="http://blog.q-protex.com/2010/08/03/decompiling-mmbuilder-applications-part-2/">Part 2 &gt;&gt;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.q-protex.com/2010/08/02/decompiling-mmbuilder-applications-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TrueCrypt Self-Bruteforce</title>
		<link>http://blog.q-protex.com/2010/03/25/truecrypt-self-bruteforce/</link>
		<comments>http://blog.q-protex.com/2010/03/25/truecrypt-self-bruteforce/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 03:55:18 +0000</pubDate>
		<dc:creator>m.febres</dc:creator>
				<category><![CDATA[Ingeniería Inversa]]></category>
		<category><![CDATA[bruteforce]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[truecrypt]]></category>

		<guid isPermaLink="false">http://blog.q-protex.com/?p=77</guid>
		<description><![CDATA[In the last weeks I was playing with many of the challengues of Yashira (If you don&#8217;t know it, I recommend you to take a look over it as it is one of the biggest spanish web of wargames AFIK) and one of the challenge was to crack a TrueCrypt file. I knew about the [...]]]></description>
			<content:encoded><![CDATA[<p>In the last weeks I was playing with many of the challengues of <a href="http://www.yashira.org" target="_blank">Yashira</a> (If you don&#8217;t know it, I recommend you to take a look over it as it is one of the biggest spanish web of wargames AFIK) and one of the challenge was to crack a <a href="http://www.truecrypt.org" target="_blank">TrueCrypt</a> file. I knew about the existence of that application but I never used it&#8230; until now.</p>
<p>So I decided to download TrueCrypt and play around with the program to get familiar with it. After read the documentation and some reviews I realize that it is a very secure piece of software that implements many high level <a href="http://keepass.info/features.html" target="_blank">features</a> so I knew I will not be easy, at least in theory.</p>
<p>I start to search in internet for some tools than can help me to bruteforce the file but I couldn&#8217;t find any. I remember one page propose one solution: Create an script and launch the truecrypt aplication with some command line options and test if was possible to open it. I tried to do it but it was really slow so I start to search for another options until I found a way to use truecrypt as a self-bruteforce: Instead of launch truecrypt everytime with a different password I made a script in python with the <a href="http://sourceforge.net/apps/trac/winappdbg/" target="_blank">winappdbg python module</a> that acts as a loader and change/test the password in the memory space of truecrypt itself.</p>
<p><strong>Requirementes and notes:</strong></p>
<ul>
<li>python 2.6.4 (2.6.x should also work)</li>
<li>winappdbg-1.3.win32</li>
<li>Use the truecrypt application provided in the attached file or against a Keepass version 6.3a</li>
<li>It only works agains volumes without keyfiles<strong><br />
</strong></li>
</ul>
<p><strong>TrueCrypt Self-Bruteforce Python Code</strong></p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># TrueCrypt Self-Bruteforce v0.1</span>
<span style="color: #808080; font-style: italic;"># Based in Truecrypt version 6.3a</span>
<span style="color: #808080; font-style: italic;"># Programmed by Miguel Febres</span>
<span style="color: #808080; font-style: italic;"># mafebresv at q-protex.com</span>
<span style="color: #808080; font-style: italic;"># http://www.q-protex.com</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Performance: 2 words per second (Core Duo 2.2GHZ), DeviceIoControl is slow</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> winappdbg <span style="color: #ff7700;font-weight:bold;">import</span> Debug
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">time</span> <span style="color: #ff7700;font-weight:bold;">import</span> strftime
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
&nbsp;
counter=<span style="color: #ff4500;">0</span>
word=<span style="color: #483d8b;">&quot;&quot;</span>
words=<span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
r_eax = <span style="color: #ff4500;">0</span>
r_ecx = <span style="color: #ff4500;">0</span>
r_edx = <span style="color: #ff4500;">0</span>
ptrBuffer=<span style="color: #ff4500;">0</span>
&nbsp;
WORD_SIZE = <span style="color: #ff4500;">20</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> action_2<span style="color: black;">&#40;</span> event <span style="color: black;">&#41;</span>:
<span style="color: #ff7700;font-weight:bold;">global</span> word
<span style="color: #ff7700;font-weight:bold;">global</span> counter
<span style="color: #ff7700;font-weight:bold;">global</span> debug
<span style="color: #ff7700;font-weight:bold;">global</span> ptrBuffer
<span style="color: #ff7700;font-weight:bold;">global</span> WORD_SIZE
&nbsp;
aThread = event.<span style="color: black;">get_thread</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
aProcess = event.<span style="color: black;">get_process</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> aProcess.<span style="color: black;">peek</span><span style="color: black;">&#40;</span>ptrBuffer, <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span> == <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\x</span>00'</span>:
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Counter: '</span> + <span style="color: #dc143c;">repr</span><span style="color: black;">&#40;</span>counter<span style="color: black;">&#41;</span> + <span style="color: #483d8b;">' - Correct: '</span> + word
debug.<span style="color: black;">dont_break_at</span><span style="color: black;">&#40;</span>aProcess.<span style="color: black;">get_pid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> , 0x0043F93E<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">else</span>:
<span style="color: #808080; font-style: italic;">#if (counter%1000)==0:</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Counter: '</span> + <span style="color: #dc143c;">repr</span><span style="color: black;">&#40;</span>counter<span style="color: black;">&#41;</span> + <span style="color: #483d8b;">' - Incorrect: '</span> + word
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> counter<span style="color: #66cc66;">&amp;</span>lt<span style="color: #66cc66;">;</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>words<span style="color: black;">&#41;</span>:
aProcess.<span style="color: black;">poke</span><span style="color: black;">&#40;</span>ptrBuffer, <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\x</span>00'</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;">#flag 1</span>
word=words<span style="color: black;">&#91;</span>counter<span style="color: black;">&#93;</span>
word = word.<span style="color: black;">replace</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>,<span style="color: #483d8b;">&quot;&quot;</span><span style="color: black;">&#41;</span>
word = word<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span>:WORD_SIZE-<span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>
<span style="color: #808080; font-style: italic;">#word = word.lower() #optional</span>
word = word.<span style="color: black;">ljust</span><span style="color: black;">&#40;</span>WORD_SIZE,<span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\0</span>&quot;</span><span style="color: black;">&#41;</span>
aProcess.<span style="color: black;">poke_uint</span><span style="color: black;">&#40;</span>ptrBuffer + 0x218, WORD_SIZE<span style="color: black;">&#41;</span>
aProcess.<span style="color: black;">poke</span><span style="color: black;">&#40;</span>ptrBuffer + 0x21C, word<span style="color: black;">&#41;</span>
aThread.<span style="color: black;">set_register</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Eip&quot;</span>, 0x0043F90F<span style="color: black;">&#41;</span>
aThread.<span style="color: black;">set_register</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Eax&quot;</span>,r_eax<span style="color: black;">&#41;</span>
aThread.<span style="color: black;">set_register</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Ecx&quot;</span>,r_ecx<span style="color: black;">&#41;</span>
aThread.<span style="color: black;">set_register</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Edx&quot;</span>,r_edx<span style="color: black;">&#41;</span>
counter+=<span style="color: #ff4500;">1</span>
<span style="color: #ff7700;font-weight:bold;">else</span>:
aProcess.<span style="color: black;">kill</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> action_1<span style="color: black;">&#40;</span> event <span style="color: black;">&#41;</span>:
<span style="color: #ff7700;font-weight:bold;">global</span> debug
<span style="color: #ff7700;font-weight:bold;">global</span> ptrBuffer
aThread = event.<span style="color: black;">get_thread</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
aProcess = event.<span style="color: black;">get_process</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
ptrBuffer = aThread.<span style="color: black;">get_register</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Ecx&quot;</span><span style="color: black;">&#41;</span>
debug.<span style="color: black;">dont_break_at</span><span style="color: black;">&#40;</span>aProcess.<span style="color: black;">get_pid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> , 0x0043F929<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> action_0<span style="color: black;">&#40;</span> event <span style="color: black;">&#41;</span>:
<span style="color: #ff7700;font-weight:bold;">global</span> debug
aThread = event.<span style="color: black;">get_thread</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
aProcess = event.<span style="color: black;">get_process</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
r_eax = aThread.<span style="color: black;">get_register</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Eax&quot;</span><span style="color: black;">&#41;</span>
r_ecx = aThread.<span style="color: black;">get_register</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Ecx&quot;</span><span style="color: black;">&#41;</span>
r_edx = aThread.<span style="color: black;">get_register</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Edx&quot;</span><span style="color: black;">&#41;</span>
debug.<span style="color: black;">dont_break_at</span><span style="color: black;">&#40;</span>aProcess.<span style="color: black;">get_pid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> , 0x0043F90F<span style="color: black;">&#41;</span>
&nbsp;
words = <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'dic.txt'</span>, <span style="color: #483d8b;">&quot;r&quot;</span><span style="color: black;">&#41;</span>.<span style="color: black;">readlines</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;">#lengthall</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;[+] Words Loaded:&quot;</span>,<span style="color: #008000;">len</span><span style="color: black;">&#40;</span>words<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
debug = Debug<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;"># Start a new process for debugging</span>
p = debug.<span style="color: black;">execv</span><span style="color: black;">&#40;</span> <span style="color: black;">&#91;</span><span style="color: #483d8b;">'TrueCrypt.exe'</span>, <span style="color: #483d8b;">'/v'</span>, <span style="color: #483d8b;">'test.tc'</span>, <span style="color: #483d8b;">'/lx'</span>, <span style="color: #483d8b;">'/p'</span>, <span style="color: #483d8b;">&quot;&quot;</span>.<span style="color: black;">ljust</span><span style="color: black;">&#40;</span>WORD_SIZE<span style="color: black;">&#41;</span> ,<span style="color: #483d8b;">'/q'</span>, <span style="color: #483d8b;">'/s'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
debug.<span style="color: black;">break_at</span><span style="color: black;">&#40;</span>p.<span style="color: black;">get_pid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> , 0x0043F90F, action_0<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;">#save state</span>
debug.<span style="color: black;">break_at</span><span style="color: black;">&#40;</span>p.<span style="color: black;">get_pid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> , 0x0043F929, action_1<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;">#save buffer addres</span>
debug.<span style="color: black;">break_at</span><span style="color: black;">&#40;</span>p.<span style="color: black;">get_pid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> , 0x0043F93E, action_2<span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;">#check result, restore state, change eip</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Wait for the debugee to finish</span>
t1 = <span style="color: #dc143c;">time</span>.<span style="color: black;">clock</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
debug.<span style="color: black;">loop</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">finally</span>:
debug.<span style="color: black;">stop</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Finished in '</span> + <span style="color: #dc143c;">repr</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">time</span>.<span style="color: black;">clock</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> - t1<span style="color: black;">&#41;</span> + <span style="color: #483d8b;">' seconds!'</span></pre></div></div>

<p>Of course, to made this script possible first I debug keepass and after a while I found how to change the password in memory and force the program to test it again.</p>
<p><a href="http://www.q-protex.com/index.php/descargas" target="_blank">Download it here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.q-protex.com/2010/03/25/truecrypt-self-bruteforce/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

