I have modified search.php to include searching of all other items. now any items discovered by nmap audits are no searchable:
Open search.php:
Replace lines 191-197 which should be:
[code] $sql = "SELECT DISTINCT other_network_name, other_id, other_ip_address, other_mac_address, other_description FROM other WHERE "; $sql .= "other_mac_address LIKE '%$search%'";
$result = mysql_query($sql, $db); if ($myrow = mysql_fetch_array($result)){ do { if (strpos(strtoupper($myrow["other_mac_address"]), $search) !== false){$search_field = "Device MAC Address"; $search_result = $myrow["other_mac_address"];} [/code]
With:
[code] $sql = "SELECT DISTINCT other_network_name, other_id, other_ip_address, other_mac_address, other_description FROM other WHERE "; $sql .= "other_mac_address LIKE '%$search%' OR "; $sql .= "other_ip_address LIKE '%$search%' OR "; $sql .= "other_network_name LIKE '%$search%' OR "; $sql .= "other_description LIKE '%$search%'";
$result = mysql_query($sql, $db); if ($myrow = mysql_fetch_array($result)){ do { if (strpos(strtoupper($myrow["other_mac_address"]), $search) !== false){$search_field = "Device MAC Address"; $search_result = $myrow["other_mac_address"];} if (strpos(strtoupper($myrow["other_ip_address"]), $search) !== false){$search_field = "Device IP Address"; $search_result = $myrow["other_ip_address"];} if (strpos(strtoupper($myrow["other_network_name"]), $search) !== false){$search_field = "Device Name"; $search_result = $myrow["other_network_name"];} if (strpos(strtoupper($myrow["other_description"]), $search) !== false){$search_field = "Device Description"; $search_result = $myrow["other_description"];} [/code]
This now includes searching over Other, MAC address, IP address, Network Name, and Description. This is helpful for searching for routers, switches, firewalls etc, that audit.vbs does not pick up.
Let me know if there are any questions/concerns.
Jason
_________________ OA Deployment: Windows 2003 with XAMPP install 80 Windows Servers 250 Windows workstations (mixed XP and 2000) 5 MACs Multiple printers, switches, routers, firewalls, and other servers (ESX, AIX etc.)
|