Welcome, Guest. Please login or register.
Did you miss your activation email?
Tuesday 24 December 2024, 08:44:07 am

Login with username, password and session length

Visit the Official Endian Bug tracker  HERE
14262 Posts in 4377 Topics by 6517 Members
Latest Member: Sandro
Search:     Advanced search
+  EFW Support
|-+  Support
| |-+  General Support
| | |-+  Show blocked category
0 Members and 2 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Show blocked category  (Read 22645 times)
zizoux
Jr. Member
*
Offline Offline

Posts: 7


« on: Tuesday 07 February 2012, 12:53:47 am »

Hi,
how can we display the blocked category if we are using the community edition 2.5.1?

Thanks
Logged
endianupdate
Full Member
***
Offline Offline

Posts: 53


« Reply #1 on: Wednesday 08 February 2012, 09:23:38 am »

Do you mean display the blocked category on the 'Access Denied' page that EFW displays ?

To do this will require some editing of files, you cannot do this from the web interface

I have changed my 'Access Denied' page to display :

Code:
Access to the page:
http://www.xxxxx.com.

... has been denied for the following reason:

Banned phrase found.

... in category:

Google Searches

Note the extra . at the end of the page url ! this is my secret bypass link  Smiley

To do this I have ;

edit the /usr/share/dansguardian/languages/ukenglish/template.html file

you will need to add the following line to the Body section after the line : Bypass: -BYPASS-

Category: -CATEGORIES-

then edit your message page

Code:
Access to the page:
<P>
<strong><a href="-URL-">-URL-</a><a href="-BYPASS-">.</a></strong>
<P> ... has been denied for the following reason: <P>
<strong><font color="#000000">-REASONGIVEN-</font></strong>
<p>
<P> ... in category: <P>
<strong><font color="#000000">-CATEGORIES-</font></strong>

To get the bypass link to work you will need to edit the /etc/dansguardian/dansguardianf?.conf.tmpl where the ? is the filterlist profile number, for the default profile this will be 1 so dansguardianf1.conf.tmpl

change the line 'bypass = 0' to 'bypass = 300' for a 5 minute bypass link, note that this is not password protected so anyone who knows about your secret bypass link can use it   Cry

Hope this helps

Edit : Sorry forgot to mention that sometimes the Category will display : N/A as it is not known which category the page is in (could be in multiple black lists).

Logged
zizoux
Jr. Member
*
Offline Offline

Posts: 7


« Reply #2 on: Wednesday 08 February 2012, 10:33:43 pm »

Thanks it works but lot of "N/A"
Logged
endianupdate
Full Member
***
Offline Offline

Posts: 53


« Reply #3 on: Thursday 09 February 2012, 04:20:06 am »

Yes the problem is that the listcategory is not defined in the DansGuardian blacklists in /var/signatures/dansguardian/blacklists/<blacklist name>/domains files and adding a listcategory to the domain file gets overwritten when DansGuardian updates the rules.

I have written a shell script to look at the filter categories defined in your Default Profile (content1) filterlist and then update the listcategory for each of them.

To get this working ;

create a new file 'filterlistupdate' and copy in the code below;

Code:
#!/bin/sh
cat /etc/dansguardian/profiles/1/bannedsitelist | grep -v '#' | grep -v 'old' | grep 'Include' | grep 'blacklists' | cut -d '/' -f 6-7 | sed 's/>$//' | while read category; do
echo '#listcategory: "'$category'"' > /var/signatures/dansguardian/blacklists/$category.new
cat /var/signatures/dansguardian/blacklists/$category | grep -v '#' >> /var/signatures/dansguardian/blacklists/$category.new
mv -f /var/signatures/dansguardian/blacklists/$category.new /var/signatures/dansguardian/blacklists/$category
done
exit 0

As you can see this looks at the URL blacklist categories that you have selected in the content1 profile and adds the listcategory to the blacklist so you should not get many N/A categories any more.

I have put my shell script in /etc/cron.hourly and made it executable (-rwxr-xr-x ) so even if DansGuardian updates its blacklists within an hour the listcategories will be added.

This has been tested by me but please make backups before using my code, just in case  Wink

Hope this helps.

Edit : You will need to restart the proxy after the script has run for the first time, otherwise the categories will not be displayed.
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Page created in 0.094 seconds with 18 queries.
Powered by SMF 1.1 RC2 | SMF © 2001-2005, Lewis Media Design by 7dana.com