89,7 → 89,7 |
$l_rehabilitated_ip_explain="Entrez ici des IP bloquées par la liste noire <BR> que vous souhaitez réhabiliter."; |
$l_one_dns="Entrez une adresse DNS par ligne (exemple : www.domaine.com)"; |
$l_one_ip="Entrez une IP par ligne (exemple : 123.123.123.123)"; |
$l_one_dns_ip="Entrez un nom de domaine ou une adresse IP ou une adresse de réseau par ligne<br>exemple (domaine) : .domaine.org - exemple (ip) : 61.54.52.56 - exemple (réseau) : 172.16.0.0/16"; |
$l_one_dns_ip="Entrez un nom de domaine ou une adresse IP ou une adresse de réseau par ligne<br>exemple (domaine) : domaine.org. - exemple (ip) : 61.54.52.56 - exemple (réseau) : 172.16.0.0/16"; |
$l_record="Enregistrer les modifications"; |
$l_wait="Une fois validées, 10 secondes sont nécessaires pour traiter vos modifications"; |
$l_ip_filtering="Filtrer les URLs contenant une adresse IP au lieu d'un nom de domaine (ex: http://25.56.58.59/index.htm)"; |
133,9 → 133,9 |
$l_add_to_bl="Domain names or IP addresses to add to the blacklist"; |
$l_rehabilitated_ip="IP addresses to rehabilitated"; |
$l_rehabilitated_ip_explain="Enter here IP that are blocked by the blacklist <BR> and you want to rehabilitate."; |
$l_one_dns="Enter one DNS per row (example : www.domaine.com)"; |
$l_one_dns="Enter one DNS per row (example : www.domain.com)"; |
$l_one_ip="Enter one IP per row (example : 123.123.123.123)"; |
$l_one_dns_ip="Enter one domain name or one IP address or one network address per row <br>example (domain): .domain.org - example (ip): 61.54.56.52 - example (network) : 172.16.0.0/16"; |
$l_one_dns_ip="Enter one domain name or one IP address or one network address per row <br>example (domain): domain.org. - example (ip): 61.54.56.52 - example (network) : 172.16.0.0/16"; |
$l_record="Save changes"; |
$l_wait="Once validated, 10 seconds are necessary to compute your modifications"; |
$l_ip_filtering="Filtering URLs that contain an IP address instead of a domain name (ie: http://25.56.58.59/index.htm)"; |
165,16 → 165,18 |
$dir_blacklist=$dir_dg."blacklists/"; |
$dir_bl_ip="/usr/local/share/iptables-bl/"; |
$dir_bl_ip_enabled="/usr/local/share/iptables-bl-enabled/"; |
$dir_bl_domain_names="/usr/local/share/dnsmasq-bl/"; |
$dir_bl_domain_names_enabled="/usr/local/share/dnsmasq-bl-enabled/"; |
$dir_bl_domain_names="/usr/local/share/unbound-bl/"; |
$dir_bl_domain_names_enabled="/usr/local/share/unbound-bl-enabled/"; |
$bl_categories=$dir_etc."alcasar-bl-categories"; |
$bl_categories_enabled=$dir_etc."alcasar-bl-categories-enabled"; |
$conf_file=$dir_etc."alcasar.conf"; |
$urlregex_file=$dir_dg."urlregexplist"; |
$domainfilter_file="/etc/unbound/conf.d/blacklist/domainfilter.conf"; |
$bannedsite_file=$dir_dg."bannedsitelist"; |
$dir_tmp="/tmp/blacklists"; |
$update_file_cat="/usr/local/etc/update_cat.conf"; |
|
$bl_safesearch="off"; |
$bl_pureip="off"; |
|
# default values |
if (is_file ($conf_file)) |
185,15 → 187,28 |
foreach ($tab as $line) |
{ |
$field=explode("=", $line); |
if ($field[0] == "PRIVATE_IP") |
{ |
switch ($field[0]) { |
case 'PRIVATE_IP': |
$PRIVATE_IP_MASK=trim($field[1]); |
$tmp = explode("/",$PRIVATE_IP_MASK); |
$PRIVATE_IP=$tmp[0]; |
break; |
|
case 'BL_SAFESEARCH': |
if (strtolower(trim($field[1])) == 'on') { |
$bl_safesearch='on'; |
} |
break; |
|
case 'BL_PUREIP': |
if (strtolower(trim($field[1])) == 'on') { |
$bl_pureip='on'; |
} |
break; |
} |
} |
} |
} |
else { echo "$l_error_open_file $conf_file";} |
if (isset($_POST['choix'])){ $choix=$_POST['choix']; } else { $choix=""; } |
switch ($choix) |
245,13 → 260,14 |
exec ("sudo /usr/local/bin/alcasar-bl.sh --reload"); |
break; |
case 'Specific_filtering' : |
$pureip="-pureip_off"; $safesearch="-safesearch_off"; ; |
$bl_pureip='off'; |
$bl_safesearch='off'; |
foreach ($_POST as $key => $value) |
{ |
if (strstr($key,'chk-ip')) $pureip="-pureip_on"; |
if (strstr($key,'chk-safesearch')) $safesearch="-safesearch_on"; |
if (strstr($key,'chk-ip')) $bl_pureip="on"; |
if (strstr($key,'chk-safesearch')) $bl_safesearch="on"; |
} |
exec ("sudo /usr/local/bin/alcasar-url_filter_bl.sh $safesearch $pureip"); |
exec ("sudo /usr/local/bin/alcasar-url_filter_bl.sh -safesearch_$bl_safesearch -pureip_$bl_pureip"); |
break; |
case 'MAJ_ossi_file' : |
foreach($_POST as $fichier => $value) |
342,7 → 358,7 |
<?php |
echo "<center>"; |
// total number of IP, DNS & URLs |
$nbDomainNames = exec("wc -l /usr/local/share/dnsmasq-bl/* | tail -n 1 | awk '{print $1}'"); |
$nbDomainNames = exec("wc -l /usr/local/share/unbound-bl/* | tail -n 1 | awk '{print $1}'") / 2; |
$nbUrl = exec("for file in `find /etc/e2guardian/lists/blacklists/ -name 'urls'`; do nb=$((nb+$(wc -l \$file | awk '{print $1}'))); done; echo \$nb"); |
$nbIp = exec("wc -l /usr/local/share/iptables-bl/* | tail -n 1 | awk '{print $1}'"); |
echo "<b>$l_nbDomainNames</b> $nbDomainNames, <b>$l_nbUrl</b> $nbUrl, <b>$l_nbIp</b> $nbIp<br/>"; |
366,9 → 382,10 |
$cols++; |
if ($cols > 10) { |
echo "</tr>\n"; |
$cols=1; } |
$cols=1; |
} |
} |
} |
else { |
echo "$l_error_open_file $bl_categories"; |
} |
451,59 → 468,14 |
<input type='hidden' name='choix' value='Specific_filtering'> |
<table width="100%" border=1 cellspacing=0 cellpadding=1> |
<tr><td> |
<input type='checkbox' name='chk-ip' |
<?php |
// verify "pureip" filtering state |
if (file_exists($bannedsite_file)) |
{ |
$pointeur=fopen($bannedsite_file,"r"); |
while (!feof ($pointeur)) |
{ |
$ligne=fgets($pointeur, 4096); |
if ($ligne) |
{ |
if (preg_match('/^\*ip$/',$ligne, $r)) |
{ |
echo " checked"; |
break; |
} |
} |
} |
fclose($pointeur); |
} |
else { |
echo "$l_error_open_file $bannedsite_file"; |
} |
echo "> $l_ip_filtering"; |
?> |
<input type='checkbox' name='chk-ip' <?= $bl_pureip == 'on' ? 'checked' : ''; ?>><?= $l_ip_filtering; ?> |
</td></tr> |
<tr><td> |
<input type='checkbox' name='chk-safesearch' |
<?php |
// verify "safesearch" filtering state |
if (file_exists($urlregex_file)) |
{ |
$pointeur=fopen($urlregex_file,"r"); |
while (!feof ($pointeur)) |
{ |
$ligne=fgets($pointeur, 4096); |
if ($ligne) |
{ |
if (preg_match('/^\"\(\^http\:\/\/\[0\-9a\-z\]\+\\\.google/',$ligne, $r)) |
{ |
echo " checked"; |
break; |
} |
} |
} |
fclose($pointeur); |
} |
else { |
echo "$l_error_open_file $urlregex_file"; |
} |
echo "> $l_safe_searching<tr><td>"; |
echo "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_record'></td></tr>"; |
?> |
<input type='checkbox' name='chk-safesearch' <?= $bl_safesearch == 'on' ? 'checked' : ''; ?>><?= $l_safe_searching; ?> |
</tr></td> |
<tr><td> |
<?= "<input type='submit' onClick=\"this.disabled=true; this.value='$l_load';submit();\" value='$l_record'>"; ?> |
</td></tr> |
</table> |
</form> |
</BODY> |