IDSECCONF CTF 2024
Prepared by: 3 MAS MAS
AnYujin - Vaints - wiz
PWN - VPC (Vaints Fans Club)
● Diberikan sebuah file untuk challenge Kernel Exploitation
- No
KASLR
- SMAP,
SMEP, KPTI
run.sh
IOCTL menu:
typedef struct params{
char *user_ptr;
size_t sz;
} params;
- KMALLOC 0x13370002, alokasi heap dengan
kmalloc_cache_noprof()
- KFREE 0x13370004, delete heap menggunakan kfree()
- KREAD 0x13370006, copy data/buffer dari kernel land ke user
land.
- KWRITE 0x13370008, copy data/buffer dari userland ke
kernel land.
ike.ko
ike.ko [VULNERABILITY & Attack Plan]
Vulnerability Use After Free, dikarenakan pointer tidak
dianulir setelah melakukan kfree(), program dapat
mengakses kembali data dari kernel object lain.
Attack Plan:
- Allocate a HEAP (0x320)
- Delete the HEAP
- Open /dev/ptmx (tty_struct, kmalloc-1024)
- UAF, Overwrite tty_struct->ops
“mov DWORD PTR [rdx+0x108],esi”
- Overwrite modprobe_path to “/tmp/x”
- Get Root
PWN - SOP
● Diberikan binary dan file GLIBC
VULNERABILITY: Tidak ada pengecekan index, menimbulkan vuln
OOB Write.
ATTACK PLAN:
- Allocate HUGE Sized Heap (allocated right before libc)
- OOB Write, Overwrite STDOUT untuk leak LIBC ADDRESS
- OOB Write, Overwrite struct STDIN, arahkan ke STDOUT
- Overwrite, STDOUT with House of Apple to spawn shell
VULNERABILITY & ATTACK PLAN
PWN - Tsuki
● Diberikan dua binary (parent dan child), serta file GLIBC
parent
child
Vulnerability Child program menerima input dari
user menggunakan function gets(), dikarenakan
tidak ada pengecekan jumlah input, timbul vuln
Buffer Overflow
Attack Plan:
- Buffer Overflow -> ROP
- Ret2libc
- Kill child process:
kill(getpid(), SIGTTOU);
PWN - Tsuki
(VULNERABILITY & ATTACK PLAN)
REV - PasswordChecker
● Diberikan sebuah binary untuk
mengecek suatu password
parent
Dikarenakan function check() diload secara
dinamis, kami melakukan dumping instruksi
pada function tersebut.
Rax digunakan untuk mengakses indeks flag, dan
meloadnya pada register rax ataupun rdx.
Terdapat operasi xor antara rax dan rdx.
REV - PasswordChecker
Kami rebuild instruksi, dan didapatkan
pengecekan sebagai berikut:
REV - PasswordChecker
REV - PasswordChecker
REV - Posx
Diberikan sebuah binary posx-db63ae0b0921e9af54000c9ead3c2306
Posx
Posx
Rev - Hook
Diberikan sebuah file dll bernama TotallyNotMalicious-
3db4ab2b84a9918863967bdb10ec60f3.dll
Hook
Hook
#include <windows.h>
#include <iostream>
typedef int (__stdcall *f_funci)();
int main()
{
HINSTANCE hGetProcIDDLL = LoadLibrary("TotallyNotMalicious-3db4ab2b84a9918863967bdb10ec60f3.dll");
return EXIT_SUCCESS;
}
Hook
Hook
Rev - mobtenance
- Pada soal ini diberikan APK yang diketahui dibuat dengan menggunakan flutter
- Dekompilasi dengan menggunakan blutter https://github.com/worawit/blutter
mobtenance
asm / api / auth_api.dart
Mobsecconf
mobtenance

IDSECCONF2024 Capture The FLag Write up - 3 MAS MAS

  • 1.
    IDSECCONF CTF 2024 Preparedby: 3 MAS MAS AnYujin - Vaints - wiz
  • 2.
    PWN - VPC(Vaints Fans Club) ● Diberikan sebuah file untuk challenge Kernel Exploitation - No KASLR - SMAP, SMEP, KPTI run.sh
  • 3.
    IOCTL menu: typedef structparams{ char *user_ptr; size_t sz; } params; - KMALLOC 0x13370002, alokasi heap dengan kmalloc_cache_noprof() - KFREE 0x13370004, delete heap menggunakan kfree() - KREAD 0x13370006, copy data/buffer dari kernel land ke user land. - KWRITE 0x13370008, copy data/buffer dari userland ke kernel land. ike.ko
  • 4.
    ike.ko [VULNERABILITY &Attack Plan] Vulnerability Use After Free, dikarenakan pointer tidak dianulir setelah melakukan kfree(), program dapat mengakses kembali data dari kernel object lain. Attack Plan: - Allocate a HEAP (0x320) - Delete the HEAP - Open /dev/ptmx (tty_struct, kmalloc-1024) - UAF, Overwrite tty_struct->ops “mov DWORD PTR [rdx+0x108],esi” - Overwrite modprobe_path to “/tmp/x” - Get Root
  • 5.
    PWN - SOP ●Diberikan binary dan file GLIBC
  • 6.
    VULNERABILITY: Tidak adapengecekan index, menimbulkan vuln OOB Write. ATTACK PLAN: - Allocate HUGE Sized Heap (allocated right before libc) - OOB Write, Overwrite STDOUT untuk leak LIBC ADDRESS - OOB Write, Overwrite struct STDIN, arahkan ke STDOUT - Overwrite, STDOUT with House of Apple to spawn shell VULNERABILITY & ATTACK PLAN
  • 7.
    PWN - Tsuki ●Diberikan dua binary (parent dan child), serta file GLIBC parent child
  • 8.
    Vulnerability Child programmenerima input dari user menggunakan function gets(), dikarenakan tidak ada pengecekan jumlah input, timbul vuln Buffer Overflow Attack Plan: - Buffer Overflow -> ROP - Ret2libc - Kill child process: kill(getpid(), SIGTTOU); PWN - Tsuki (VULNERABILITY & ATTACK PLAN)
  • 9.
    REV - PasswordChecker ●Diberikan sebuah binary untuk mengecek suatu password parent
  • 10.
    Dikarenakan function check()diload secara dinamis, kami melakukan dumping instruksi pada function tersebut. Rax digunakan untuk mengakses indeks flag, dan meloadnya pada register rax ataupun rdx. Terdapat operasi xor antara rax dan rdx. REV - PasswordChecker
  • 11.
    Kami rebuild instruksi,dan didapatkan pengecekan sebagai berikut: REV - PasswordChecker
  • 12.
  • 13.
    REV - Posx Diberikansebuah binary posx-db63ae0b0921e9af54000c9ead3c2306
  • 14.
  • 15.
  • 16.
    Rev - Hook Diberikansebuah file dll bernama TotallyNotMalicious- 3db4ab2b84a9918863967bdb10ec60f3.dll
  • 17.
  • 18.
    Hook #include <windows.h> #include <iostream> typedefint (__stdcall *f_funci)(); int main() { HINSTANCE hGetProcIDDLL = LoadLibrary("TotallyNotMalicious-3db4ab2b84a9918863967bdb10ec60f3.dll"); return EXIT_SUCCESS; }
  • 19.
  • 20.
  • 21.
    Rev - mobtenance -Pada soal ini diberikan APK yang diketahui dibuat dengan menggunakan flutter - Dekompilasi dengan menggunakan blutter https://github.com/worawit/blutter
  • 22.
    mobtenance asm / api/ auth_api.dart
  • 23.
  • 24.