Skip to main content 2017 - Chal6 - Kalau Aku Kaya

·3 mins

I dont remember the question, but we were given this APK -


Use IPv6, craft the request so that the server will send an email to you, check the email header and you’ll find something juicy. Also you need to know the IPv4 address of the server pointed by that domain.

Writeup #

Note: The web server only listen to its IPv6 address, which is part of the challenge. I was VERY lucky to have IPv6 enabled.

We decompiled the APK and found that this APK is sending request to At first I tried to intercept the traffic by signing and installing the APK and let it run through some intercept proxy but failed due to certificate pinning.

Then my teammate suggest me to just manually craft the request based on what I understand from the code. I did tried sending some request but the server just replied with error code, which I was too lazy to figure out what they were.

Towards the end of the competition, my teammate discovered that the server now returned a more verbose logging and it has helped me a lot in solving this.

Below is the code that helped us to build our request

registerDownline.add(new StringRequest(1, "", c02781, new ErrorListener() {
            public void onErrorResponse(VolleyError error) {
                textView.setText("Error, try again!");
        }) {
            protected Map<String, String> getParams() throws AuthFailureError {
                Map<String, String> params = new HashMap();
                params.put("name", name);
                params.put("phone", phone);
                params.put("address", address);
                params.put(NotificationCompat.CATEGORY_EMAIL, email);
                params.put("upline", "[email protected]");
                params.put("check", checks);
                return params;

I’m using Postman to send the request because the laptop I’m using doesnt have curl installed (and it is Windows, eww)

Integrity fail? Probably something to do with the check param. Let see what variable checks is from the decompiled APK source code.

final String checks = md5(name + phone + address + email + "[email protected]");

OK, lets use Postman pre-request script to automate the MD5 process

var ayam   =["name"] +["phone"]  +["address"]  +["email"]  +["upline"];
var hash = CryptoJS.MD5(ayam).toString();
postman.setGlobalVariable('hash', hash);

Lets send our request again

Uh oh, still fail. The server detected that this request is not sent via their mobile application. I changed the user agent and able to fool the server.

Hmm, ‘follow up with you upline so that he didn’t missed the email’. That means the server is sending email to the upline! Lets change the upline email to something within our control so we can see what the server sent. Initially I used my Gmail but never received anything, maybe blocked by Gmail. Then I send the email to my own server and able to receive it.

Below is the received email

Received: by ubuntu (Postfix, from userid 33)id 5C4254047D; Sun, 19 Nov 2017 15:23:28 +0800 (+08)
To: lol@[redacted].com
Subject: Registration
X-PHP-Originating-Script: 0:reg.php
From: [email protected]
'NotRelay': [
Message-Id: <20171119072328.5C4254047D@ubuntu>
Date: Sun, 19 Nov 2017 15:23:28 +0800 (+08)

asdasd downlined!

Hmm that base64 thingy looks juicy. Decoding that will result in an 7zip archive, which contains a private key. I didn’t mention above that during the recon phase, I did check this domain on PassiveTotal and discovered its IPv4 address; I nmapped that IP and discovered port 22 SSH opened so maybe this key is used to SSH to the server!

I tried few users to SSH as and finally found one

{ kaya }  ยป ssh [email protected] -i a
Connection to closed.

Flag is wrgm:{OldGuardGoldGuard}