<?php
$now = date("m/j/y h:i:s",time());
include "connect.php";
print '<HTML>';
print ' <HEAD>';
print ' <TITLE>Your Hosts</TITLE>';
print ' </HEAD>';
print '<body bgcolor="#FFFFCC">';
$now = date("j/m/y h:i:s",time());
$stmt = "Select * FROM arp_table where IP_ADDRESS = '$REMOTE_ADDR'";
$sth = ibase_query($dbh, $stmt);
//echo $stmt . "<br>";
$i = 0;
$row = ibase_fetch_object($sth);
?>
<body bgcolor="#ffffff" text="#000000">
<form name="form1" method="post" action="postthis.php">
<?
print '<table width="620" bgcolor="#ff9900" border="2">';
print '<input type="hidden" name="serial[]" value="' . $row->SERIAL . '">';
print ' <tr> ';
//if ($i % 2 == 0) {
if ($row->OS_POLICY_VERSION != 0) {
// print ' <td nowrap bgcolor="#ffffff" background="signed.jpg"> ';
print ' <td nowrap bgcolor="#ffffff" background="compliant.gif"> ';
}
else {
// print ' <td nowrap bgcolor="#ffffff" background="unsigned.jpg"> ';
print ' <td nowrap bgcolor="#ffffff" background="noncompliant.gif"> ';
}
$i = $i + 1;
?>
<PRE>IP Address: <b><?print $row->IP_ADDRESS;?></b> MAC Address: <b><?print strtoupper($row->MAC_ADDRESS);?></b>
DNS Name: <b><?print $row->DNS_NAME;if (strlen($row->DNS_NAME)<8) {Print " ";}?></b> Netbios Name: <b><?print $row->NETBIOS_NAME;?></b>
First Seen: <b><?print $row->FIRST_SEEN;?></b> Last Seen: <b><?print $row->LAST_SEEN;?></b>
IASO: <b>Dana Allen</b> SA: <Select name="OWNER[]">
<?
$stmt2 = "select SERIAL, FIRST_NAME, LAST_NAME, LAB from OWNER where LAB='ITL' order by LAST_NAME";
$sth2 = ibase_query($dbh, $stmt2);
while ($row2 = ibase_fetch_object($sth2)) {
print '<option value="' . $row2->SERIAL . '"';
if ($row2->SERIAL==$row->OWNER) {
print "selected "; }
print '>' . $row2->LAST_NAME . ', ' . $row2->FIRST_NAME . '</option>';
}
?>
</select>
System Description: <input type="text" name="SYS_DESC[]" value="<? print $row->SYS_DESC;?>" size="50" maxlength="50">
Building: <input type="text" name="BUILDING[]" value="<? print $row->BUILDING;?>" size="10" maxlength="10">
Room: <input type="text" name="ROOM[]" value="<? print $row->ROOM;?>" size="10" maxlength="10">
Barcode Number: <input type="text" name="BARCODE[]" value="<? print $row->BARCODE;?>" size="10" maxlength="10">
OS: <b><?print $row->OS;?></b>
OS Change: <? print '<select name="OSlist[]">';
$stmt2 = "Select distinct OS FROM ARP_TABLE;";
$sth2 = ibase_query($dbh, $stmt2);
while ($row2 = ibase_fetch_object($sth2)) {
if ($row2->OS != '') {
echo '<option value="' . $row2->OS . '"';
if ($row2->OS==$row->OS) {
print "selected "; }
print '>' . substr($row2->OS,0,35) . '</option>';
}
}
print "</select>";?>
2nd OS: <b><? print $row->OS2;?></b>
2nd OS Change: <? print '<select name="OS2list[]">';
$stmt3 = "Select distinct OS FROM ARP_TABLE;";
$sth3 = ibase_query($dbh, $stmt3);
echo '<option value="None">None</option>';
while ($row3 = ibase_fetch_object($sth3)) {
if ($row3->OS != '') {
echo '<option value="' . $row3->OS . '"';
if ($row3->OS==$row->OS2) {
print "selected "; }
print '>' . substr($row3->OS,0,35) . '</option>';
}
}
print "</select><br><p>";
if ($row->OS_POLICY_VERSION == 0) {
print ' <b>Mark machine as compliant with above policy/policies</b> <input type="checkbox" name="checkbox" value="checkbox">';
} else {
print ' Compilant as of <b>' . substr($row->OS_POLICY_DATE,0,10) . '</b>';
}
print '</pre>';
print "</td></tr>";
print "</table>";
//print '<input type="submit" name="Submit" value="Submit">';
//print "</form>";
$stmt4 = "select DISTINCT a.SHORTDESC, a.FULLDESC, A.FIX, A.SEVERITY, B.HOSTID from VULNS a, VULNSFOUND b, HOSTS c where (c.ipaddressstr = '$REMOTE_ADDR') and (c.hostid=b.hostid) and (b.vulnid=a.vulnid) ORDER BY a.SEVERITY DESC";
print '<TABLE BORDER="1">';
$sth4 = ibase_query($dbh,$stmt4);
while ($row4 = ibase_fetch_object($sth4)) {
if ($row4->SEVERITY==3) {
print '<tr bgcolor="EED3D6">';
}
if ($row4->SEVERITY==2) {
print '<tr bgcolor="F9FBBE">';
}
if ($row4->SEVERITY==1) {
print '<tr bgcolor="D3EED3">';
}
print '<td width="5%" rowspan="2">';
print $row4->SEVERITY . "</td>";
print '<td colspan="2">';
print '<select name="Fixed[]"> <option value="Yes">Fixed</option><option value="No"Selected>Not Fixed</option></select>';
print $row4->SHORTDESC . "</td>";
print "</tr>";
if ($row4->SEVERITY==3) {
print '<tr bgcolor="EED3D6">';
}
if ($row4->SEVERITY==2) {
print '<tr bgcolor="F9FBBE">';
}
if ($row4->SEVERITY==1) {
print '<tr bgcolor="D3EED3">';
}
print '<td width="30%">';
ibase_blob_echo($row4->FULLDESC);
print "</td>";
print '<td>';
print ibase_blob_echo($row4->FIX);
print "</td>";
print "</tr>";
$hostid=$row4->HOSTID;
}
print "</table>";
print "</table>";
if (strlen($hostid)!=0) {
print '<TABLE BORDER = "1">';
$stmt5 = "select distinct a.shortdesc, a.servicetype, a.ports from services a, servicesfound b where (b.hostid=$hostid) and (a.serviceid=b.serviceid) order by a.PORTS;";
$sth5 = ibase_query($dbh,$stmt5);
while ($row5 = ibase_fetch_object($sth5)) {
print "<TR><td>";
print $row5->SHORTDESC . "</td><td>" . $row5->PORTS . "</td><td>" . $row5->SERVICETYPE . "</td></tr>";
}
print "</table>";
}
//$stmt6 = "select distinct * from banners where hostid=$hostid;";
//$sth6 = ibase_query($dbh,$stmt6);
//while ($row6 = ibase_fetch_object($sth6)) {
//}
print '<input type="submit" name="Submit" value="Submit">';
print "</form>";
?>