한국어(Korean): Link


Personally I think this was the easiest challenge in defcon23.

Connecting the server, it gives us expressions that contains addition, subtraction, multiplication, power, brackets, etc.

We can simply eval() the expression, but there are a few tricks.

Trick1: Numbers are written in English like "THREE - ONE = ". Let's change this back to number.

Trick2: There are square brackets and curly brackets. This has special meaning in python so let's turn them into small brackets.

Trick3: Expression of power is ^. It means XOR in python so turn this into **.

I thought 100 problems was enough but there were 1000.

from socket import *

s = socket(2,1)
s.connect(('mathwhiz_c951d46fed68687ad93a84e702800b7a.quals.shallweplayaga.me', 21249))

d = {'one':'1','two':'2','three':'3','four':'4','five':'5','six':'6','seven':'7','eight':'8','nine':'9', '=':'', '[':'(', '{':'(', ']':')', '}':')', '^':'**'}

for i in range(1000):
    tmp = s.recv(1024)
    print i, tmp
    for j in d.iterkeys():
        if j in tmp.lower():
            tmp = tmp.lower().replace(j, d[j])
    s.send(`eval(tmp)`+'\n')

import telnetlib
tc = telnetlib.Telnet()
tc.sock = s
tc.interact()


Flag: Farva says you are a FickenChucker and you'd better watch Super Troopers 2

+ Recent posts