$xml .= "<row id='{$ip}'>"; $name = "<a href=\"../report/index.php?host={$ip}\">" . $host->get_hostname() . "</a>"; $xml .= "<cell><![CDATA[" . $name . "]]></cell>"; $xml .= "<cell><![CDATA[" . $ip . "]]></cell>"; $xml .= "<cell><![CDATA[" . $host->get_asset() . "]]></cell>"; $xml .= "<cell><![CDATA[" . $host->get_threshold_c() . "]]></cell>"; $xml .= "<cell><![CDATA[" . $host->get_threshold_a() . "]]></cell>"; $sensors = ""; if ($sensor_list = $host->get_sensors($conn)) { foreach ($sensor_list as $sensor) { $sensors .= $sensor->get_sensor_name() . '<br/>'; } } $xml .= "<cell><![CDATA[" . utf8_encode($sensors) . "]]></cell>"; $scantype = gettext("None"); if ($scan_list = Host_scan::get_list($conn, "WHERE host_ip = inet_aton('{$ip}')")) { $scantype = ""; foreach ($scan_list as $scan) { $id = $scan->get_plugin_id(); $plugin_name = ""; if ($plugin_list = Plugin::get_list($conn, "WHERE id = {$id}")) { $plugin_name .= $plugin_list[0]->get_name(); $scantype .= ucfirst($plugin_name) . "<br>"; } else { $scantype .= "{$id}<BR>"; } } } $xml .= "<cell><![CDATA[" . $scantype . "]]></cell>"; if ($os_data = Host_os::get_ip_data($conn, $host->get_ip())) { $os = $os_data["os"];
<div id="sched_form"> <h3><center> <?php echo _("Select sensors for this scan"); ?> </center></h3> <ul> <?php $tmp_sensors = Sensor::get_all($conn, "ORDER BY name ASC"); $sensor_list = array(); // Quick & dirty sensor index array for "sensor#" further below $sensor_index = array(); $tmp_index = 0; $tmp_group_hosts = Host_group_scan::get_list($conn, "ORDER BY host_group_name ASC"); $tmp_group_nets = Net_group_scan::get_list($conn, "ORDER BY net_group_name ASC"); $tmp_host = Host_scan::get_list($conn, "ORDER BY host_ip ASC"); $tmp_nets = Net_scan::get_list($conn, "ORDER BY net_name ASC"); $global_i = 0; define("NESSUS", 3001); $net_group_index = array(); $host_group_index = array(); $hosts_index = array(); $nets_index = array(); $net_group_list = array(); $host_group_list = array(); $hosts_list = array(); $nets_list = array(); foreach ($tmp_sensors as $sensor) { if (Sensor::check_plugin_rel($conn, $sensor->get_ip(), NESSUS)) { $sensor_index[$sensor->get_name()] = $tmp_index; $tmp_index++;
require_once 'classes/Host_group_scan.inc'; require_once 'classes/Host_group.inc'; require_once 'classes/Host_scan.inc'; $db = new ossim_db(); $conn = $db->connect(); define("NESSUS", 3001); $sensor_list = array(); // Quick & dirty sensor index array for "sensor#" further below $sensor_index = array(); $tmp_index = 0; //$tmp_sensors = Sensor::get_all($conn, "ORDER BY name ASC"); $tmp_sensors = Sensor::get_list($conn, "ORDER BY name ASC"); // For filtering user perms $tmp_group_hosts = Host_group_scan::get_list($conn, "WHERE plugin_id = 3001 ORDER BY host_group_name ASC"); $tmp_group_nets = Net_group_scan::get_list($conn, "WHERE plugin_id = 3001 ORDER BY net_group_name ASC"); $tmp_host = Host_scan::get_list($conn, "WHERE plugin_id = 3001 ORDER BY host_ip ASC"); $tmp_nets = Net_scan::get_list($conn, "WHERE plugin_id = 3001 ORDER BY net_name ASC"); $net_group_index = array(); $host_group_index = array(); $hosts_index = array(); $nets_index = array(); $net_group_list = array(); $host_group_list = array(); $hosts_list = array(); $nets_list = array(); foreach ($tmp_sensors as $sensor) { if (Sensor::check_plugin_rel($conn, $sensor->get_ip(), NESSUS)) { $sensor_index[$sensor->get_name()] = $tmp_index; $tmp_index++; array_push($sensor_list, $sensor); }
?> "> <?php echo gettext("Plugin sid"); ?> </a></th> <th> <?php echo gettext("Action"); ?> </th> </tr> <?php require_once 'classes/Host_scan.inc'; require_once 'classes/Plugin.inc'; if ($host_list = Host_scan::get_list($conn, "ORDER BY {$order}")) { foreach ($host_list as $host) { $ip = $host->get_host_ip(); $id = $host->get_plugin_id(); if ($plugin_list = Plugin::get_list($conn, "WHERE id = {$id}")) { $plugin_name = $plugin_list[0]->get_name(); } ?> <tr> <td><?php echo $ip; ?> </td> <td><?php echo $plugin_name . " (" . $id . ")"; ?>