diff options
Diffstat (limited to 'config/ipblocklist/manual_add.tmp')
-rwxr-xr-x | config/ipblocklist/manual_add.tmp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/config/ipblocklist/manual_add.tmp b/config/ipblocklist/manual_add.tmp new file mode 100755 index 00000000..ecf42678 --- /dev/null +++ b/config/ipblocklist/manual_add.tmp @@ -0,0 +1,69 @@ +<html> +<head> +<STYLE type="text/css"> + a img {border:none; } + </STYLE> +</head> +<a href="ipblocklist_list.php"><img src="../../themes/nervecenter/images/icons/icon_alias_url_reload.gif" ALT="Manual" ALIGN=RIGHT></a> + +<span style="color:red">Experimental!</span> - This uses a different process to block IPs (uses IPFW) <a href="http://forum.pfsense.org/index.php/topic,24822.0.html" target="_blank"><img src="../../themes/nervecenter/images/icons/icon_log.gif"></a> + <br/>Enter in IP format (xx.xx.xx.xx) or CIDR format (xx.xx.xx.xx/xx) +<br/><form method="post" action=""> +<input name="content" type="text" /> +<input type="image" src="../../themes/nervecenter/images/icons/icon_plus.gif" value="submit"> +<br/> + +<?php + + +$myFile = "ips.ipfw"; +$content = $_REQUEST['content']; +$fh = fopen($myFile, 'a+'); +fwrite($fh, $content); +if (strlen($content) > 1) { + fwrite($fh, "\n"); + } else { + +} +fclose($fh); + + +//echo (filesize($myFile)); +if (filesize($myFile) > 1) { + //$fh = fopen($myFile, 'r'); + //$theData = fread($fh, filesize($myFile)); + //fclose($fh); + echo "<br/> Current List(s): <br/>"; + // Get the whole file into a single string + $fileContents = file_get_contents($myFile); + + // Explode the file contents string by each line + $lines = explode(PHP_EOL, $fileContents); // Replace PHP_EOL with "\r\n" or "\n" or "\r" if you like + + // Iterate through each line and do what you need with it + + foreach ($lines as $line) { + $i++; + echo "<a href=purgeip.php?line=$i style='border-style: none'><img src='../../themes/nervecenter/images/icons/icon_x.gif'></a>"; + echo " "; + exec("kldload ipfw.ko"); + exec("ipfw -q add 2000 drop ip from any to $line"); + exec("ipfw -q add 2001 drop ip from $line to any"); + echo $line; + //echo ""; + // echo $i; + echo "<br/>"; + + } + + + + + +} +echo "<br/><br/>"; + + + + +?>
\ No newline at end of file |