diff options
author | Tom Schaefer <tom@tomschaefer.org> | 2010-12-06 12:20:00 -0500 |
---|---|---|
committer | Tom Schaefer <tom@tomschaefer.org> | 2010-12-06 12:20:00 -0500 |
commit | e6a67ab642563f5122d8a661977740c1ea8749b7 (patch) | |
tree | e1a1dc530f45d9303389c806b386899902457c6d /config/ipblocklist/7/manual_add.tmp | |
parent | 7ab65e4c7553580cf9f66350cb3cb6401443d045 (diff) | |
download | pfsense-packages-e6a67ab642563f5122d8a661977740c1ea8749b7.tar.gz pfsense-packages-e6a67ab642563f5122d8a661977740c1ea8749b7.tar.bz2 pfsense-packages-e6a67ab642563f5122d8a661977740c1ea8749b7.zip |
ipblocklist 3.0.1 update with new file structure
Diffstat (limited to 'config/ipblocklist/7/manual_add.tmp')
-rwxr-xr-x | config/ipblocklist/7/manual_add.tmp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/config/ipblocklist/7/manual_add.tmp b/config/ipblocklist/7/manual_add.tmp new file mode 100755 index 00000000..361b782b --- /dev/null +++ b/config/ipblocklist/7/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/>"; + + + + +?> |