#  This software was derived from SATAN 1.1.1 by Dan Farmer and Wietse Venema
#  (http://www.porcupine.org/satan).
#
#
# Show all hosts with a specific vulnerability.
#
($_SEVERITY, $_sort_order) = split(/,/, $html_script_args);
($_severity = $_SEVERITY) =~ tr /+!/ \//;
($_tutorial = $_severity) =~ tr / /_/;

print CLIENT <<EOF;
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
  function movepic(img_name,img_src) {
  document[img_name].src=img_src;
}
</SCRIPT>
<title> Host Table - $_severity </title>
<LINK REV="made" HREF="mailto:satan\@fish.com">
<LINK REB="made" HREF="mailto:sara\@arc.com">
</HEAD>
<BODY>
EOF
if ($pi_menu) {
  $screen = &$pi_menu;
} else {
  $screen = print_menu();
}
$screen =~ s/\\n/\n/g;
print CLIENT $screen;
print CLIENT <<EOF;
</TD><TD valign=top>
<CENTER><H1>Host Table - $_severity </H1></CENTER>
<hr>

<h2> 
Tutorial: 
EOF
$cve = &get_cve($service_output, $text);
$TUT = "nvd//$cve.html";

print CLIENT <<EOF;
<a href="$HTML_ROOT/$TUT">$_severity</a>.
</h2>

<h3> 
$severity_type_count{$_severity} Host(s). 
Number of vulnerabilities in parentheses. 
</h3>

<H4> Sort hosts by:
<a href="sara_severity_hosts.pl,$_SEVERITY,name,">name</a> |
<a href="sara_severity_hosts.pl,$_SEVERITY,domain,">domain</a> |
<a href="sara_severity_hosts.pl,$_SEVERITY,type,">system type</a> |
<a href="sara_severity_hosts.pl,$_SEVERITY,subnet,">subnet</a> |
<a href="sara_severity_hosts.pl,$_SEVERITY,severity,">problem count</a> 
</H4>
EOF

@_hosts = keys %{$severity_type_host_info{$_severity}};
do "$html_root/reporting/sort_hosts.pl";
print CLIENT $@ if $@;

print CLIENT <<EOF;
<hr> <a href="/"> Back to the SARA start page </a> |
<a href=/reporting/analysis.pl> Back to SARA Reporting and Analysis </a>
</UL></UL></TABLE>
</BODY>
</HTML>
EOF
