AlexCTF 2017 - Write-ups

Information#

Version#

By Version Comment
noraj 1.0 Creation

CTF#

10 - TR1: Hello there - Trivia#

Why not drop us a few lines and say hi :).

Go to the irc: #alexctf @freenode and get the flag with /topic.

20 - TR2: SSL 0day - Trivia#

It lead to memory leakage between servers and clients rending large number of private keys accessible. (one word)

Answer: heartbleed (details)

30 - TR3: CA - Trivia#

What is the CA that issued Alexctf https certificate

(flag is lowercase with no spaces)

Answer: letsencrypt

40 - TR4: Doesn't our logo look cool ? - Trivia#

Here is the logo:

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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116



'@+.
@@@@@@@:
@@@@@@@@@#
@@@@@@@@@@@,
'@@@@@@@@@@@@
@@@@@@@@@@@@@
@@@@@@@@@@@@@.
@@@@@@@@@@@@@,
@@@@A@@@@@@@@
+@@@@@@@@@@@@ .:++@@@@@+:.
@@@@@@@@@@@' .+@@@@@@@@@@@@@@@@@@@@@`
.@@@@@@@@@@ .#@@@@@@@@@@@@@@L@@@@@@@@@@@@@#
+@@@@@@@@ `#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ .@@.
+@@@E@@@@ .@@@@@@X@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@: '@@@@@.
+@@@@@@@@ ;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@C@@. `+@@@@@@@@@.
+@@@@@@@@ ;@@@@@@T@@@@@@@@@@@',` .+@@@@@@@@@@@@@@@: `:@@@@@@F@@@@@@@@.
+@@@@@@@@ ;@@@@@@@@@@@+. ;@@@@@@@@@@@@@@@@@@@@@@@@@@@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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Let's write a very short ruby script to filter that:

1
2
3
4
logo = open("logo.txt", 'r').read()
#flag = logo.gsub(/[^a-zA-Z0-9{}_]/, '')
flag = logo.gsub(/[#@.;:+,`'\s]/, '')
puts flag

Flag: ALEXCTF{0UR_L0G0_R0CKS}

100 - SC1: Math bot - Scripting#

It is well known that computers can do tedious math faster than human.

nc 195.154.53.62 1337

Update

we got another mirror here

nc 195.154.53.62 7331

The server send some calculations with big integers and we have to solve a lot of them.

To do that I did a ruby bot:

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
#!/usr/bin/ruby
require 'socket'

hostname = '195.154.53.62'
port = 1337

s = TCPSocket.open(hostname, port)

raw = ''
res = nil
flag = false

while line = s.gets # Read lines from the socket
puts line.chop # And print with platform line terminator
raw += line
if raw.match(/=$/) && flag == false
calc = raw.match(/^([0-9]*) ([+\-%*\/]) ([0-9]*) =/)
a = calc.captures[0].to_i
oper = calc.captures[1]
b = calc.captures[2].to_i
if oper == '+'
res = a + b
elsif oper == '-'
res = a - b
elsif oper == '*'
res = a * b
elsif oper == '%'
res = a % b
elsif oper == '/'
res = a / b
else
puts "That's not good..."
end
if res != nil
puts res
s.puts res
end
res = nil
raw = ''
end
end
s.close # Close the socket when done

Note: I chose not to use some exec function because I don't trust external entries.

Here an example of output and the flag:

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
                __________
______/ ________ \______
_/ ____________ \_
_/____________ ____________\_
/ ___________ \ / ___________ \
/ /XXXXXXXXXXX\ \/ /XXXXXXXXXXX\ \
/ /############/ \############\ \
| \XXXXXXXXXXX/ _ _ \XXXXXXXXXXX/ |
__|\_____ ___ // \\ ___ _____/|__
[_ \ \ X X / / _]
__| \ \ / / |__
[____ \ \ \ ____________ / / / ____]
\ \ \ \/||.||.||.||.||\/ / / /
\_ \ \ ||.||.||.||.|| / / _/
\ \ ||.||.||.||.|| / /
\_ ||_||_||_||_|| _/
\ ........ /
\________________/

Our system system has detected human traffic from your IP!
Please prove you are a bot
Question 1 :
188284398378183198274310077338361 - 222311858895894501436877647952618 =

[...]

Question 250 :
198932319558549559940672382195244 % 276981013309967153730940955239195 =
Well no human got time to solve 500 ridiculous math challenges
Congrats MR bot!
Tell your human operator flag is: ALEXCTF{1_4M_l33t_b0t}
Share