Strings
Hello everyone , In this blog post , I will try to explain my solution steps for Strings challenge from Mobile Hacking Lab Platform . i hope it will be useful for you
Last updated
Hello everyone , In this blog post , I will try to explain my solution steps for Strings challenge from Mobile Hacking Lab Platform . i hope it will be useful for you
Last updated
Let's install our app then open the application . we found that "Hello from c++" message appears on the home page. let’s analysis the app using Jadx tool
During Analysis the AndroidManifest.xml file we found 2 important Activity :
The First activity is com.mobilehackinglab.challenge.MainActivity
Let’s analysis it’s code
it have a native Library challenge
KLOW() function
: This code saves the current date in a SharedPreferences file named DAD4
using the key UUU0133
.
The Second Activity is a com.mobilehackinglab.challenge.Activity2
, Exported and contain Schema Let’s analysis it’s code , and this contain many things :
first thing the app Reads the value associated with the key UUU0133
stored in SharedPreferences.
Second is Compares the stored value (u_1
) with some value returned by the method m144cd()
then Checks if the URI in the intent uses the mhl
scheme and labs
host the app extracts a base64-encoded value, decodes, and attempts to decrypt it using AES and If the decrypted value matches the secret key, the app loads the "flag" library, and call thegetflag()
, and displays the flag via a toast.
in this step we will Decrypt the secret
we have :
String : bqGrDKdQ8zo26HflRsGvVA==
Key. : your_secret_key_1234567890123456
IV : 1234567890123456
retrieved from Activity2K
i use this python script to decrypt the secret and this is the result mhl_secret_1337
Then let’s create Frida script do this :
call KLOW()
from the Main activity ⇒ to save the secret
call m144cd
from the Activity2 ⇒ to return the today’s date as string with dd/mm/yyyy format
use this command with frida script : frida -U -f com.mobilehackinglab.challenge -l frida.js
call Activity2
and pass android.intent.action.VIEW
as action and mhl://labs/secret-encoded-value
as data to the activity.
we get Success message in the application but flag doesn’t return !!
Lets search for our flag inside the memory
we have a lot of files let’s try to extract by reading all strings from all files and then filter for the start with MHL MHL{IN_THE_MEMORY}