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

Commit 3e5f37c

Browse files
committed
Fix incorrect instances of the stack being unwound using #scoped_option_change
1 parent f0d6bde commit 3e5f37c

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

lib/wpxf/wordpress/login.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ def wordpress_login(user, pass)
4444
end
4545

4646
private def execute_wp_login_request(user, pass)
47+
res = nil
4748
scoped_option_change('follow_http_redirection', false) do
48-
return execute_post_request(
49+
res = execute_post_request(
4950
url: wordpress_url_login,
5051
body: wordpress_login_post_body(user, pass)
5152
)
5253
end
54+
res
5355
end
5456
end

modules/auxiliary/download_manager_authenticated_privilege_escalation.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def run
6666
'payment_account' => '0'
6767
}
6868

69+
mod_result = true
6970
scoped_option_change('follow_http_redirection', false) do
7071
res = execute_post_request(
7172
url: full_uri,
@@ -77,10 +78,10 @@ def run
7778
emit_success "User #{username} now has full admin rights"
7879
else
7980
emit_error 'Failed to escalate privileges'
80-
return false
81+
mod_result = false
8182
end
8283
end
8384

84-
return true
85+
mod_result
8586
end
8687
end

modules/exploits/user_login_log_authenticated_stored_xss_shell_upload.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@ def requires_authentication
2727
end
2828

2929
def run
30+
stored = true
3031
scoped_option_change 'user_agent', "<script>#{xss_ascii_encoded_include_script}</script>" do
3132
emit_info 'Storing script...'
32-
return false unless super
33+
stored = super
3334
end
3435

36+
return false unless stored
37+
3538
emit_success 'Script stored and will be executed when a user views the login logs.'
3639
start_http_server
3740

0 commit comments

Comments
 (0)