aboutsummaryrefslogtreecommitdiffstats
path: root/config/dnsblacklist
diff options
context:
space:
mode:
authormcrane <mctch@yahoo.com>2009-10-02 12:15:18 -0600
committermcrane <mctch@yahoo.com>2009-10-02 13:48:00 -0600
commit268a257deb2a3d22ddfe3ccd99c9002b46fb0f18 (patch)
tree1d462843998595f8093c42ea5ff93fffc4ddadc5 /config/dnsblacklist
parent1904ec30efb7260c8aab675fb58addc61c73a162 (diff)
downloadpfsense-packages-268a257deb2a3d22ddfe3ccd99c9002b46fb0f18.tar.gz
pfsense-packages-268a257deb2a3d22ddfe3ccd99c9002b46fb0f18.tar.bz2
pfsense-packages-268a257deb2a3d22ddfe3ccd99c9002b46fb0f18.zip
Introducing a dnsblacklist a new package created by the collaboration of xa0z and mcrane.
Diffstat (limited to 'config/dnsblacklist')
-rw-r--r--config/dnsblacklist/dnsblacklist.inc143
-rw-r--r--config/dnsblacklist/dnsblacklist.tmp199
-rw-r--r--config/dnsblacklist/dnsblacklist.tmp.old276
-rw-r--r--config/dnsblacklist/dnsblacklist.xml116
4 files changed, 734 insertions, 0 deletions
diff --git a/config/dnsblacklist/dnsblacklist.inc b/config/dnsblacklist/dnsblacklist.inc
new file mode 100644
index 00000000..8aa3a9e5
--- /dev/null
+++ b/config/dnsblacklist/dnsblacklist.inc
@@ -0,0 +1,143 @@
+<?php
+/* $Id$ */
+/*
+/* ========================================================================== */
+/*
+ dnsblacklist.inc
+ Copyright (C) 2009 Mark J Crane
+ All rights reserved.
+ */
+/* ========================================================================== */
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+function pkg_is_service_running($servicename)
+{
+ exec("/bin/ps ax | awk '{ print $5 }'", $psout);
+ array_shift($psout);
+ foreach($psout as $line) {
+ $ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line)))));
+ }
+ if(is_service_running($servicename, $ps) or is_process_running($servicename) ) {
+ return true;
+ }
+ else {
+ return false;
+ }
+}
+
+function byte_convert( $bytes ) {
+ if ($bytes<=0)
+ return '0 Byte';
+
+ $convention=1000; //[1000->10^x|1024->2^x]
+ $s=array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB');
+ $e=floor(log($bytes,$convention));
+ return round($bytes/pow($convention,$e),2).' '.$s[$e];
+}
+
+
+function phpservice_sync_package_php()
+{
+
+ global $config;
+
+ conf_mount_rw();
+ config_unlock();
+
+
+ conf_mount_ro();
+
+
+}
+
+
+function php_sync_package()
+{
+ global $config;
+ phpservice_sync_package_php();
+}
+
+
+function php_install_command()
+{
+
+ global $config;
+ conf_mount_rw();
+ config_lock();
+
+ if (!is_dir('/usr/local/www/packages/')) {
+ exec("mkdir /usr/local/www/packages/");
+ }
+
+ if (!is_dir('/usr/local/www/packages/dnsblacklist/')) {
+ exec("mkdir /usr/local/www/packages/dnsblacklist/");
+ }
+
+ //extract the blacklist
+ exec("cp /tmp/blacklists.tar.gz /usr/local/www/packages/dnsblacklist/blacklists.tar.gz");
+ chdir("/usr/local/www/packages/dnsblacklist/");
+ exec("tar xvf blacklists.tar.gz");
+ exec("rm /tmp/blacklists.tar.gz");
+ exec("rm /usr/local/www/packages/dnsblacklist/blacklists.tar.gz");
+
+ //rename PHP files from .tmp to .php
+ exec("cp /tmp/dnsblacklist.tmp /usr/local/www/packages/dnsblacklist/dnsblacklist.php");
+ unlink_if_exists("/tmp/phpservice_php.tmp");
+
+ //write_rcfile(array(
+ // "file" => "phpservice.sh",
+ // "start" => "/usr/local/bin/php /usr/local/pkg/phpservice.php >> /var/log/phpservice.log &",
+ // "stop" => "rm /tmp/phpmonitor.pid"
+ // )
+ //);
+
+ //php_sync_package();
+ //$handle = popen("/usr/local/etc/rc.d/phpservice.sh start", "r");
+ //pclose($handle);
+
+ //if (pkg_is_service_running('phpservice')) {
+ //documentation purposes
+ //}
+
+ conf_mount_ro();
+ config_unlock();
+
+}
+
+
+function deinstall_command()
+{
+ conf_mount_rw();
+ config_lock();
+ exec("rm -R /usr/local/www/packages/dnsblacklist/");
+
+ $handle = popen("/usr/local/etc/rc.d/dnsblacklist.sh stop", "r");
+ unlink_if_exists("/usr/local/pkg/dnsblacklist.xml");
+ unlink_if_exists("/usr/local/pkg/dnsblacklist.inc");
+ unlink_if_exists("/usr/local/etc/rc.d/dnsblacklist.sh");
+ conf_mount_ro();
+ config_unlock();
+}
+
+?> \ No newline at end of file
diff --git a/config/dnsblacklist/dnsblacklist.tmp b/config/dnsblacklist/dnsblacklist.tmp
new file mode 100644
index 00000000..6f80bc00
--- /dev/null
+++ b/config/dnsblacklist/dnsblacklist.tmp
@@ -0,0 +1,199 @@
+<?php
+
+ //Blacklist was retrieved from
+ //http://cri.univ-tlse1.fr/blacklists/index_en.php
+
+ require_once('config.inc');
+ require("guiconfig.inc");
+ include("head.inc");
+
+ //set the config as a global variable
+ global $config;
+
+ $global_usage = '/usr/local/www/packages/dnsblacklist/blacklists/global_usage';
+ $fh = fopen($global_usage, 'r');
+ while($line=fgets($fh)) {
+ $line = trim($line);
+ $line_array = explode (":", $line);
+ if (strtolower($line_array[0]) == "name") {
+ $name = trim($line_array[1]);
+ }
+ if (strtolower($line_array[0]) == "name en") {
+ $name_en = trim($line_array[1]);
+ $category[$name]['name_en'] = $name_en;
+ }
+ if (strtolower($line_array[0]) == "desc en") {
+ $desc_en = trim($line_array[1]);
+ $category[$name]['desc_en'] = $desc_en;
+ }
+
+ }
+
+ //get line count for domains list
+ function line_number ($file) {
+ $result = trim(exec("wc -l $file"));
+ $result_array = explode (" ", $result);
+ return $result_array[0];
+ }
+
+ //print_r($_POST);
+ //$x = 0;
+ //foreach($_POST['blacklist'] as $value) {
+ //$blacklist[$x]['name'] = $val;
+ //$blacklist[$value] = 'zzz';
+ //echo "\$category[\$x]['name'] = '$val';<br>";
+ //echo "\$category['$value'] = 'zzz'; <br/>\n";
+ //$x++;
+ //}
+ //unset($x);
+ //echo "<pre>";
+ //print_r($_POST["blacklist"]);
+ //echo "</pre>";
+ //foreach($_POST["blacklist"] as $key => $value) {
+ //echo "name: ".$value."<br />";
+ //$x++;
+ //}
+
+if (count($_POST)>0) {
+ $dnsmasqfile = "/usr/local/etc/dnsmasq.conf";
+ $targetfile = "/usr/local/etc/dnsmasq.blacklist.conf";
+ $includestring = "conf-file=/usr/local/etc/dnsmasq.blacklist.conf";
+ $dnsmasqconf = "/usr/local/etc/dnsmasq.conf";
+ //clear previous values
+ foreach($category as $key => $value) {
+ $config['installedpackages']['dnsblacklist']['config'][0][$key] = '';
+ }
+ if ($_POST['enable'] == 1) {
+ //echo "enabled";
+ $config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] = 1;
+ }
+ else {
+ //echo "disabled";
+ $config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] = 0;
+ }
+ //add the include entry for dnsmasq.blacklist.conf to dnsmasq.conf
+ if (file_exists($dnsmasqfile)) {
+ $getdnsmasq = file_get_contents($dnsmasqfile);
+ if(stristr($getdnsmasq,'conf-file=/usr/local/etc/dnsmasq.blacklist.conf') === TRUE) {
+ //include found no need to add it
+ }
+ else {
+ $myfhandle = fopen($dnsmasqconf, 'r+');
+ fwrite($myfhandle, $includestring);
+ fclose($myfhandle);
+ }
+ }
+ else {
+ $my2fhandle = fopen($dnsmasqconf, 'x+');
+ fwrite($my2fhandle, $includestring);
+ fclose($my2fhandle);
+ }
+ //truncate the dnsmasq.blacklist.conf file
+ if (file_exists($targetfile)) {
+ $fh = fopen($targetfile, 'w');
+ fclose($fh);
+ }
+ //build the dnsmasq.blacklist.conf
+ if (count($_POST["blacklist"]) > 0) {
+ foreach($_POST["blacklist"] as $value) {
+ //set the current selected values
+ $blackfile = "blacklists/$value/domains";
+ $config['installedpackages']['dnsblacklist']['config'][0][$value] = 1;
+ //if enabled write the selected categories to the dnsmasq.blacklist.conf
+ if ($config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] == 1) {
+ $fh2 = fopen($targetfile, 'a');
+ $fh = fopen($blackfile,'r');
+ while($line=fgets($fh)) {
+ fwrite($fh2, "address=/" .trim($line). "/74.125.45.100". "\n");
+ }
+ fclose($fh);
+ fclose($fh2);
+ }
+ }
+ }
+ write_config();
+ services_dnsmasq_configure();
+ sleep(1);
+ $savemsg_dnsb = "DNS Blacklist settings have been saved. Restart dnsmasq service under 'Status' then 'Services' to make the settings active.";
+}
+?>
+
+<?php include("fbegin.inc"); ?>
+<p class="pgtitle">Services: DNS Blacklist</p>
+<form method=POST action="">
+
+<?php
+if ($config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] == 1) {
+ echo "<input name='enable' type='checkbox' value='1' checked>\n";
+}
+else {
+ echo "<input name='enable' type='checkbox' value='1'>\n";
+}
+?>
+
+<strong>Enable DNS Blacklist</strong><br><br>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabcont" >
+<?php if ($savemsg_dnsb) print_info_box($savemsg_dnsb); ?>
+
+Below is a scroll-box filled with categories you can select to be added to your blacklist. <br><br> Each category has a list of known domains/sites that will be denied access by users of this network.
+<br><br><i>(Note: Using all categories at once will require 300Mb of free memory. The <b>adult</b> and <b>porn</b> categories are rather memory intensive, requiring 200Mb together.)</i>
+<br><br><br>
+
+
+<div style="height:340px;width:95%;overflow:scroll;">
+<?php
+
+echo "<table>\n";
+foreach($category as $key => $value) {
+ $domain_count = line_number("blacklists/$key/domains");
+ echo "<tr>\n";
+ if ($config['installedpackages']['dnsblacklist']['config'][0][$key] == 1) {
+ echo "<td><input type='checkbox' name='blacklist[]' value='$key' checked /></td>\n";
+ echo "<td><strong>".$value['name_en']."<strong></td>\n";
+ echo "<td>".$value['desc_en']."</td>\n";
+ echo "<td><i>($domain_count domains)</i></td>\n";
+ }
+ else {
+ echo "<td><input type='checkbox' name='blacklist[]' value='$key' /></td>\n";
+ echo "<td><strong>".$value['name_en']."</strong></td>\n";
+ echo "<td>".$value['desc_en']."</td>\n";
+ echo "<td><i>($domain_count domains)</i></td>\n";
+ }
+ echo "</tr>\n";
+ $x++;
+}
+echo "</table>\n";
+
+?>
+</div>
+<br />
+<br />
+<!--
+Select a category to edit:
+-->
+<?php
+////$tmp_category = array(1=> "Edit Category", );
+////$tmp_category = str_replace(" ", " ", $category);
+//echo "<SELECT name=category>\n";
+//foreach($category as $key => $value) {
+// echo "<OPTION value='".$key."'>".$key."</option>\n";
+// $x++;
+//}
+//echo "</select>\n";
+?>
+<!-- or <u>Add your own domains</u> <i>(Coming Soon)</i>
+<br />
+<br />
+-->
+
+<input type="submit" value="Save">
+</td>
+</tr>
+</table>
+</form>
+
+<?php include("fend.inc"); ?>
+
+</body>
+</html> \ No newline at end of file
diff --git a/config/dnsblacklist/dnsblacklist.tmp.old b/config/dnsblacklist/dnsblacklist.tmp.old
new file mode 100644
index 00000000..e9fadf57
--- /dev/null
+++ b/config/dnsblacklist/dnsblacklist.tmp.old
@@ -0,0 +1,276 @@
+<?php
+//http://cri.univ-tlse1.fr/blacklists/index_en.php
+
+ require_once('config.inc');
+ require("guiconfig.inc");
+ include("head.inc");
+
+ //set the config as a global variable
+ global $config;
+
+ //create a category blacklist array
+ $category['abortion'] = 'Abortion information excluding when related to religion';
+ $category['ads'] = 'Advert servers and banned URLs';
+ $category['adult'] = 'Sites containing adult material such as swearing but not porn';
+ $category['aggressive'] = 'Similar to violence but more promoting than depicting';
+ $category['antispyware'] = 'Sites that remove spyware';
+ $category['artnudes'] = 'Art sites containing artistic nudity';
+ $category['astrology'] = 'Astrology websites';
+ $category['audio-video'] = 'Sites with audio or video downloads';
+ $category['banking'] = 'Banking websites';
+ $category['beer'] = 'Sites with information on beer or liquors';
+ $category['blog'] = 'Journal/Diary websites';
+ $category['cellphones'] = 'Stuff for mobile/cell phones';
+ $category['chat'] = 'Sites with chat rooms etc';
+ $category['childcare'] = 'Sites to do with childcare';
+ //$category['cleaning'] = 'Sites to do with cleaning';
+ //$category['clothing'] = 'Sites about and selling clothing';
+ $category['contraception'] = 'Information about contraception';
+ //$category['culinary'] = 'Sites about cooking et al';
+ $category['dating'] = 'Sites about dating';
+ $category['desktopsillies'] = 'Sites containing screen savers, backgrounds, cursers, pointers, and themes';
+ $category['dialers'] = 'Sites with dialers such as those for pornography or trojans';
+ $category['drugs'] = 'Drug related sites';
+ $category['ecommerce'] = 'Sites that provide online shopping';
+ $category['entertainment'] = 'Sites that promote movies, books, magazine, humor';
+ $category['filehosting'] = 'Sites to do with filehosting';
+ //$category['frencheducation'] = 'Sites to do with french education';
+ $category['gambling'] = 'Gambling sites including stocks and shares';
+ $category['games'] = 'Game related sites';
+ //$category['gardening'] = 'Gardening sites';
+ $category['government'] = 'Military and schools etc';
+ //$category['guns'] = 'Sites with guns';
+ $category['hacking'] = 'Hacking/cracking information';
+ //$category['homerepair'] = 'Sites about home repair';
+ //$category['hygiene'] = 'Sites about hygiene and other personal grooming related stuff';
+ $category['instantmessaging'] = 'Sites that contain messenger client download and web-based messaging sites';
+ //$category['jewelry'] = 'Sites about and selling jewelry';
+ $category['jobsearch'] = 'Sites for finding jobs';
+ $category['kidstimewasting'] = 'Sites kids often waste time on';
+ $category['mail'] = 'Webmail and email sites';
+ $category['marketingware'] = 'Sites about marketing products';
+ $category['medical'] = 'Medical websites';
+ $category['mixed_adult'] = 'Mixed adult content sites';
+ $category['mobile-phone'] = 'Sites to do with mobile phones';
+ $category['naturism'] = 'Sites that contain nude pictures and/or promote a nude lifestyle';
+ $category['news'] = 'News sites';
+ $category['onlineauctions'] = 'Online auctions';
+ $category['onlinegames'] = 'Online gaming sites';
+ $category['onlinepayment'] = 'Online payment sites';
+ $category['personalfinance'] = 'Personal finance sites';
+ //$category['pets'] = 'Pet sites';
+ $category['phishing'] = 'Sites attempting to trick people into giving out private information.';
+ $category['porn'] = 'Pornography';
+ $category['proxy'] = 'Sites with proxies to bypass filters';
+ $category['radio'] = 'non-news related radio and television';
+ $category['ringtones'] = 'Sites containing ring tones, games, pictures and other';
+ $category['searchengines'] = 'Search engines such as google';
+ $category['sect'] = 'Sites about religious groups';
+ $category['sexuality'] = 'Sites dedicated to sexuality, possibly including adult material';
+ $category['shopping'] = 'Shopping sites';
+ $category['socialnetworking'] = 'Social networking websites';
+ $category['sportnews'] = 'Sport news sites';
+ $category['sports'] = 'All sport sites';
+ $category['spyware'] = 'Sites who run or have spyware software to download';
+ $category['updatesites'] = 'Sites where software updates are downloaded from including virus sigs';
+ $category['vacation'] = 'Sites about going on holiday';
+ $category['violence'] = 'Sites containing violence';
+ $category['virusinfected'] = 'Sites who host virus infected files';
+ $category['warez'] = 'Sites with illegal pirate software';
+ $category['weather'] = 'Weather news sites and weather related';
+ //$category['weapons'] = 'Sites detailing or selling weapons';
+ $category['webmail'] = 'Just webmail sites';
+
+ //get line count for domains list
+ function line_number ($file) {
+ $result = trim(exec("wc -l $file"));
+ $result_array = explode (" ", $result);
+ return $result_array[0];
+ }
+
+ //print_r($_POST);
+ //$x = 0;
+ //foreach($_POST['blacklist'] as $value) {
+ //$blacklist[$x]['name'] = $val;
+ //$blacklist[$value] = 'zzz';
+ //echo "\$category[\$x]['name'] = '$val';<br>";
+ //echo "\$category['$value'] = 'zzz'; <br/>\n";
+ //$x++;
+ //}
+ //unset($x);
+ //echo "<pre>";
+ //print_r($_POST["blacklist"]);
+ //echo "</pre>";
+ //foreach($_POST["blacklist"] as $key => $value) {
+ //echo "name: ".$value."<br />";
+ //$x++;
+ //}
+
+if (count($_POST)>0) {
+ $dnsmasqfile = "/usr/local/etc/dnsmasq.conf";
+ $targetfile = "/usr/local/etc/dnsmasq.blacklist.conf";
+ $includestring = "conf-file=/usr/local/etc/dnsmasq.blacklist.conf";
+ $dnsmasqconf = "/usr/local/etc/dnsmasq.conf";
+ //clear previous values
+ foreach($category as $key => $value) {
+ $config['installedpackages']['dnsblacklist']['config'][0][$key] = '';
+ }
+ if ($_POST['enable'] == 1) {
+ //echo "enabled";
+ $config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] = 1;
+ }
+ else {
+ //echo "disabled";
+ $config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] = 0;
+ }
+ //add the include entry for dnsmasq.blacklist.conf to dnsmasq.conf
+ if (file_exists($dnsmasqfile)) {
+ $getdnsmasq = file_get_contents($dnsmasqfile);
+ if(stristr($getdnsmasq,'conf-file=/usr/local/etc/dnsmasq.blacklist.conf') === TRUE) {
+ //include found no need to add it
+ }
+ else {
+ $myfhandle = fopen($dnsmasqconf, 'r+');
+ fwrite($myfhandle, $includestring);
+ fclose($myfhandle);
+ }
+ }
+ else {
+ $my2fhandle = fopen($dnsmasqconf, 'x+');
+ fwrite($my2fhandle, $includestring);
+ fclose($my2fhandle);
+ }
+ //truncate the dnsmasq.blacklist.conf file
+ if (file_exists($targetfile)) {
+ $fh = fopen($targetfile, 'w');
+ fclose($fh);
+ }
+ //build the dnsmasq.blacklist.conf
+ if (count($_POST["blacklist"]) > 0) {
+ foreach($_POST["blacklist"] as $value) {
+ //set the current selected values
+ $blackfile = "blacklists/$value/domains";
+ $config['installedpackages']['dnsblacklist']['config'][0][$value] = 1;
+ //if enabled write the selected categories to the dnsmasq.blacklist.conf
+ if ($config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] == 1) {
+ $fh2 = fopen($targetfile, 'a');
+ $fh = fopen($blackfile,'r');
+ while($line=fgets($fh)) {
+ fwrite($fh2, "address=/" .trim($line). "/74.125.45.100". "\n");
+ }
+ fclose($fh);
+ fclose($fh2);
+ }
+ }
+ }
+ write_config();
+ services_dnsmasq_configure();
+ sleep(1);
+ $savemsg_dnsb = "DNS Blacklist settings have been saved.";
+}
+?>
+
+<?php include("fbegin.inc"); ?>
+<p class="pgtitle">Services: DNS Blacklist</p>
+<form method=POST action="">
+
+<?php
+if ($config['installedpackages']['dnsblacklist_settings']['config'][0]['enable'] == 1) {
+ echo "<input name='enable' type='checkbox' value='1' checked>\n";
+}
+else {
+ echo "<input name='enable' type='checkbox' value='1'>\n";
+}
+?>
+
+<strong>Enable DNS Blacklist</strong><br><br>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td class="tabcont" >
+<?php if ($savemsg_dnsb) print_info_box($savemsg_dnsb); ?>
+
+Below is a scroll-box filled with categories you can select to be added to your blacklist. <br><br> Each category has a list of known domains/sites that will be denied access by users of this network.
+<br><br><i>(Note: Using all categories at once will require 300Mb of free memory. The <b>adult</b> and <b>porn</b> categories are rather memory intensive, requiring 200Mb together.)</i>
+<br><br><br>
+
+function ListFiles($dir) {
+
+ if($dh = opendir($dir)) {
+
+ $files = Array();
+ $inner_files = Array();
+
+ while($file = readdir($dh)) {
+ if($file != "." && $file != ".." && $file[0] != '.') {
+ if(is_dir($dir . "/" . $file)) {
+ array_push($files, $dir);
+ //$inner_files = ListFiles($dir . "/" . $file);
+ //if(is_array($inner_files)) $files = array_merge($files, $inner_files);
+ } else {
+ //array_push($files, $dir . "/" . $file);
+ }
+ }
+ }
+
+ closedir($dh);
+ return $files;
+ }
+}
+
+
+foreach (ListFiles('/usr/local/www/packages/dnsblacklist/') as $key=>$file){
+ echo $file ."<br />\n";
+}
+
+
+
+<div style="height:340px;width:680px;overflow:scroll;">
+<?php
+/*
+echo "<table>\n";
+foreach($category as $key => $value) {
+ $domain_count = line_number("blacklists/$key/domains");
+ //echo "name: ".$key."<br />";
+ echo "<tr>\n";
+ if ($config['installedpackages']['dnsblacklist']['config'][0][$key] == 1) {
+ // echo "<td><input type='checkbox' name='blacklist[]' value='$key' checked /></td><td><strong>$key<strong></td><td>$value</td><td><i>($domain_count domains)</i></td>\n";
+ }
+ else {
+ // echo " <td><input type='checkbox' name='blacklist[]' value='$key' /></td><td><strong>$key</strong></td><td>$value</td><td><i>($domain_count domains)</i></td>\n";
+ }
+ echo "</tr>\n";
+ $x++;
+}
+echo "</table>\n";
+*/
+?>
+</div>
+<br />
+<br />
+<!--
+Select a category to edit:
+-->
+<?php
+////$tmp_category = array(1=> "Edit Category", );
+////$tmp_category = str_replace(" ", " ", $category);
+//echo "<SELECT name=category>\n";
+//foreach($category as $key => $value) {
+// echo "<OPTION value='".$key."'>".$key."</option>\n";
+// $x++;
+//}
+//echo "</select>\n";
+?>
+<!-- or <u>Add your own domains</u> <i>(Coming Soon)</i>
+<br />
+<br />
+-->
+
+<input type="submit" value="Save">
+</td>
+</tr>
+</table>
+</form>
+
+<?php include("fend.inc"); ?>
+
+</body>
+</html> \ No newline at end of file
diff --git a/config/dnsblacklist/dnsblacklist.xml b/config/dnsblacklist/dnsblacklist.xml
new file mode 100644
index 00000000..10e330ec
--- /dev/null
+++ b/config/dnsblacklist/dnsblacklist.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
+<packagegui>
+ <copyright>
+ <![CDATA[
+/* $Id$ */
+/* ========================================================================== */
+/*
+ phpservice.xml
+ Copyright (C) 2009 Mark J Crane
+ All rights reserved.
+ */
+/* ========================================================================== */
+/*
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ */
+/* ========================================================================== */
+ ]]>
+ </copyright>
+ <description>DNS Blacklist</description>
+ <requirements>Describe your package requirements here</requirements>
+ <faq>Currently there are no FAQ items provided.</faq>
+ <name>DNS Blacklist Settings</name>
+ <version>0.1</version>
+ <title>Settings</title>
+ <include_file>/usr/local/pkg/dnsblacklist.inc</include_file>
+ <menu>
+ <name>DNSBlacklist</name>
+ <tooltiptext>PHP Service settings.</tooltiptext>
+ <section>Services</section>
+ <configfile>dnsblacklist.xml</configfile>
+ <url>/packages/dnsblacklist/dnsblacklist.php</url>
+ </menu>
+ <service>
+ <name>dnsblacklist</name>
+ <rcfile>dnsblacklist.sh</rcfile>
+ <executable>dnsblacklist</executable>
+ <description>DNS Blacklist service.</description>
+ </service>
+ <tabs>
+ <tab>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=dnsblacklist.xml&amp;id=0</url>
+ <active/>
+ </tab>
+ </tabs>
+ <configpath>installedpackages->package->$packagename->configuration->dnsblacklist</configpath>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/dnsblacklist/dnsblacklist.xml</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/dnsblacklist/dnsblacklist.inc</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/tmp/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/dnsblacklist/dnsblacklist.tmp</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/tmp/</prefix>
+ <chmod>0755</chmod>
+ <item>http://www.pfsense.com/packages/config/dnsblacklist/blacklists.tar.gz</item>
+ </additional_files_needed>
+ <fields>
+ <field>
+ <fielddescr>Variable One</fielddescr>
+ <fieldname>var1</fieldname>
+ <description>Enter the variable one here.</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Variable Two</fielddescr>
+ <fieldname>var1</fieldname>
+ <description>Enter the variable one here.</description>
+ <type>input</type>
+ </field>
+ </fields>
+ <custom_add_php_command>
+ </custom_add_php_command>
+ <custom_php_resync_config_command>
+ php_sync_package();
+ </custom_php_resync_config_command>
+ <custom_delete_php_command>
+ php_sync_package();
+ </custom_delete_php_command>
+ <custom_php_install_command>
+ php_install_command();
+ </custom_php_install_command>
+ <custom_php_deinstall_command>
+ deinstall_command();
+ </custom_php_deinstall_command>
+</packagegui> \ No newline at end of file