Reverse Engineering

Challenge
Link

Read

Too Much

ezpz

CyberDark0x01: ShitComp

CyberDark_0x02: Installer

(Not) Easy

fire in the androiddd

Read

Description

-

Solution

Given a pyc file then i just try to decompile it using uncompyle6.

The script looks obfuscated but it is still readable. There is one interesting function and here is the code

It seems like checking function and then return something whether the check function is true or false. So i try to reconstruct the code to showing the return value and checking value

Flag : darkCON{0bfu5c4710ns_v5_4n1m4710ns}

Too Much

Description

-

Solution

Given ELF 64-bit executable and then i try to decompile it using IDA

It has many function but all functions are identical. The difference is the variables and constant value. So we can get all value and generate the code then get the flag.

Get value using gdb scripting

Generate the comparison algorithm and get the value using z3

Flag : darkCON{4r3_y0u_r34lly_th1nk1n9_th4t_y0u_c4n_try_th15_m4nu4lly???_Ok_I_th1nk_y0u_b3tt3r_us3_s0m3_aut0m4t3d_t00ls_l1k3_4n9r_0r_Z3_t0_m4k3_y0ur_l1f3_much_e4s13r.C0ngr4ts_f0r_s0lv1in9_th3_e4sy_ch4ll3ng3}

ezpz

Description

-

Solution

Given apk file and then i try to decompile the apk.

Looking at MainActivity class we know that there is flag checking in YEET[0].equals(MainActivity.this.button.getText().toString()). So the idea is make the application showing flag instead of β€œDamn…500 times? are u kidding me” with patching the counter and change the string to be shown.

And then we will get the flag when click β€œCLICK ME” button

CyberDark0x01: ShitComp

Description

-

Solution

Given ELF 64-bit and then i try to decompile it using IDA

sub_1410

At first the program will compress our file ( as shown image above )

sub_13A0

And then encrypted the compressed data. So the idea is decrypt the data by brute force the algorithm then uncompress the data by reversing the algorithm.

And then by running original ELF we will get the flag

CyberDark_0x02: Installer

Description

-

Solution

Now we need to work with the original ELF. So i try to decompile it using IDA

sub_1BD0

We can see there is function that the return value is compared by constant value and determine whether the result is correct key or wrong key.

sub_1AB0

At first the program check the input ( it must uppercase ) and store the input to variable ( except the β€œ-” ).

sub_19A0

After that it call function that generate values and our input will be the index of that value.

sub_1A20

And the last is checking our input with comparison algorithm that using manipulation of index of array and array. So the idea is reversing the algorithm to generate the key then submit it to server. But i only got 8 correct key ( the other keys are incorrect because there is one character that are not uppercase ) . So for the 2 other keys i brute force one character and then got the correct uppercase character on that position and submit all keys.

( we can use tmp variable to store the index same as the original code in binary for simplicity )

(Not) Easy

Description

-

Solution

Given PE file and then i try to open it using IDA

sub_40189D

Looking at encryption function it seems like modified xxtea encryption so the idea is reconstruct decrypt function by reversing the encryption algorithm.

Flag : darkCON{4_L177l3_crYp70_4_d4y_m4K3S_R3v3rS3s_g0_4W4Y}

fire in the androiddd

Description

-

Solution

Given apk file and then i try to decompile it.

MainActivity

Looking at MainActivity that we need internet connection to run this application and there are a method called from data_receiver class.

data_receiver

From getData method we know that class member ( data ) will store encrypted flag from firebase storage. data_receiver.data will be used in magic function which is called by doInBackground function from nested class ( loader class in MyReceiver class )

MyReceiver

Magic method is called from native library so we need to decompile that library to know what is magic method do

Java_com_application_darkcon_MyReceiver_magic

From the code above we know that our input xored with looper(i) and compared with v4 which is encrypted_flag . Here is what looper function do

looper

So the idea is getting the encrypted_flag using frida then run looper function and xor it with encrypted_flag and get the flag. Here is frida script that i used

After that implemented the looper function

Flag : darkCON{th3_w31rd_c0mb1nat10n_of_fr1da_4nd_c4t4l4n_ov3rf10w}

Last updated