Skip to content

Commit 167f597

Browse files
author
jvazquez-r7
committed
minor cleanup for rails_json_yaml_scanner
1 parent 3e2a368 commit 167f597

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

modules/auxiliary/scanner/http/rails_json_yaml_scanner.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ def initialize(info={})
1919
This module attempts to identify Ruby on Rails instances vulnerable to
2020
an arbitrary object instantiation flaw in the JSON request processor.
2121
},
22-
'Author' => [
22+
'Author' =>
23+
[
2324
'jjarmoc', # scanner module
2425
'hdm' # CVE-2013-0156 scanner, basis of this technique.
25-
],
26+
],
2627
'License' => MSF_LICENSE,
2728
'References' =>
2829
[
29-
['CVE', '2013-0333'],
30+
['CVE', '2013-0333']
3031
]
3132
))
3233

@@ -38,11 +39,11 @@ def initialize(info={})
3839

3940
def send_probe(pdata)
4041
res = send_request_cgi({
41-
'uri' => datastore['TARGETURI'],
42+
'uri' => normalize_uri(datastore['TARGETURI']),
4243
'method' => datastore['HTTP_METHOD'],
4344
'ctype' => 'application/json',
4445
'data' => pdata
45-
}, 25)
46+
})
4647
end
4748

4849
def run_host(ip)
@@ -58,8 +59,7 @@ def run_host(ip)
5859
end
5960

6061
if res1.code.to_s =~ /^[5]/
61-
print_error("#{rhost}:#{rport} The server replied with #{res1.code} for our initial JSON request")
62-
print_error("\t\tDouble check TARGETURI and HTTP_METHOD")
62+
vprint_error("#{rhost}:#{rport} The server replied with #{res1.code} for our initial JSON request, double check TARGETURI and HTTP_METHOD")
6363
return
6464
end
6565

@@ -94,7 +94,7 @@ def run_host(ip)
9494
})
9595
else
9696
# Otherwise we're not likely vulnerable.
97-
vprint_status("#{rhost}:#{rport} is not likely to be vulnerable or TARGETURI must be set")
97+
vprint_status("#{rhost}:#{rport} is not likely to be vulnerable or TARGETURI & HTTP_METHOD must be set")
9898
end
9999
end
100100

0 commit comments

Comments
 (0)