# Crackme RE Challenge

### 01. Introduction

> Please install the given Android APK into your Android emulator. Run the app. You need a secret code to start the app. What is the secret code?

Your goal is to analyze the apk file and find the valid password.

APK File:

{% embed url="<https://www.dropbox.com/s/9dq0ipholoujqy8/Crackme.zip?dl=0>" %}

### 02. Analysis

Install the apk file on the android emulator:

```
adb install CrackMe.apk
```

Start the application and enter a password:

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2FvPhGBuAAPYa9MCeOPxTs%2FcrackmeRE01.png?alt=media&#x26;token=6b83b8fa-80ab-48bd-bdcf-3d134bc4d602" alt=""></div>

Let's analyse the code by using jadx-gui

In the MainActiviy class there is a string called `secret_code`

![](https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2FFZWrpy9f2jAN6tSwMxZR%2FcrackmeRE02.png?alt=media\&token=c01e38f8-4b7d-4868-af22-2428d91a392a)

Later we can see that a **base64 encoding** is taking place. The input will be encoded with base64 and then be compared with the base64 encoded value of secret\_code.

If the input matches I’ll get the message "Congratulations! You found the secret code."\
If not "Sorry incorrect, try again." will be displayed.

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2FSKouNCRhz2g5SZgiy1Sg%2FcrackmeRE03.png?alt=media&#x26;token=8e51628e-d3bd-40c8-b534-dfd88e7b826b" alt=""></div>

Let's try to decode the secret\_code string:

```
echo MDE5MjgzNzQ2NTAw | base64 -d
```

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2Fk9CqwNb3h6JNJpv9JilU%2FcrackmeRE04.png?alt=media&#x26;token=b4c6dd92-41e0-4fc4-9203-733afecaec9c" alt=""></div>

Let's try to enter the password:

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2FgKy3WwIGRo3uCYnwbbZ1%2FcrackmeRE05.png?alt=media&#x26;token=edd223cd-c61b-4e37-a60b-cdbb0cd07f35" alt=""></div>

Challenge solved :thumbsup:
