Showing posts with label Courses. Show all posts
Showing posts with label Courses. Show all posts

Saturday, December 20, 2014

[EXPLOITME] Nivel básico - #1 - exploitme2-win.c (Spanish)

¡Saludos amigos!

Ya hacía tiempo que estaba un poco desconectado de varias cosas por cuestiones personales y laborales, sin embargo hace un par de días me encontraba monitoreando la lista de CLS me di cuenta que Boken (uno de sus integrantes) publicó un ExploitMe básico y haciendo un poco de espacio en mi apretada agenda me di a la tarea de crear este pequeño tute en el que explico su resolución paso a paso a mi modo y conforme a mis conocimientos y experiencia me lo permitan.

El ExploitMe objetivo se centra en la identificación de código fuente (HLL) en C y las instrucciones en Ensamblador que correspondan a dicho código. Para los que no tengan mucho skill en esta parte, les recomiendo MUCHO leer los tutoriales de Ricardo de "C y Reversing" así como la guía de Dennis Yurichev con nombre "Reverse Engineering for Beginners" y pueden descargar el libro de forma gratuita desde acá: http://beginners.re.

Considero que si es importante y además muy útil el poder hacer dicha "traducción" entre C y Ensamblador -y viceversa- ya que podrán tener una completa visibilidad acerca de lo que está sucediendo entre el programa y la máquina, ya sea que se encuentren debuggeando, desensamblando o lo que sea. Ya explicaré en algunos otros tutes lo que he aprendido sobre la marcha.

Regresando un poco al tute, les pido de favor que si encuentran algún error me lo hagan saber y con gusto arreglo el documento.

Habiendo dicho todo esto, ¡Al ataque!

Herramientas utilizadas:
• Virtual Box (Windows XP SP2 32b - ESP)
• Code::Blocks (Compilador)
• Python
• Immunity Debugger

Código del ExploitMe:



Bien, resolvamos el primer punto:

1. Compílalo, e identifica la dirección de las funciones main() y checkpass()

Utilizando Code::Blocks, prácticamente copiamos, pegamos y compilamos el código del ExploitMe. Posteriormente lo abrimos en el Immunity Debugger.

Ahora, nos saltamos (CTRL + G) directo al VA (401000) y le seteamos un BP.





Nos vamos instrucción por instrucción (F7) y llegaremos hasta 4010F8 que es la dirección hacia donde saltaremos al codigo que nos atañe (a la función que nos muestre el mensaje de "Access granted!"). Bien, le seteamos un BP de igual manera.





Si se preguntan la razón del por qué los BP's, siento que es bueno siempre estar parando en aquellos puntos clave en los cuales uno puede parar y darse una vuelta por el stack, el memory dump o lo que sea; por lo menos a mi me ha servido.

Si saltamos (ENTER) a ese CALL, entraremos prácticamente al main().

Vemos como desde la dirección 4013C0 hasta 401427 se encuentran las instrucciones relacionadas a la función main(). En la imagen siguiente se encuentra el stack frame de main, seleccionada en color azul.
























Sunday, August 4, 2013

Malicious Software and its Underground Economy: Two Sides to Every Story - My experience

Hello everybody,

As many of you may know, the  Royal Holloway, University of London along with Coursera joined forces and opened to the Internet a free-of-change course called "Malicious Software and its Underground Economy: Two Sides to Every Story". This course was made by a couple of researchers, mainly the Dr. Lorenzo Cavallaro which is a wonderful guy with a broad very experience on the field as well as a high technical skill regarding malware- related topics.

Basically, the 6 week long course was amazing and very educational. Going from theoretical information (bonus quizzes) and practical/reversing challenge -with some anti-debugging tricks-, this last one if you wanted to get a *distinction* in the certificate . Fortunately, I completed and passed all the quizzes at the 1st time and also completed the Reverse Engineering challenge (in a couple of minutes, actually) ]¬P.

 What I learned? Well, I found very useful information regarding Botnets, Mobile malware as well as how the Internet gangs operates to perform certain activities. I belive from a researcher perspective, this can allow us to enrich/increase our knowledge and to identify new lines of investigation as well as fresh techniques in order to identify this kind of malicious activities.

I support the fact of the Universities can open and give opportunities to all the people that cannot attend -phisically talking- to the university, like in this case.

I had great time taking the course as well as solving the RCE challenge. Also, I would like to thank Dr. Lorenzo for all the good content and effort provided within the course.

Now, let's wait for my certificate. ]¬)

Course link: https://class.coursera.org/malsoftware-001/index