Home Hackvent 2015 Dec 23
Writeup
Cancel

Dec 23

Challenge

Solution

We connect to the service using

1
2
3
4
$ nc
nc challenges.hackvent.hacking-lab.com 8888
Riddle me this, riddle me that. What about solving a bunch of riddles for a present or two?
0, 1, 1, 2, 3 ... ?

Looks like the fibonacci sequence, let’s see what happens if we answer

1
2
3
4
5
6
7
8
5
ACK, go ahead...
8
ACK, go ahead...
13
ACK, go ahead...
14
RST. Go ask Leonardo for help ...

Ok, seems like we need to keep going with the fibonacci sequence. We automate it using python:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import telnetlib

# generator to produce fibonacci numbers
a,b = 0,1
def fibI():
    global a,b
    while True:
        a,b = b, a+b
        yield a

server = "challenges.hackvent.hacking-lab.com"
port = 8888

# get generator to the right point in the sequence
fib=fibI()
fib.next()
fib.next()
fib.next()
fib.next()

print "starting"

#connect to service
tn = telnetlib.Telnet(server, port)
print tn.read_until("\n")
print tn.read_until("\n")

# play until we win
response="ACK, go ahead..."
while response == "ACK, go ahead...":

    # answer with next in fibonacci sequence
    answer=fib.next()
    print 'answering: '+str(answer)
    tn.write(str(answer))
    tn.write('\n')

    response=tn.read_until('\n').strip('\n')
    print response

# see what else they have to say
print tn.read_all()

This results in the following exchange:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
starting
Riddle me this, riddle me that. What about solving a bunch of riddles for a present or two?

0, 1, 1, 2, 3 ... ?

answering: 5
ACK, go ahead...
answering: 8
ACK, go ahead...
answering: 13
ACK, go ahead...
answering: 21
ACK, go ahead...
answering: 34
ACK, go ahead...
answering: 55
ACK, go ahead...
answering: 89
ACK, go ahead...
answering: 144
ACK, go ahead...
answering: 233
ACK, go ahead...
answering: 377
ACK, go ahead...
answering: 610
You really thought I would give away my precious stuff?
  That was a joke. HAHA. FAT CHANCE.

(if you want to prank your friends, find this little code at http://hackvent.hacking-lab.com/KJYzeUErl7_riddler.tar.gz)

Ok, this was to easy to be the real challenge, but we did get the source code

Flag