Skip to content

Instantly share code, notes, and snippets.

@wchen-r7
Last active June 29, 2016 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wchen-r7/701269eaf9ce2c17ad3888e18ce12248 to your computer and use it in GitHub Desktop.
Save wchen-r7/701269eaf9ce2c17ad3888e18ce12248 to your computer and use it in GitHub Desktop.
def fetch_ninja_form_nonce
uri = normalize_uri(target_uri.path, datastore['FORM_PATH'])
res = send_request_cgi(
'method' => 'GET',
'uri' => uri
)
puts res.body
fail_with Failure::UnexpectedReply, 'Failed to acquire a nonce' unless res && res.code == 200
res.body[/var nfFrontEnd = \{"ajaxNonce":"([a-zA-Z0-9]+)"/i, 1]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment