Yoire PE Stage 3 Reversing Challenge (Benten) – Fuerza Bruta

Aviso: Este crackme forma parte de una serie de pruebas de Yoire.com que todavía está en activo. Lo ético si continuas leyendo este manual es que no utilices la respuesta para completar la prueba sin esfuerzo. 😉

Analizando

Abrimos el crackme con Ollydbg y vamos a las referenced strings.

Pinchamos sobre cualquiera.

 

Vemos un «Call» donde seguramente se generará un SUM en función del serial metido ya que después del Call vemos una comprobación contra «B79E763E» lo que nos da una pista de que vamos a tener que utilizar fuerza bruta para llegar a ese valor. Vamos a explorar el Call.

Lo que resalto con la flecha son una par de Calls que podemos NOPear ya que lo único que hacen es ralentizar la generación del SUM.
A continuación vamos a analizar el algoritmo de generación del SUM.
MOV EDI,5EED                   - EDI = 5EED
JMP SHORT 01_crack.004010D7
/MOV EAX,EDI                   <----Bucle
|SHL EAX,5                     - 5EED * 32 = BDDA0
|MOVZX EDX,BYTE PTR DS:[EBX]   - Coge el dígito
|XOR EAX,EDX                   - BDDA0 XOR digito
|MOV EDI,EAX
|XOR EDI,1D0B1EED              - XOR 1D0B1EED
|INC EBX
|..
|MOV ESI,EAX
CMP BYTE PTR DS:[EBX],0
JNZ SHORT 01_crack.004010B4   - Bucle ---->

Para un serial de tres dígitos la secuencia sería esta (valores en hexadecimal):

1º Digit —> BDDA0 XOR 1D0B1EED XOR 1ºDigit XOR 1D0B1EED = Temp
2º Digit —> Temp = Temp * 20 Xor 1D0B1EED XOR 2ºDigit
3º Digit —> Temp = Temp * 20 Xor 1D0B1EED XOR 3ºDigit

CMP Temp, B79E763E

Aplicando Fuerza Bruta

La creación del «BruteForcer» os la dejo a vosotros. Aquí teneis un fragmento hecho en VB.Net.

Dim temp As Long
Dim temp2 As String
Dim letter As Integer
Dim brute As String
brute = TextBox4.Text
temp = 0
temp = Asc(Mid(brute, 1, 1)) Xor 487268077 Xor 777632
temp2 = Hex(temp)
temp2 = Microsoft.VisualBasic.Right(temp2, 8)
temp = Convert.ToUInt64(temp2, 16)
For i = 2 To Len(brute)
letter = Asc(Mid(brute, i, 1))
temp = temp * 32
temp2 = Hex(temp)
temp2 = Microsoft.VisualBasic.Right(temp2, 8)
temp = Convert.ToUInt64(temp2, 16)
temp = temp Xor 487268077
temp2 = Hex(temp)
temp2 = Microsoft.VisualBasic.Right(temp2, 8)
temp = Convert.ToUInt64(temp2, 16)
temp = temp Xor letter
'
temp2 = Hex(temp)
Next

Links


Warning: This challenge is still active and therefore should not be resolved using this information. Aviso: Este reto sigue en
Warning: This challenge is still active and therefore should not be resolved using this information.  Aviso: Este reto sigue en
File carving is the process of reassembling computer files from fragments in the absence of filesystem metadata. Wikipedia. "File carving", literalmente tallado

ThisIsLegal.com – User Challenge 1 (Javascript)

Warning: This challenge is still active and therefore should not be resolved using this information.
Aviso: Este reto sigue en activo y por lo tanto no se debería resolver utilizando esta información.

Introducción

 Este es el típico reto de Javascript, no tiene mucha complicación pero he decidido dedicarle una entrada por que me llamó la atención lo que utiliza de usuario y clave.

El Script

function getStyle(el,styleProp)
{
    var x = document.getElementById(el);
    if (x.currentStyle)
        var y = x.currentStyle[styleProp];
    else if (window.getComputedStyle)
        var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);

if (y.substr(0, 1) == "#"){ return y; } else {
    
var value = y.split(',');

var R = value[0].substr(4);
var G = value[1];
var B = value[2].substr(0, value[2].length-1);

var RGB =  "#" + toHex(R)+ toHex(G)+toHex(B);

return RGB;

 }
}

function toHex(N) {
 if (N==null) return "00";
 N=parseInt(N); if (N==0 || isNaN(N)) return "00";
 N=Math.max(0,N); N=Math.min(N,255); N=Math.round(N);
 return "0123456789ABCDEF".charAt((N-N%16)/16)
      + "0123456789ABCDEF".charAt(N%16);
}

function pw (form)
{

   var d1, d2, d3;

if (navigator.appName == "Netscape"){
   d1= getStyle('content', 'background-color');
} else {
   d1= getStyle('content', 'backgroundColor');
}

     d2=form.Name.value;
     d3=form.Password.value;

  if (d2==d1.length) {
    if (d3==d1) {
      window.open ("../" + d1.substr(1, 10), "_self")
    } else {
      alert("Muhaha! Wrong!")
    }
  } else {
    alert("Muhaha! Wrong!")
  }
}

El Formulario

<div class="chal_box" style="padding:10px;">
<form name="form" action="" method="post">
        Username<br />
        <input id="inputd2" type="text" name="Name" value="" size="30" maxlength="30"><br />
        Password<br />
        <input id="inputd1" type="text" name="Password" value="" size="30" maxlength="30"><br /><br />

         <input type="button" name="Only a button" value="Enter Site" id="Only a button" class="btn" onclick="pw(this.form)">
</form>
</div>

Interpretando el Script

En el formulario vemos que llama a la función «pw» y ésta a su vez llama a la función «getStyle«, bueno, pués es tan simple como poner un «alert();» dentro de la función «pw» para cazar la clave. Con éste método podemos cazar la clave del 90% de este tipo de pruebas.

29-08-2014 01-21-17alert

Con esto ya tenemos la clave. El usuario responde a la siguiente sentencia «d2==d1.length«, es decir, es el número de dígitos de la clave.

¿Fácil no?

Links

CanYouHack.it Mobile1 Challenge – Simple Comparison (English)

Warning: This challenge is still active and therefore should not be resolved using this information.
 Aviso: Este reto sigue en activo y por lo tanto no se debería resolver utilizando esta información.

Table of Contents

Intro

Few years ago, I made the tool ART (Android Reverse Engineering) for automate the process of reverse android program, but I have to admit that APK Studio is a great tool or just a great alternative. This crackme is for the challenge Mobile 1 of canyouhack.it.

Decompiling

The crackme is given at Google Play, so the first step is to install and recover the APK for decompiling. The latter, I leave to you. Open the victim with APK Studio and view the content of Mobile1.java
Analyzing the code, we view that the correct password is “The*********r”.

Links