Frida
KnightCTF - Droid Flag
Droid Flag - 100 이번 KnightCTF 문제 풀면서 안드로이드 관련 문제가 나왔는데 워겜이나 변조 앱 분석은 했어도 CTF 문제는 처음이라 풀이를 남긴다. Analysis Application 앱 실행 후 확인해보면 다음과 같은 부분을 확인할 수 있다. “Enter Flag”라는 안내 문구가 적혀있으며, 사용자가 입력할 수 있는 칸 “VALIDATE”라는 문자열이 적힌 Flag 인증 버튼 Source Code MainActivity 디컴파일러를 이용하여 APK를 열어준 후 MainActivity를 확인하기 위해 AndroidManifest 파일을 통해 이를 확인해준다. MainActivity를 확인해보면 이런저런 코드를 확인할 수 있는데 여기서 중요한 부분은 이전에 확인해본 것과 같이 값을..
Uncrackable 2
앱 정보 앱을 실행시키면 이전 Uncrackable 1과 똑같이 루팅 감지를 하고 OK 버튼을 누르면 종료되는 것을 확인할 수 있다. 루팅 감지는 이전 단계와 똑같이 우회할 수 있으니 우회를 한 뒤 확인해보면 사용자 입력을 받을 수 있는 공간 하나와 VERFIY 버튼 하나로 구성되어 있음을 알 수 있다. 또한 이전과 똑같이 무작위 데이터 입력 후 버튼을 눌러보면 "Nope..."이라는 창을 확인할 수 있다. 앱 분석 verify() public void verify(View view) { String str; String obj = ((EditText) findViewById(R.id.edit_text)).getText().toString(); AlertDialog create = new AlertDia..
Uncrackable 1 - Secret String
앱 정보 이전 루팅 우회를 사용하여 애플리케이션을 실행하면 다음과 같이 문자열을 입력받는 부분과 VERIFY 버튼을 확인할 수 있다. 이때 문자열을 아무 값을 넣은 후 VERIFY 버튼을 눌러주면 다음과 같이 다시 시도하라는 메시지 창을 확인할 수 있다. 앱 분석 verify() public void verify(View view) { String str; String obj = ((EditText) findViewById(R.id.edit_text)).getText().toString(); AlertDialog create = new AlertDialog.Builder(this).create(); if (a.a(obj)) { create.setTitle("Success!"); str = "This is..
Uncrackable 1 - Root Detection
앱 정보 앱을 실행시켜보면 다음 그림과 같이 "Root detected"라는 창이 생기고 OK 버튼을 누르면 앱이 종료되는 것을 확인할 수 있다. 앱 분석 onCreate() public void onCreate(Bundle bundle) { if (c.a() || c.b() || c.c()) { a("Root detected!"); } if (b.a(getApplicationContext())) { a("App is debuggable!"); } super.onCreate(bundle); setContentView(R.layout.activity_main); } public class c { public static boolean a() { for (String file : System.getenv("..
FLAG SIX - Login 3
Analysis Code submitFlag public final void submitFlag(View view) { EditText editText = (EditText) findViewById(R.id.editText3); d.b(editText, "editText3"); if (d.a(editText.getText().toString(), k.a("k3FElEG9lnoWbOateGhj5pX6QsXRNJKh///8Jxi8KXW7iDpk2xRxhQ=="))) { Intent intent = new Intent(this, FlagOneSuccess.class); FlagsOverview.D = true; new j().b(this, "flagSixButtonColor", true); startActiv..
Root Detection
Analysis OS 변조 탐지 기능 적용 유무를 확인하기 위한 기능이다. CHECK ROOT 버튼을 누르면 루팅 여부에 따라 "Device is rooted" or "Device is not rooted"라는 문자를 출력한다. 실제 테스트 하는 기기는 루팅 된 기기이기 때문에 다음과 같이 "Device is rooted"라는 문자열을 출력하는 것을 확인할 수 있다. Code RootDetectionActivity$onCreate$1 final class RootDetectionActivity$onCreate$1 implements View.OnClickListener { final /* synthetic */ RootDetectionActivity this$0; RootDetectionActivity$..