Skip to content

Commit ab94bb9

Browse files
committed
Land rapid7#7365, nonce fix for Ninja Forms exploit
2 parents ea625d4 + f838c99 commit ab94bb9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/exploits/unix/webapp/wp_ninja_forms_unauthenticated_file_upload.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def fetch_ninja_form_nonce
109109
fail_with(Failure::UnexpectedReply, "Unable to access FORM_PATH: #{datastore['FORM_PATH']}")
110110
end
111111

112-
form_wpnonce = res.get_hidden_inputs.first['_wpnonce']
112+
form_wpnonce = res.get_hidden_inputs.first
113+
form_wpnonce = form_wpnonce['_wpnonce'] if form_wpnonce
113114

114115
nonce = res.body[/var nfFrontEnd = \{"ajaxNonce":"([a-zA-Z0-9]+)"/i, 1] || form_wpnonce
115116

0 commit comments

Comments
 (0)