Contenido principal

smpChallenge1 - smpCTF 2010 (Español)

Julio 14, 2010

smpChallenge - 1 (Programming 1)

Descripción
Set S = 1
Set P = 1
Set previous answer = 1

answer = S * P + previous answer + R
R = 39

After this => S + 1 and P + 1 ('answer' becomes 'previous answer') + 39
then repeat this till you have S = 11065.

The final key will be the value of 'answer' when S = 11065.

Example:
So if R = 15..

17 = 1 * 1 + 1 + 15
36 = 2 * 2 + 17 + 15
60 = 3 * 3 + 36 + 15

Submit the correct answer and you will recieve a flag. Have fun ;D


Resolución

En el código fuente podemos obtener el Challenge ID y una pista en base64 que nos dice que los valores de S y de R cambian cada 5 minutos o algo así. Así que mi código es el siguiente, debemos ejecutarlo a través de la consola pasándole como parámetros a R y a S.

<?php
$S = 1;
$previous = 1;

$R = $argv[1];
$limit = $argv[2];

do {
    $P = $S;
    $answer = $S * $P + $previous + $R;
    $previous = $answer;
} while ($S++ < $limit);

echo $answer;

Respuesta
Challenge ID: 36b1c546
Flag: WaSThAtFunORwhaT?!?xxxxxx

Archivado en: Programación, Retos informáticos |

2 comentarios

  1. servant Julio 17, 2010 @ 9:13 am

    definitivamente esto es otro nivel :P ya llegaré alli. Felicitaciones!

  2. Segundo aniversario Sinfocol | Seguridad Informática Colombiana Diciembre 13, 2010 @ 6:33 pm

    [...] y de sistemas #Comentarios: 0 Defcon 18 CTF PreQuals WriteUps (En español) #Comentarios: 8 smpChallenge1 - smpCTF 2010 (Español) #Comentarios: 1 smpChallenge2 - smpCTF 2010 (Español) #Comentarios: 0 smpChallenge4 - smpCTF [...]

Deja un comentario