
1979 changes to exploits/shellcodes Couchdb 1.5.0 - 'uuids' Denial of Service Apache CouchDB 1.5.0 - 'uuids' Denial of Service Beyond Remote 2.2.5.3 - Denial of Service (PoC) udisks2 2.8.0 - Denial of Service (PoC) Termite 3.4 - Denial of Service (PoC) SoftX FTP Client 3.3 - Denial of Service (PoC) Silverstripe 2.3.5 - Cross-Site Request Forgery / Open redirection SilverStripe CMS 2.3.5 - Cross-Site Request Forgery / Open Redirection Silverstripe CMS 3.0.2 - Multiple Vulnerabilities SilverStripe CMS 3.0.2 - Multiple Vulnerabilities Silverstripe CMS 2.4 - File Renaming Security Bypass SilverStripe CMS 2.4 - File Renaming Security Bypass Silverstripe CMS 2.4.5 - Multiple Cross-Site Scripting Vulnerabilities SilverStripe CMS 2.4.5 - Multiple Cross-Site Scripting Vulnerabilities Silverstripe CMS 2.4.7 - 'install.php' PHP Code Injection SilverStripe CMS 2.4.7 - 'install.php' PHP Code Injection Silverstripe Pixlr Image Editor - 'upload.php' Arbitrary File Upload SilverStripe CMS Pixlr Image Editor - 'upload.php' Arbitrary File Upload Silverstripe CMS 2.4.x - 'BackURL' Open Redirection SilverStripe CMS 2.4.x - 'BackURL' Open Redirection Silverstripe CMS - 'MemberLoginForm.php' Information Disclosure SilverStripe CMS - 'MemberLoginForm.php' Information Disclosure Silverstripe CMS - Multiple HTML Injection Vulnerabilities SilverStripe CMS - Multiple HTML Injection Vulnerabilities Apache CouchDB 1.7.0 and 2.x before 2.1.1 - Remote Privilege Escalation Apache CouchDB 1.7.0 / 2.x < 2.1.1 - Remote Privilege Escalation Monstra CMS before 3.0.4 - Cross-Site Scripting Monstra CMS < 3.0.4 - Cross-Site Scripting (2) Monstra CMS < 3.0.4 - Cross-Site Scripting Monstra CMS < 3.0.4 - Cross-Site Scripting (1) Navigate CMS 2.8 - Cross-Site Scripting Collectric CMU 1.0 - 'lang' SQL injection Joomla! Component CW Article Attachments 1.0.6 - 'id' SQL Injection LG SuperSign EZ CMS 2.5 - Remote Code Execution MyBB Visual Editor 1.8.18 - Cross-Site Scripting Joomla! Component AMGallery 1.2.3 - 'filter_category_id' SQL Injection Joomla! Component Micro Deal Factory 2.4.0 - 'id' SQL Injection RICOH Aficio MP 301 Printer - Cross-Site Scripting Joomla! Component Auction Factory 4.5.5 - 'filter_order' SQL Injection RICOH MP C6003 Printer - Cross-Site Scripting Linux/ARM - Egghunter (PWN!) + execve(_/bin/sh__ NULL_ NULL) Shellcode (28 Bytes) Linux/ARM - sigaction() Based Egghunter (PWN!) + execve(_/bin/sh__ NULL_ NULL) Shellcode (52 Bytes)
57 lines
No EOL
2.3 KiB
Text
57 lines
No EOL
2.3 KiB
Text
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=1149
|
|
|
|
The XNU kernel, when compiled for a x86-64 CPU, can run 32-bit x86
|
|
binaries in compatibility mode. 32-bit binaries use partly separate
|
|
syscall entry and exit paths.
|
|
|
|
To return to userspace, unix_syscall() in bsd/dev/i386/systemcalls.c
|
|
calls thread_exception_return() (in osfmk/x86_64/locore.s), which in
|
|
turn calls return_from_trap, which is implemented in
|
|
osfmk/x86_64/idt64.s.
|
|
|
|
return_from_trap() normally branches into return_to_user relatively
|
|
quickly, which then, depending on the stack segment selector, branches
|
|
into either L_64bit_return or L_32bit_return. While the L_64bit_return
|
|
path restores all userspace registers, the L_32bit_return path only
|
|
restores the registers that are accessible in compatibility mode; the
|
|
registers r8 to r15 are not restored.
|
|
|
|
This is bad because, although switching to compatibility mode makes it
|
|
impossible to directly access r8..r15, the register contents are
|
|
preserved, and switching back to 64-bit mode makes the 64-bit
|
|
registers accessible again. Since the GDT always contains user code
|
|
segments for both compatibility mode and 64-bit mode, an unprivileged
|
|
32-bit process can leak kernel register contents as follows:
|
|
|
|
- make a normal 32-bit syscall
|
|
- switch to 64-bit mode (e.g. by loading the 64-bit user code segment
|
|
using iret)
|
|
- store the contents of r8..r15
|
|
- switch back to compatibility mode (e.g. by loading the 32-bit user
|
|
code segment using iret)
|
|
|
|
The attached PoC demonstrates the issue by dumping the contents of
|
|
r8..r15. Usage:
|
|
|
|
$ ./leakregs
|
|
r8 = 0xffffff801d3872a8
|
|
r9 = 0xffffff8112abbec8
|
|
r10 = 0xffffff801f962240
|
|
r11 = 0xffffff8031d52bb0
|
|
r12 = 0x12
|
|
r13 = 0xffffff80094018f0
|
|
r14 = 0xffffff801cb59ea0
|
|
r15 = 0xffffff801cb59ea0
|
|
|
|
It seems like these are various types of kernel pointers, including
|
|
kernel text pointers.
|
|
|
|
If you want to compile the PoC yourself, you'll have to adjust the
|
|
path to nasm in compile.sh, then run ./compile.sh.
|
|
|
|
This bug was verified using the following kernel version:
|
|
15.6.0 Darwin Kernel Version 15.6.0: Mon Jan 9 23:07:29 PST 2017;
|
|
root:xnu-3248.60.11.2.1~1/RELEASE_X86_64 x86_64
|
|
|
|
Proof of Concept:
|
|
https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/42046.zip |