inCTF 2019 Finals writeup

Writeup for inctf professional that i solved

Forensics - The Dilema

This is the first challenge i done it is pretty simple

you have given a zip file which is password protected you need to crack it which i did it using fcrackzip ( Dictionary attack - rockyou as wordlist ).

The password is trixie

after extracting we get

when you read text.txt


I tried stegno decoder with above text as password, got my first flag. used this to decode message.


Reverse Engineering - Party part

The binary is elf-64. when we load in ghidra (NSA reverse engineering tool) we can see it like this


using the above information, it can be decoded.i used python3 to decode the all the function

NOTE: \’ in the encrypted flag treated as ’ ( single character )

first_encrypt = "afk|ns"
for char in first_encrypt:
ascii_number = ord(char)
manipulated = ascii_number^8

second_encrypt = "<ea'pV"

for char in second_encrypt:
ascii_number = ord(char)
manipulated = ascii_number+9

thrid_encrypt = "vj5ar6"

for char in thrid_encrypt:
ascii_number = ord(char)
manipulated = ascii_number-2

four_encrypt = "ginTl&"
for char in four_encrypt:
ascii_number = ord(char)
manipulated = ascii_number+11

five_encrypt = "znev:x"
for char in five_encrypt:
ascii_number = ord(char)
manipulated = ascii_number-6

for char in six_encrypt:
ascii_number = ord(char)
manipulated = ascii_number^13

seven_encrypt = "d7cb&z"
for char in seven_encrypt:
ascii_number = ord(char)
manipulated = ascii_number^7

#encrypted="afk|ns<ea\ 'p Vvj5ar6 ginTl& znev:x y~R=kR d7cb&z"

and when you run it we got


Web - Php

I don’t remember the challenge exactly so i will give you picture of how it will be

It is php page we need to bypass the if statement to print the flag.All the input are given as GET parameters.

There are four if we need to bypass inorder to get the flag

  1. number which is greater than 999999999 ( forgot the exact number )
  2. int(given parameter must be 1337) && it should be 13 character
  3. SHA-4 collision ( Two param using a & b )
  4. MD-4 => ($_GET[“md4”] == hash(“md4”, $_GET[“md4”]))

Solving each part you get part of the flag

First two are pretty easy. the challenge get complicated from 3

I solved Third using the below link

and fourth by

After you beat all four if statement, got the flag


Android - Decode

Simplest challenge of all if you know how to decode the .apk file and my first android challenge that i solved.

i used apktool tool to extract the contents of the .apk and it also generates smali files which we can further used to analyze the android package

Android start with MainActivity so checking the smali file we get

    .line 20
    new-instance p1, Ljava/lang/StringBuilder;

    invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v0, "aW5jdGZ7bmV2M3Jfc3QwcmU="

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v0, "X3MzbnMhdGl2M19kYXRh"

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v0, "XzFuXzdoM19zMHVyY2VjMGRlfQ=="

Bizzare strings in the above code is base-64 so decoded it ( decode all three ) and got the flag



Binary - shell

I got 32 bit binary which execute anything that you gave

so i copied shellcode from shellstorm x86 ( 32 bit ) and tried to run it and it didn’t work i wasted maybe an hour on that i tried using gdb to find issue but still can’t figure it out..

last few bytes of my payload got truncated i don’t know why :(

Forensics - Moz Espa

you got a pcap file if you follow the Tcp stream you get the flow of how the person got interacted with the server

using that information you need to type the character one by one along with authentication ( random number ) before certain time inorder to get the flag

Solved at home

Reverse Engineering -

windows binary name fin.exe is given


Above image you can see the operation ** -6U ^ 0x1e) + 5 ** which is used to encode the flag

solved the challenge using following python3 code

NOTE: converted 0x1e (hex) to 30 (decimal) in below code


for element in input_array:
decoded = ((element - 5) ^ 30) + 6

flag is