Rapid7 Vulnerability & Exploit Database

Synology DiskStation Manager smart.cgi Remote Command Execution

Back to Search

Synology DiskStation Manager smart.cgi Remote Command Execution

Disclosed
11/08/2017
Created
05/22/2020

Description

This module exploits a vulnerability found in Synology DiskStation Manager (DSM) versions < 5.2-5967-5, which allows the execution of arbitrary commands under root privileges after website authentication. The vulnerability is located in webman/modules/StorageManager/smart.cgi, which allows appending of a command to the device to be scanned. However, the command with drive is limited to 30 characters. A somewhat valid drive name is required, thus /dev/sd is used, even though it doesn't exist. To circumvent the character restriction, a wget input file is staged in /a, and executed to download our payload to /b. From there the payload is executed. A wfsdelay is required to give time for the payload to download, and the execution of it to run.

Author(s)

  • Nigusu Kassahun
  • h00die

Platform

Python

Architectures

python

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/linux/http/synology_dsm_smart_exec_auth
msf exploit(synology_dsm_smart_exec_auth) > show targets
    ...targets...
msf exploit(synology_dsm_smart_exec_auth) > set TARGET < target-id >
msf exploit(synology_dsm_smart_exec_auth) > show options
    ...show and set options...
msf exploit(synology_dsm_smart_exec_auth) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;