2026. 2. 17. 20:35ㆍWriteUp & Reference - Wargames, CTFs/Mobile
https://github.com/DERE-ad2001/Frida-Labs/tree/main/Frida%200x6
Frida-Labs/Frida 0x6 at main · DERE-ad2001/Frida-Labs
The repo contains a series of challenges for learning Frida for Android Exploitation. - DERE-ad2001/Frida-Labs
github.com

이전 문제들과 유사하게 애플리케이션 어디에도 호출되지 않는 get_flag() 메서드가 존재한다. 이 메서드를 호출하면 AES로 플래그를 복호화 하고 이 값을 TextView에 설정한다.
get_flag()를 살펴보면 Checker 클래스의 인스턴스 하나만 받는다. 이 인자의 이름은 A 이고 타입은 Checker이다. 메서드 내부에서는 A.num1이 1234와 같은지 그리고 A.num2이 4321과 같은지 확인한다.

Checker 클래스에는 두 개의 변수가 있다.
- num1
- num2
if 조건을 만족해 플래그를 복호화하고 설정하는 코드 블록이 실행되려면 num1은 1234, num2는 4321이어야 한다.
그리고 이 클래스의 인스턴스 역시 애플리케이션 어디에서도 생성되지 않는다.
따라서 Checker 클래스의 인스턴스를 생성하고 num1을 1234로, num2를 4321로 설정한다. 그리고 MainActivity의 인스턴스를 가져온다. 해당 인스턴스를 인자로 사용해 get_flag()를 호출한다.
C:\Users\after\Downloads>adb install Challenge_0x6.apk
Performing Streamed Install
SuccessC:\Users\after>frida -U -f com.ad2001.frida0x6
____
/ _ | Frida 17.5.1 - A world-class dynamic instrumentation toolkit
| (_| |
> _ | Commands:
/_/ |_| help -> Displays the help system
. . . . object? -> Display information about 'object'
. . . . exit/quit -> Exit
. . . .
. . . . More info at https://frida.re/docs/home/
. . . .
. . . . Connected to Android Emulator 5554 (id=emulator-5554)
Spawned `com.ad2001.frida0x6`. Resuming main thread!
[Android Emulator 5554::com.ad2001.frida0x6 ]-> Java.performNow(function() {
Java.choose('com.ad2001.frida0x6.MainActivity', {
onMatch: function(instance) {
console.log("Instance found");
var checker = Java.use("com.ad2001.frida0x6.Checker");
var checker_obj = checker.$new(); // Class Object
checker_obj.num1.value = 1234; // num1
checker_obj.num2.value = 4321; // num2
instance.get_flag(checker_obj); // invoking the get_flag method
},
onComplete: function() {}
});
});
Instance found
플래그가 출력된다.
'WriteUp & Reference - Wargames, CTFs > Mobile' 카테고리의 다른 글
| [모바일 보안] Frida-Labs 0x7 (0) | 2026.02.17 |
|---|---|
| [모바일 보안] Frida-Labs 0x5 (0) | 2026.02.17 |
| [모바일 보안] Frida-Labs 0x4 (0) | 2026.02.17 |
| [모바일 보안] Frida-Labs 0x3 (0) | 2026.02.17 |
| [모바일 보안] Frida-Labs 0x2 (0) | 2026.02.16 |