From c8f010d9a684aeb004f2e533a53e1ad10301390d Mon Sep 17 00:00:00 2001 From: erwanlr Date: Wed, 8 May 2019 18:17:25 +0100 Subject: [PATCH] Ref #1344 --- app/views/json/finding.erb | 10 ++++++---- spec/output/enumeration/medias/medias.json | 10 ++-------- spec/output/enumeration/timthumbs/no_vulns.json | 10 ++-------- spec/output/enumeration/timthumbs/with_vulns.json | 5 +---- spec/output/main_theme/verbose.json | 5 +---- 5 files changed, 12 insertions(+), 28 deletions(-) diff --git a/app/views/json/finding.erb b/app/views/json/finding.erb index fa2c5519..674e721f 100644 --- a/app/views/json/finding.erb +++ b/app/views/json/finding.erb @@ -11,9 +11,10 @@ }<% unless index == last_index %>,<% end -%> <% end -%> <% end -%> -}, -"vulnerabilities": [ -<% if @item.respond_to?(:vulnerabilities) && !(vulns = @item.vulnerabilities).empty? -%> +} +<% if @item.respond_to?(:vulnerabilities) -%> +,"vulnerabilities": [ +<% unless (vulns = @item.vulnerabilities).empty? -%> <% last_index = vulns.size - 1 -%> <% vulns.each_with_index do |v, index| -%> { @@ -23,4 +24,5 @@ }<% unless index == last_index -%>,<% end -%> <% end -%> <% end -%> -] \ No newline at end of file +] +<% end -%> \ No newline at end of file diff --git a/spec/output/enumeration/medias/medias.json b/spec/output/enumeration/medias/medias.json index 4a53e8ce..63df9900 100644 --- a/spec/output/enumeration/medias/medias.json +++ b/spec/output/enumeration/medias/medias.json @@ -8,10 +8,7 @@ ], "confirmed_by": { - }, - "vulnerabilities": [ - - ] + } }, "http://ex.lo/?attachment_id=5": { "found_by": "Attachment Brute Forcing", @@ -21,10 +18,7 @@ ], "confirmed_by": { - }, - "vulnerabilities": [ - - ] + } } } } \ No newline at end of file diff --git a/spec/output/enumeration/timthumbs/no_vulns.json b/spec/output/enumeration/timthumbs/no_vulns.json index ab50c23f..aac464ae 100644 --- a/spec/output/enumeration/timthumbs/no_vulns.json +++ b/spec/output/enumeration/timthumbs/no_vulns.json @@ -21,10 +21,7 @@ ], "confirmed_by": { - }, - "vulnerabilities": [ - - ] + } } }, "http://ex.lo/tt2.php": { @@ -48,10 +45,7 @@ ], "confirmed_by": { - }, - "vulnerabilities": [ - - ] + } } } } diff --git a/spec/output/enumeration/timthumbs/with_vulns.json b/spec/output/enumeration/timthumbs/with_vulns.json index 2fecd024..0ec1eebb 100644 --- a/spec/output/enumeration/timthumbs/with_vulns.json +++ b/spec/output/enumeration/timthumbs/with_vulns.json @@ -56,10 +56,7 @@ ], "confirmed_by": { - }, - "vulnerabilities": [ - - ] + } } } } diff --git a/spec/output/main_theme/verbose.json b/spec/output/main_theme/verbose.json index 21c0edfe..3c2fc697 100644 --- a/spec/output/main_theme/verbose.json +++ b/spec/output/main_theme/verbose.json @@ -39,10 +39,7 @@ ], "confirmed_by": { - }, - "vulnerabilities": [ - - ] + } }, "parents": [