Lidt info om Code Red
Se hvor mange gange du er blevet angrebet af Code Red.Husk at ændre stien til din access_log.
/Schumacher
<?php
/*******************************************
** OpenSource
** coded by: Jeff
** modified by: John
** made better by: Alex
** made prettier/table by: Schumacher
** Change location of your logs in the line starting with $file
**
********************************************
*/
// Sæt denne til at pege på din access_log
$file = \"/home/httpd/eksempel/logs/access_log\";
$fh = fopen ($file,\"r\") or die (\"Canot find access_log!\");
while (!feof ($fh))
{
$line = fgets ($fh, 4096);
if (ereg (\"default.ida\",$line))
{
if (ereg (\"default.ida\\?XXX\",$line)) $counter2++;
if (ereg (\"default.ida\\?NNN\",$line)) $counter1++;
$hosts[current(explode(\" \",$line))]+=1;
}
}
fclose ($fh);
?>
CodeRed Hit Count : <?php echo $counter1; ?> <br>
CodeRed II Hit Count <?php echo $counter2; ?> <br>
and still counting..... <br><br>
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td>Host IP</td>
<td>Number of attacks</td>
</tr>
<?php foreach (array_keys($hosts) as $host)
{
print \"<tr>\";
print \"<td>$host</td>\";
print \"<td align=center>$hosts[$host]</td>\";
print \"</tr>\";
}
?>
</table>
