CTFLearn Reykjavik

A standard problem to find the flag by dynamic reverse engineering a x64 ELF binary. Problem link With given executable binary, first we want to extract text from it. However, all possible text from strings command are false flags. Let’s examine the bahavior of the program. It prompts the usage. $ ./Reykjavik Usage: Reykjavik CTFlearn{flag} OK, let’s give it an another try. $ ./Reykjavik CTFlearn{flag} Welcome to the CTFlearn Reversing Challenge Reykjavik v2: CTFlearn{flag} Compile Options: ${CMAKE_CXX_FLAGS} -O0 -fno-stack-protector -mno-sse Sorry Dude, 'CTFlearn{flag}' is not the flag :-( From all the external observation, we can assume the code is something like following psuedo code....

August 18, 2023 · 2 min · 319 words · Kazuhiro Funakoshi

CTFLearn Impossible Equation

A problem to exploit the input guard using math. Problem link The problem statement is: $ nc rivit.dev 10011 X * 212103456793011 = 183057226632645 X = ? It seems we want to compute the number of x: $$ x = \frac{183057226632645}{212103456793011}$$ If you compute it, it should be something like 0.8630563094088945586. However, it won’t give you the flag because x must be an integer. That said we need to overflow....

August 18, 2023 · 1 min · 159 words · Kazuhiro Funakoshi

CTFLearn AndhraPradesh

A problem to reverse engineer and find the correct condition. Problem link In this challenge, I have to change the value of con1~con5 in order to pass tests in _start~test4. ; Andrha Pradesh Assembler Challenge for CTFLearn ; This challenge focuses on cmp, je and jne section .data welcome db "Hello CTFlearn Andhra Pradesh Assembler Challenge!",0x0a,0x00 noflag db "Sorry no flag for you :-(",0x0a,0x00 alldone db "All Done!",0x0a,0x00 baddata db "Baad Data!...

August 17, 2023 · 4 min · 770 words · Kazuhiro Funakoshi

CTFLearn Programming a Language

A problem to implement a stack machine. Problem here This problem asks to program a stack machine. My Python3 answer is below. The size of stack is unchecked. from collections import deque import sys class StackLang: def __init__(self): self.stack = deque() self.stack.append(0) def run(self, filename): with open(filename, 'r') as file: txt = file.read() for i in txt: if i == '-': self.minus() elif i == '+': self.plus() elif i == '>': self....

August 16, 2023 · 2 min · 249 words · Kazuhiro Funakoshi

CTFLearn Tone Dialing

A problem that encodes the flag into wave file. Problem here This problem consists of two parts: Obtain the code from wav file Decode Obtain the code from wav file I used dtmf-decoder that extract the tone dialing as decimal. I already have Python3 environment and I don’t want to mess it up. I made a modification of its installation. $ git clone https://github.com/ribt/dtmf-decoder.git $ cd dtmf-decoder/ $ python3 -m pip install -r requirements....

August 16, 2023 · 2 min · 283 words · Kazuhiro Funakoshi