Part 2

3. What is the username and password embedded in the APK?

After unzipping the file, we are left with an APK. There are two routes we can go to analyze this:

Since we are just looking for passwords, decompiling is the way to go. Both APK and JAR use zip to bundle files together.

  1. Unzip the SantaGram APK file to get a copy of the dex file. unzip SantaGram_4.2.apk.
  2. Use dex2jar to convert classes.dex to a jar file. dex2jar classes.dex
  3. Unzip the newly created jar file. unzip classes_dex2jar.jar
  4. Go into the directory created by the zip and decompile all class files with jad. find . -name *.class | xargs jad
  5. Use grep to find hardcoded passwords grep -r password . – This command should reveal the account guest:busyreindeer78.

This method doesn’t preserve the directory structure, and there are certainly better ways to go about it. But it’s quick, easy and allows us to achieve our goal of searching for sensitive hard coded data.

Below is an example of the Smali Code and Disassembled code for defining the password. Notice how little information is on each line in Smali, which makes it difficult to find code via grep.

Smali Disassemle   JAD Decompile
const-string v1, “username”   jsonobject.put(“username”, “guest”);
const-string v2, “guest”   jsonobject.put(“password”, “busyreindeer78”);
const-string v1, “password”    
const-string v2, “busyreindeer78”    

Note: You can skip the converting dex -> jar process by using jadx. However, that program isn’t on the Kali Repo and I avoid running programs directly from github when I can as they tend to be untested and harder to troubleshoot.

4. What is the name of the audible component (audio file) in the SantaGram APK file?

This one is easy, go to the directory where you unzipped the apk file and just run find . | grep mp3. It should return: ./res/raw/discombobulatedaudio1.mp3