Sexy Pandalog

Osu, Tatakae, Sexy Pandas blog

 

September 25, 2008

Defcon CTF’08 Kryptod writeup

Filed under: CTF, Defcon, writeups — at 20:09

This year at the Defcon CTF there was only one kenshoto-level service (or at least only one that scored as a Kenshoto, you’ll know what we mean in further writeups). That service was Kryptod, so we will be trying to explain how we managed to exploit it.

As in the major part of the CTF bins the service starts setting up the socket, in this case listening at port 20020, and dropping the proper user privileges. Then it sets up signal handlers for SIGILL, SIGTRAP, SIGEMT, SIGBUS, SIGSEGV, SIGSYS and SIGALRM. The handler is always the same and it just uses the current socket to send back to the client an encoded value related to the signal received and then doing a clean exit (let’s say it’s a nice way to say: “Hey, I crashed!”).

The next step is just the client handler. Kryptod reads the file ‘/home/krypto/key’ (the token) and put its contents into a buffer, then it reads from the socket up to 63 chars (or a terminating \x0A if it comes before). The next part is a bit tricky, if the socket received 0 bytes it justs send the contents of the token/keyfile to the user. WTF??? Strike one! No luck this time, the token is an overwrite one so reading it gives you nothing :(

(more…)

 

August 14, 2008

Pandas crashed in Vegas

Filed under: CTF, Defcon — at 14:34

Crashed panda

Ok, we can’t hide it, we finished on 7th place. That hurts. We will try to explain why or at least, what we think caused this madness.

This year we started like the previous one, although we didn’t draw first-blood (I think that taekwon or wowhacker did it). The team was working very well and we quickly got 5 breakthrougs (!!!). But that was all for us. At the end of the first day some major network problem took down the SLA of most of the teams and after that, we began to have serious networking issues. From that point to the end of the contest our network was really slow, with a lot of timeouts and lots of lost of packets. Also there was a strange behaviour of the other-teams services. We found very interesting the thoughts of Atlas from 1@stplace regarding this owning prevention.
(more…)

 

August 3, 2008

Ready, Steady, Go!

Filed under: CTF, Defcon — at 11:06

Panda after training

The D-Day is coming. In 7 days we will know which team managed to win the Defcon CTF’08. The pandas have been training hard, so we’re ready to go and (try to) kick some asses :)

All preparations are done: we improved our Sexy Panda Exploitation Framework, designed our new shirts, the Riviera ordered a high amount of bamboo, bought new networking hardware, got invitations for all-night parties… a lot of new things that would make this year funniest than ever.

One final note regarding the t-shirts. We’re trying to find/evaluate online stores where to publish the design, so if you are a panda fan or if your laundry bleached your ninja suit and you need a new look… stay tuned! (questions and suggestions can be sent to shirts@pandas)

Well, nothing more to say right now. Good luck to everybody and see you in Vegas.
GO GO PANDAS!!!

 

June 9, 2008

Reversing 500 writeup!

Filed under: Blogroll, CTF, prequals, writeups — at 22:39
1.- Introduction.
At quals  we hardly had time  to analyse rev500.  However, what we saw  was very
appealing : interesting code obfuscation, use of fpu and random numbers, and the
string "./MathIsHard" suggested  that the algorithm could be  interesting. So we
decided to give it another try with more time.

A brief initial analysis doesn't bring a lot of information : The binary is a 32
bit ELF for FreeBSD  that listens for connections on port  2600. When we connect
to it we receive 5 dwords containing integers, all of them below 1000.

$ readelf -a ./rev ELF Header: ... Class: ELF32 OS/ABI: UNIX - FreeBSD ABI Version: 0 Type: EXEC (Executable file) Machine: Intel 80386 ... Relocation section '.rel.plt' at offset 0x808 contains 43 entries: Offset Info Type Sym.Value Sym. Name 0804e0d4 00000507 R_386_JUMP_SLOT 00000000 random   0804e0d8 00000607 R_386_JUMP_SLOT 00000000 recv 0804e0f4 00000e07 R_386_JUMP_SLOT 00000000 socket 0804e0f8 00000f07 R_386_JUMP_SLOT 00000000 send 0804e0fc 00001107 R_386_JUMP_SLOT 00000000 accept 0804e108 00001507 R_386_JUMP_SLOT 00000000 bind ...

(more…)

 

Reversing500

Filed under: CTF, Defcon, prequals — at 12:42

Pandas With Gambas reversing monkeys are glad to introduce…
Reversing 500 CTF Prequals solution!

#!/usr/bin/python
import struct
import socket
import math

def makeSin( freq, number_samples, samples_per_seq ) :
    data = ''
    for i in range(0,number_samples):
        data += struct.pack('h', 1000*math.sin( 2*freq*i*math.pi/samples_per_seq ))
    return data

# print '''Rev 500'''

Host = '127.0.0.1'
Port = 2600

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((Host, Port))
chunk = s.recv(4*5)

print struct.unpack_from('LLLLL', chunk)

if chunk == '':
    print 'Error receiving data\n'

number_samples  = 5000
samples_per_sec = 4000

header_fmt  = struct.pack('L', 0x20746d66 )   # fmt
header_fmt += struct.pack('L', 16 )           # size   = 16
header_fmt += struct.pack('h', 1  )           # format = pcm
header_fmt += struct.pack('h', 1  )           # n. Chanels. unused
header_fmt += struct.pack('L', samples_per_sec )
header_fmt += struct.pack('L', 1  )           # Avg. Bytes Sec. unused
header_fmt += struct.pack('h', 2  )           # block align. Bytes/sample*channel
header_fmt += struct.pack('h', 16 )           # bits_per_sample

size_header_data = number_samples * 2
frequencies = struct.unpack_from('LLLLL', chunk)
header_data  = struct.pack('L', 0x61746164       )
header_data += struct.pack('L', size_header_data )
header_data += makeSin( frequencies[0], number_samples/5, samples_per_sec)
header_data += makeSin( frequencies[1], number_samples/5, samples_per_sec)
header_data += makeSin( frequencies[2], number_samples/5, samples_per_sec)
header_data += makeSin( frequencies[3], number_samples/5, samples_per_sec)
header_data += makeSin( frequencies[4], number_samples/5, samples_per_sec)

size = len(header_fmt) + len(header_data) + 4

header  = struct.pack('<L', 0x46464952 )  # RIFF
header += struct.pack('<L', size )        # size
header += struct.pack('<L', 0x45564157 )  # WAVE

s.send( header)
s.send( header_fmt)
s.send( header_data )

file = header + header_fmt + header_data
print s.recv(1024)

Stay tuned for the write-up….

 

June 2, 2008

We’re baaack!!

Filed under: CTF — at 03:49

Pues sí, tal y como es posible consultar en los resultados oficiales de Kenshoto, lo hemos vuelto a conseguir. Por segundo año consecutivo estaremos en la final del CTF de la Defcon, intentando el asalto al título. Este año las prequals han estado muy igualadas, y el nivel de las pruebas ha sido realmente desesperante. Tanto es así que ha habido hasta 5 pruebas que nadie ha podido superar (4 de ellas ni siquiera se llegaron a activar).

En cuanto al equipo, este año bajo el nombre de “Pandas with Gambas” hemos podido conseguir un trabajado segundo puesto (empatados con los primeros). Así que a todos aquellos que durante este largo fin de semana nos habeis mostrado vuestro apoyo sólo nos cabe decir: MUCHAS GRACIAS.

Ahora es tiempo de celebrarlo y preparar el que, seguro, será uno de los CTF más complejos y disputados que hayamos visto. Esperemos que la suerte esté de nuestro lado.

 

May 29, 2008

Exploit4Food I

Filed under: Blogroll, writeups — at 11:41

Hace un par de semanas, la gente de 48bits pensó en hacer un reto al que decidieron llamar Exploit4Food. El reto consistía en encontrar un bug en un software determinado, explotarlo y redactar unas cuantas líneas explicando el proceso seguido para conseguirlo. Una de las soluciones publicadas ha sido la de uno de nuestros pandas y, mientras en 48bits ya preparan la segunda edición del reto, aquí hemos pensado dejar una versión corregida (y mínimamente ampliada) del report presentado. Consideradlo un aperitivo de cara a las prequals del CTF que empiezan mañana ;D

(more…)

 

September 2, 2007

Exploiting HFD

Filed under: CTF, writeups — at 15:41

It seems that it’s time for our first english post :) as we finally managed to write some kind of walk-through for the hfd service. In this release the metasploit how-to is not included (wait for a further update) so we explain how to exploit hfd using the SPEF (Sexy Pandas Exploitation Framework), that is, our famous perl and netcat pwning-spree-combo xD

Nothing more to say, enjoy!

 

August 24, 2007

Solución al reversing500

Filed under: CTF, prequals, writeups — at 10:36

Esta semana, mientras veía cómo habíamos sido ¿barrapunteados?, me dí cuenta de que en Nops ‘R Us habían añadido información sobre el CTF. Pese a que según ellos seguimos siendo “Alemanes”, al menos se han dignado a poner una foto del scoreboard del viernes, eso sí, de cuando ya iban primeros (pero prácticamente empatados con nosotros) por lo que yo ya me doy por satisfecho.

También me ha hecho ilusión ver la solución de Sk3wlm4st3r al reversing 500, más que nada porque estábamos en el camino correcto. El truco estaba en las 4 primeras funciones a las que llamaba, dos de modificación (la 1ª y la 3ª) y dos de comprobación (la 2ª y la 4ª). Se podía ver que en las decomprobación se operaba sobre las posiciones 0, 3, 6, 9, 12, 15, 18 y 21 en la primera, y 1, 4, 7, 10, 13, 16, 19 y 22 en la segunda. Teniendo en cuenta que las funciones de modificación eran del tipo key[i] = key[i] <sum/xor> key[(i + 1) % 24], se reducía el bruteforcing a sólo (ejem) las posiciones 2, 5, 8, 11, 14, 17,
20 y 23. Nos faltó ponernos en serio con las últimas dos funciones…

Y hablando de soluciones, estamos preparando un texto con la solución a uno de los servicios que sólo explotamos los Sexy Pandas (hoooo!). Se está retrasando porque queremos aprovechar para usarlo de tutorial de perl+netcat^H^H^H metasploit.

Dicho esto sólo nos queda felicitar a sk3wlm4st3r & friends por la currada que se pegaron.

PD: Todavía estoy esperando a que alguien nos ownee el blog, ¿voluntarios?

 

August 19, 2007

CTF Laughing Team

Filed under: CTF — at 17:34

Este post es simplemente para mostrar una imagen que ha retocado nuestro diseñador :* Aquí teneis al equipo al completo al más puro estilo El hombre que ríe (The Laughing man):

CTF Laughing Team

Qué le vamos a hacer, a mí me ha hecho mucha “gracia” xDD

« Previous PageNext Page »

Valid XHTML 1.0 Valid CSS 2