1 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
3 File : $Source: /cvsroot/ijbswa/current/doc/source/user-manual.sgml,v $
7 ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/
9 $Id: user-manual.sgml,v 1.48 2002/03/12 06:33:01 hal9 Exp $
11 Written by and Copyright (C) 2001 the SourceForge
12 IJBSWA team. http://ijbswa.sourceforge.net
14 Based on the Internet Junkbuster originally written
15 by and Copyright (C) 1997 Anonymous Coders and
16 Junkbusters Corporation. http://www.junkbusters.com
20 Sat 03/02/02 04:53:47 PM
22 This should be ready for BETA release.
24 Hal Burgiss <hal@foobox.net>
29 <title>Junkbuster User Manual</title>
31 <pubdate>$Id: user-manual.sgml,v 1.48 2002/03/12 06:33:01 hal9 Exp $</pubdate>
36 <orgname>By: Junkbuster Developers</orgname>
43 The user manual gives users information on how to install, configure and use
44 <application>Internet Junkbuster</application>. <application>Internet
45 Junkbuster</application> is a web proxy with advanced filtering capabilities
46 for protecting privacy, filtering web page content, managing cookies,
47 controlling access, and removing ads, banners, pop-ups and other obnoxious
48 Internet Junk. Junkbuster has a very flexible configuration and can be
49 customized to suit individual needs and tastes. <application>Internet
50 Junkbuster</application> has application for both stand-alone systems and
54 You can find the latest version of the user manual at <ulink url="http://ijbswa.sourceforge.net/user-manual/">http://ijbswa.sourceforge.net/user-manual/</ulink>.
58 <!-- Feel free to send a note to the developers at <email>ijbswa-developers@lists.sourceforge.net</email>. -->
65 <!-- ~~~~~ New section ~~~~~ -->
67 <sect1 id="introduction"><title>Introduction</title>
69 <application>Internet Junkbuster</application> is a web proxy with advanced
70 filtering capabilities for protecting privacy, filtering and modifying web
71 page content, managing cookies, controlling access, and removing ads,
72 banners, pop-ups and other obnoxious Internet Junk.
73 <application>Junkbuster</application> has a very flexible configuration and
74 can be customized to suit individual needs and tastes. <application>Internet
75 Junkbuster</application> has application for both stand-alone systems and
80 This documentation is included with the current BETA version of
81 <application>Internet Junkbuster</application> and is mostly complete at this
82 point. The most up to date reference for the time being is still the comments
83 in the source files and in the individual configuration files. Development
84 of version 3.0 is currently nearing completion, and includes many significant
85 changes and enhancements over earlier versions. The target release date for
86 stable v3.0 is <quote>soon</quote> ;-)
90 Since this is a BETA version, not all new features are well tested. This
91 documentation may be slightly out of sync as a result (especially with
92 CVS sources). And there <emphasis>may be</emphasis> bugs, though hopefully
97 <!-- ~~~~~ New section ~~~~~ -->
99 <title>New Features</title>
101 In addition to <application>Junkbuster's</application> traditional features
102 of ad and banner blocking and cookie management, this is a list of new
103 features currently under development:
107 The section is in both user-manual and faq. Please keep in sync.
114 Integrated browser based configuration and control utility (<ulink
115 url="http://i.j.b">http://i.j.b</ulink>). Browser-based tracing of rule
122 Modularized configuration that will allow for system wide settings, and
123 individual user settings. (not implemented yet, probably a 3.1 feature)
129 Blocking of annoying pop-up browser windows.
135 HTTP/1.1 compliant (most, but not all 1.1 features are supported).
141 Support for Perl Compatible Regular Expressions in the configuration files, and
142 generally a more sophisticated and flexible configuration syntax over
155 Web page content filtering (removes banners based on size,
156 invisible <quote>web-bugs</quote>, JavaScript, pop-ups, status bar abuse,
163 Bypass many click-tracking scripts (avoids script redirection).
170 Multi-threaded (POSIX and native threads).
176 Auto-detection and re-reading of config file changes.
182 User-customizable HTML templates (e.g. 404 error page).
188 Improved cookie management features (e.g. session based cookies).
194 Builds from source on most UNIX-like systems. Packages available for: Linux
195 (RedHat, SuSE, or Debian), Windows, Sun Solaris, Mac OSX, OS/2, HP-UX 11 and AmigaOS.
202 In addition, the configuration is much more powerful and versatile over-all.
213 <!-- ~ End section ~ -->
216 <!-- ~~~~~ New section ~~~~~ -->
217 <sect1 id="installation"><title>Installation</title>
219 <application>Junkbuster</application> is available as raw source code, or
220 pre-compiled binaries. See the <ulink
221 url="http://sourceforge.net/projects/ijbswa/">Junkbuster Home Page</ulink>
222 for binaries and current release info. <application>Junkbuster</application>
223 is also available via <ulink
224 url="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ijbswa/current/">CVS</ulink>.
225 This is the recommended approach at this time. But please be aware that CVS
226 is constantly changing, and it may break in mysterious ways.
229 <!-- ~~~~~ New section ~~~~~ -->
230 <sect2 id="installation-source"><title>Source</title>
232 For gzipped tar archives, unpack the source:
237 tar xzvf ijb_source_* [.tgz or .tar.gz]
238 cd ijb_source_2.9.11_beta
243 For retrieving the current CVS sources, you'll need the CVS
244 package installed first. To download CVS source:
249 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
250 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co current
256 This will create a directory named <filename>current/</filename>, which will
257 contain the source tree.
261 Then, in either case, to build from tarball/CVS source:
266 ./configure (--help to see options)
267 make (the make from gnu, gmake for *BSD)
269 make -n install (to see where all the files will go)
270 make install (to really install)
275 For Redhat and SuSE Linux RPM packages, see below.
281 <!-- ~~~~~ New section ~~~~~ -->
282 <sect2 id="installation-rh"><title>Red Hat</title>
284 To build Redhat RPM packages, install source as above. Then:
289 autoheader [suggested for CVS source]
290 autoconf [suggested for CVS source]
297 This will create both binary and src RPMs in the usual places. Example:
301 /usr/src/redhat/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
304 /usr/src/redhat/SRPMS/junkbuster-2.9.11-1.src.rpm
308 To install, of course:
313 rpm -Uvv /usr/src/redhat/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
318 This will place the <application>Junkbuster</application> configuration
319 files in <filename>/etc/junkbuster/</filename>, and log files in
320 <filename>/var/log/junkbuster/</filename>.
325 <!-- ~~~~~ New section ~~~~~ -->
326 <sect2 id="installation-suse"><title>SuSE</title>
328 To build SuSE RPM packages, install source as above. Then:
333 autoheader [suggested for CVS source]
334 autoconf [suggested for CVS source]
341 This will create both binary and src RPMs in the usual places. Example:
345 /usr/src/packages/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
348 /usr/src/packages/SRPMS/junkbuster-2.9.11-1.src.rpm
352 To install, of course:
357 rpm -Uvv /usr/src/packages/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
362 This will place the <application>Junkbuster</application> configuration
363 files in <filename>/etc/junkbuster/</filename>, and log files in
364 <filename>/var/log/junkbuster/</filename>.
370 <!-- ~~~~~ New section ~~~~~ -->
371 <sect2 id="installation-os2"><title>OS/2</title>
378 <application>Junkbuster</application> is packaged in a WarpIN self-
379 installing archive. The self-installing program will be named depending
380 on the release version, something like:
381 <filename>ijbos2_setup_1.2.3.exe</filename>. In order to install it, simply
382 run this executable or double-click on its icon and follow the WarpIN
383 installation panels. A shadow of the <application>Junkbuster</application>
384 executable will be placed in your startup folder so it will start
385 automatically whenever OS/2 starts.
389 The directory you choose to install <application>Junkbuster</application>
390 into will contain all of the configuration files.
394 If you would like to build binary images on OS/2 yourself, you will need
395 a few Unix-like tools: autoconf, autoheader and sh. These tools will be
396 used to create the required config.h file, which is not part of the
397 source distribution because it differs based on platform. You will also
399 The distribution has been created using IBM VisualAge compilers, but you
400 can use any compiler you like. GCC/EMX has the disadvantage of needing
401 to be single-threaded due to a limitation of EMX's implementation of the
402 select() socket call.
406 In addition to needing the source code distribution as outlined earlier,
407 you will want to extract the <filename>os2seutp</filename> directory from CVS:
409 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
410 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co os2setup
412 This will create a directory named os2setup/, which will contain the
413 <filename>Makefile.vac</filename> makefile and <filename>os2build.cmd</filename>
414 which is used to completely create the binary distribution. The sequence
415 of events for building the executable for yourself goes something like this:
422 nmake -f Makefile.vac
424 You will see this sequence laid out in <filename>os2build.cmd</filename>.
430 <!-- ~~~~~ New section ~~~~~ -->
431 <sect2 id="installation-win"><title>Windows</title>
432 <para>Click-click. (I need help on this. Not a clue here. Also for
433 configuration section below. HB.)
437 <!-- ~~~~~ New section ~~~~~ -->
438 <sect2 id="installation-other"><title>Other</title>
440 Some quick notes on other Operating Systems.
444 For FreeBSD (and other *BSDs?), the build will require <command>gmake</command>
445 instead of the included <command>make</command>. <command>gmake</command> is
446 available from <ulink url="http://www.gnu.org">http://www.gnu.org</ulink>.
447 The rest should be the same as above for Linux/Unix.
454 <!-- ~ End section ~ -->
457 <!-- ~~~~~ New section ~~~~~ -->
458 <sect1 id="configuration"><title>JunkBuster Configuration</title>
460 All <application>JunkBuster</application> configuration is kept
461 in text files. These files can be edited with a text editor.
462 Many important aspects of <application>JunkBuster</application> can
463 also be controlled easily with a web browser.
468 <!-- ~~~~~ New section ~~~~~ -->
471 <title>Controlling Junkbuster with Your Web Browser</title>
473 <application>JunkBuster</application> can be reached by the special
474 URL <ulink url="http://i.j.b/">http://i.j.b/</ulink> (or alternately
475 <ulink url="http://ijbswa.sourceforge.net/config/">http://ijbswa.sourceforge.net/config/</ulink>),
476 which is an internal page. You will see the following section:
483 Please choose from the following options:
485 * Show information about the current configuration
486 * Show the source code version numbers
487 * Show the client's request headers.
488 * Show which actions apply to a URL and why
489 * Toggle JunkBuster on or off
490 * Edit the actions list
496 This should be self-explanatory. Note the last item is an editor for the
497 <quote>actions list</quote>, which is where much of the ad, banner, cookie,
498 and URL blocking magic is configured as well as other advanced features of
499 <application>Junkbuster</application>. This is an easy way to adjust various
500 aspects of <application>Junkbuster</application> configuration. The actions
501 file, and other configuration files, are explained in detail below.
502 <application>Junkbuster</application> will automatically detect any changes
507 <quote>Toggle JunkBuster On or Off</quote> is handy for sites that might
508 have problems with your current actions and filters, or just to test if
509 a site misbehaves, whether it is <application>JunkBuster</application>
510 causing the problem or not. <application>Junkbuster</application> continues
511 to run as a proxy in this case, but all filtering is disabled.
517 <!-- ~ End section ~ -->
522 <!-- ~~~~~ New section ~~~~~ -->
525 <title>Configuration Files Overview</title>
527 For Unix, *BSD and Linux, all configuration files are located in
528 <filename>/etc/junkbuster/</filename> by default. For MS Windows, OS/2, and
529 AmigaOS these are all in the same directory as the
530 <application>Junkbuster</application> executable. The name and number of
531 configuration files has changed from previous versions, and is subject to
532 change as development progresses.
536 The installed defaults provide a reasonable starting point, though possibly
537 aggressive by some standards. For the time being, there are only three
538 default configuration files (this will change in time):
546 The main configuration file is named <filename>config</filename>
547 on Linux, Unix, BSD, OS/2, and AmigaOS and <filename>config.txt</filename>
554 The <filename>ijb.action</filename> file is used to define various
555 <quote>actions</quote> relating to images, banners, pop-ups, access
556 restrictions, banners and cookies. There is a CGI based editor for this
557 file that can be accessed via <ulink
558 url="http://i.j.b">http://i.j.b</ulink>. (Other actions
559 files are included as well with differing levels of filtering
560 and blocking, e.g. <filename>ijb-basic.action</filename>.)
566 The <filename>re_filterfile</filename> file can be used to re-write the raw
567 page content, including viewable text as well as embedded HTML and JavaScript,
568 and whatever else lurks on any given web page.
576 <filename>ijb.action</filename> and <filename>re_filterfile</filename>
577 can use Perl style regular expressions for maximum flexibility. All files use
578 the <quote><literal>#</literal></quote> character to denote a comment. Such
579 lines are not processed by <application>Junkbuster</application>. After
580 making any changes, there is no need to restart
581 <application>Junkbuster</application> in order for the changes to take
582 effect. <application>Junkbuster</application> should detect such changes
587 While under development, the configuration content is subject to change.
588 The below documentation may not be accurate by the time you read this.
589 Also, what constitutes a <quote>default</quote> setting, may change, so
590 please check all your configuration files on important issues.
595 <!-- ~~~~~ New section ~~~~~ -->
598 <title>The Main Configuration File</title>
600 Again, the main configuration file is named <filename>config</filename> on
601 Linux/Unix/BSD and OS/2, and <filename>config.txt</filename> on Windows.
602 Configuration lines consist of an initial keyword followed by a list of
603 values, all separated by whitespace (any number of spaces or tabs). For
611 <emphasis>blockfile blocklist.ini</emphasis>
618 Indicates that the blockfile is named <quote>blocklist.ini</quote>. (A
619 default installation does not use this.)
623 A <quote><literal>#</literal></quote> indicates a comment. Any part of a
624 line following a <quote><literal>#</literal></quote> is ignored, except if
625 the <quote><literal>#</literal></quote> is preceded by a
626 <quote><literal>\</literal></quote>.
630 Thus, by placing a <quote><literal>#</literal></quote> at the start of an
631 existing configuration line, you can make it a comment and it will be treated
632 as if it weren't there. This is called <quote>commenting out</quote> an
633 option and can be useful to turn off features: If you comment out the
634 <quote>logfile</quote> line, <application>junkbuster</application> will not
635 log to a file at all. Watch for the <quote>default:</quote> section in each
636 explanation to see what happens if the option is left unset (or commented
641 Long lines can be continued on the next line by using a
642 <quote><literal>\</literal></quote> as the very last character.
646 There are various aspects of <application>Junkbuster</application> behavior
651 <!-- ~~~~~ New section ~~~~~ -->
654 <title>Defining Other Configuration Files</title>
657 <application>Junkbuster</application> can use a number of other files to tell it
658 what ads to block, what cookies to accept, etc. This section of the
659 configuration file tells <application>Junkbuster</application> where to find
660 all those other files.
664 On <application>Windows</application> and <application>AmigaOS</application>,
665 <application>Junkbuster</application> looks for these files in the same
666 directory as the executable. On Unix and OS/2,
667 <application>Junkbuster</application> looks for these files in the current
668 working directory. In either case, an absolute path name can be used to
673 When development goes modular and multi-user, the blocker, filter, and
674 per-user config will be stored in subdirectories of <quote>confdir</quote>.
675 For now, only <filename>confdir/templates</filename> is used for storing HTML
676 templates for CGI results.
680 The location of the configuration files:
687 <emphasis>confdir /etc/junkbuster</emphasis> # No trailing /, please.
694 The directory where all logging (i.e. <filename>logfile</filename> and
695 <filename>jarfile</filename>) takes place. No trailing
696 <quote><literal>/</literal></quote>, please:
703 <emphasis>logdir /var/log/junkbuster</emphasis>
710 Note that all file specifications below are relative to
711 the above two directories!
715 The <quote>ijb.action</quote> file contains patterns to specify the actions to
716 apply to requests for each site. Default: Cookies to and from all
717 destinations are kept only during the current browser session (i.e. they
718 are not saved to disk). Pop-ups are disabled for all sites. All sites are
719 filtered through selected sections of <quote>re_filterfile</quote>. No sites
720 are blocked. The JunkBuster logo is displayed for filtered ads and other
721 images. The syntax of this file is explained in detail <link
722 linkend="actionsfile">below</link>. Other <quote>actions</quote> files
723 are included, and you are free to use any of them. They have varying
724 degrees of aggressiveness.
731 <emphasis>actionsfile ijb.action</emphasis>
738 The <quote>re_filterfile</quote> file contains content modification rules
739 that use <quote>regular expressions</quote>. These rules permit powerful
740 changes on the content of Web pages, e.g., you could disable your favorite
741 JavaScript annoyances, re-write the actual displayed text, or just have some
742 fun replacing <quote>Microsoft</quote> with <quote>MicroSuck</quote> wherever
743 it appears on a Web page. Default: whatever the developers are playing with
748 Filtering requires buffering the page content, which may appear to slow down
749 page rendering since nothing is displayed until all content has passed
750 the filters. (It does not really take longer, but seems that way since
751 the page is not incrementally displayed.) This effect will be more noticeable
752 on slower connections.
760 <emphasis>re_filterfile re_filterfile</emphasis>
767 The logfile is where all logging and error messages are written. The logfile
768 can be useful for tracking down a problem with
769 <application>Junkbuster</application> (e.g., it's not blocking an ad you
770 think it should block) but in most cases you probably will never look at it.
774 Your logfile will grow indefinitely, and you will probably want to
775 periodically remove it. On Unix systems, you can do this with a cron job
776 (see <quote>man cron</quote>). For Redhat, a <command>logrotate</command>
777 script has been included.
781 On SuSE Linux systems, you can place a line like <quote>/var/log/junkbuster.*
782 +1024k 644 nobody.nogroup</quote> in <filename>/etc/logfiles</filename>, with
783 the effect that cron.daily will automatically archive, gzip, and empty the
784 log, when it exceeds 1M size.
788 Default: Log to the a file named <filename>logfile</filename>.
789 Comment out to disable logging.
796 <emphasis>logfile logfile</emphasis>
803 The <quote>jarfile</quote> defines where
804 <application>Junkbuster</application> stores the cookies it intercepts. Note
805 that if you use a <quote>jarfile</quote>, it may grow quite large. Default:
806 Don't store intercepted cookies.
813 <emphasis>#jarfile jarfile</emphasis>
820 If you specify a <quote>trustfile</quote>,
821 <application>Junkbuster</application> will only allow access to sites that
822 are named in the trustfile. You can also mark sites as trusted referrers,
823 with the effect that access to untrusted sites will be granted, if a link
824 from a trusted referrer was used. The link target will then be added to the
825 <quote>trustfile</quote>. This is a very restrictive feature that typical
826 users most probably want to leave disabled. Default: Disabled, don't use the
834 <emphasis>#trustfile trust</emphasis>
841 If you use the trust mechanism, it is a good idea to write up some on-line
842 documentation about your blocking policy and to specify the URL(s) here. They
843 will appear on the page that your users receive when they try to access
844 untrusted content. Use multiple times for multiple URLs. Default: Don't
845 display links on the <quote>untrusted</quote> info page.
852 <emphasis>trust-info-url http://www.your-site.com/why_we_block.html</emphasis>
853 <emphasis>trust-info-url http://www.your-site.com/what_we_allow.html</emphasis>
861 <!-- ~ End section ~ -->
865 <!-- ~~~~~ New section ~~~~~ -->
868 <title>Other Configuration Options</title>
871 This part of the configuration file contains options that control how
872 <application>Junkbuster</application> operates.
876 <quote>Admin-address</quote> should be set to the email address of the proxy
877 administrator. It is used in many of the proxy-generated pages. Default:
885 <emphasis>#admin-address fill@me.in.please</emphasis>
892 <quote>Proxy-info-url</quote> can be set to a URL that contains more info
893 about this <application>Junkbuster</application> installation, it's
894 configuration and policies. It is used in many of the proxy-generated pages
895 and its use is highly recommended in multi-user installations, since your
896 users will want to know why certain content is blocked or modified. Default:
897 Don't show a link to on-line documentation.
904 <emphasis>proxy-info-url http://www.your-site.com/proxy.html</emphasis>
911 <quote>Listen-address</quote> specifies the address and port where
912 <application>Junkbuster</application> will listen for connections from your
913 Web browser. The default is to listen on the localhost port 8118, and
914 this is suitable for most users. (In your web browser, under proxy
915 configuration, list the proxy server as <quote>localhost</quote> and the
916 port as <quote>8118</quote>).
920 If you already have another service running on port 8118, or if you want to
921 serve requests from other machines (e.g. on your local network) as well, you
922 will need to override the default. The syntax is
923 <quote>listen-address [<ip-address>]:<port></quote>. If you leave
924 out the IP address, <application>junkbuster</application> will bind to all
925 interfaces (addresses) on your machine and may become reachable from the
926 Internet. In that case, consider using access control lists (acl's) (see
927 <quote>aclfile</quote> above), or a firewall.
931 For example, suppose you are running <application>Junkbuster</application> on
932 a machine which has the address 192.168.0.1 on your local private network
933 (192.168.0.0) and has another outside connection with a different address.
934 You want it to serve requests from inside only:
941 <emphasis>listen-address 192.168.0.1:8118</emphasis>
948 If you want it to listen on all addresses (including the outside
956 <emphasis>listen-address :8118</emphasis>
963 If you do this, consider using ACLs (see <quote>aclfile</quote> above). Note:
964 you will need to point your browser(s) to the address and port that you have
965 configured here. Default: localhost:8118 (127.0.0.1:8118).
969 The debug option sets the level of debugging information to log in the
970 logfile (and to the console in the Windows version). A debug level of 1 is
971 informative because it will show you each request as it happens. Higher
972 levels of debug are probably only of interest to developers.
979 debug 1 # GPC = show each GET/POST/CONNECT request
980 debug 2 # CONN = show each connection status
981 debug 4 # IO = show I/O status
982 debug 8 # HDR = show header parsing
983 debug 16 # LOG = log all data into the logfile
984 debug 32 # FRC = debug force feature
985 debug 64 # REF = debug regular expression filter
986 debug 128 # = debug fast redirects
987 debug 256 # = debug GIF de-animation
988 debug 512 # CLF = Common Log Format
989 debug 1024 # = debug kill pop-ups
990 debug 4096 # INFO = Startup banner and warnings.
991 debug 8192 # ERROR = Non-fatal errors
998 It is <emphasis>highly recommended</emphasis> that you enable ERROR
999 reporting (debug 8192), at least until v3.0 is released.
1003 The reporting of FATAL errors (i.e. ones which crash
1004 <application>JunkBuster</application>) is always on and cannot be disabled.
1008 If you want to use CLF (Common Log Format), you should set <quote>debug
1009 512</quote> ONLY, do not enable anything else.
1013 Multiple <quote>debug</quote> directives, are OK - they're logical-OR'd
1021 <emphasis>debug 15 # same as setting the first 4 listed above</emphasis>
1035 <emphasis>debug 1 # URLs</emphasis>
1036 <emphasis>debug 4096 # Info</emphasis>
1037 <emphasis>debug 8192 # Errors - *we highly recommended enabling this*</emphasis>
1044 <application>Junkbuster</application> normally uses
1045 <quote>multi-threading</quote>, a software technique that permits it to
1046 handle many different requests simultaneously. In some cases you may wish to
1047 disable this -- particularly if you're trying to debug a problem. The
1048 <quote>single-threaded</quote> option forces
1049 <application>Junkbuster</application> to handle requests sequentially.
1050 Default: Multi-threaded mode.
1057 <emphasis>#single-threaded</emphasis>
1064 <quote>toggle</quote> allows you to temporarily disable all
1065 <application>Junkbuster's</application> filtering. Just set <quote>toggle
1070 The Windows version of <application>Junkbuster</application> puts an icon in
1071 the system tray, which also allows you to change this option. If you
1072 right-click on that icon (or select the <quote>Options</quote> menu), one
1073 choice is <quote>Enable</quote>. Clicking on enable toggles
1074 <application>Junkbuster</application> on and off. This is useful if you want
1075 to temporarily disable <application>Junkbuster</application>, e.g., to access
1076 a site that requires cookies which you would otherwise have blocked. This can also
1077 be toggled via a web browser at the <application>Junkbuster</application>
1078 internal address of <ulink url="http://i.j.b">http://i.j.b</ulink> on
1083 <quote>toggle 1</quote> means <application>Junkbuster</application> runs
1084 normally, <quote>toggle 0</quote> means that
1085 <application>Junkbuster</application> becomes a non-anonymizing non-blocking
1086 proxy. Default: 1 (on).
1093 <emphasis>toggle 1</emphasis>
1100 For content filtering, i.e. the <quote>+filter</quote> and
1101 <quote>+deanimate-gif</quote> actions, it is necessary that
1102 <application>Junkbuster</application> buffers the entire document body.
1103 This can be potentially dangerous, since a server could just keep sending
1104 data indefinitely and wait for your RAM to exhaust. With nasty consequences.
1108 The <application>buffer-limit</application> option lets you set the maximum
1109 size in Kbytes that each buffer may use. When the documents buffer exceeds
1110 this size, it is flushed to the client unfiltered and no further attempt to
1111 filter the rest of it is made. Remember that there may multiple threads
1112 running, which might require increasing the <quote>buffer-limit</quote>
1113 Kbytes <emphasis>each</emphasis>, unless you have enabled
1114 <quote>single-threaded</quote> above.
1121 <emphasis>buffer-limit 4069</emphasis>
1128 To enable the web-based <filename>ijb.action</filename> file editor set
1129 <application>enable-edit-actions</application> to 1, or 0 to disable. Note
1130 that you must have compiled <application>JunkBuster</application> with
1131 support for this feature, otherwise this option has no effect. This
1132 internal page can be reached at <ulink
1133 url="http://i.j.b">http://i.j.b</ulink>.
1137 Security note: If this is enabled, anyone who can use the proxy
1138 can edit the actions file, and their changes will affect all users.
1139 For shared proxies, you probably want to disable this. Default: enabled.
1146 <emphasis>enable-edit-actions 1</emphasis>
1153 Allow <application>JunkBuster</application> to be toggled on and off
1154 remotely, using your web browser. Set <quote>enable-remote-toggle</quote>to
1155 1 to enable, and 0 to disable. Note that you must have compiled
1156 <application>JunkBuster</application> with support for this feature,
1157 otherwise this option has no effect.
1161 Security note: If this is enabled, anyone who can use the proxy can toggle
1162 it on or off (see <ulink url="http://i.j.b">http://i.j.b</ulink>), and
1163 their changes will affect all users. For shared proxies, you probably want to
1164 disable this. Default: enabled.
1171 <emphasis>enable-remote-toggle 1</emphasis>
1179 <!-- ~ End section ~ -->
1182 <!-- ~~~~~ New section ~~~~~ -->
1185 <title>Access Control List (ACL)</title>
1187 Access controls are included at the request of some ISPs and systems
1188 administrators, and are not usually needed by individual users. Please note
1189 the warnings in the FAQ that this proxy is not intended to be a substitute
1190 for a firewall or to encourage anyone to defer addressing basic security
1195 If no access settings are specified, the proxy talks to anyone that
1196 connects. If any access settings file are specified, then the proxy
1197 talks only to IP addresses permitted somewhere in this file and not
1198 denied later in this file.
1202 Summary -- if using an ACL:
1207 Client must have permission to receive service.
1212 LAST match in ACL wins.
1217 Default behavior is to deny service.
1222 The syntax for an entry in the Access Control List is:
1229 ACTION SRC_ADDR[/SRC_MASKLEN] [ DST_ADDR[/DST_MASKLEN] ]
1236 Where the individual fields are:
1243 <emphasis>ACTION</emphasis> = <quote>permit-access</quote> or <quote>deny-access</quote>
1245 <emphasis>SRC_ADDR</emphasis> = client hostname or dotted IP address
1246 <emphasis>SRC_MASKLEN</emphasis> = number of bits in the subnet mask for the source
1248 <emphasis>DST_ADDR</emphasis> = server or forwarder hostname or dotted IP address
1249 <emphasis>DST_MASKLEN</emphasis> = number of bits in the subnet mask for the target
1257 The field separator (FS) is whitespace (space or tab).
1261 IMPORTANT NOTE: If the <application>junkbuster</application> is using a
1262 forwarder (see below) or a gateway for a particular destination URL, the
1263 <literal>DST_ADDR</literal> that is examined is the address of the forwarder
1264 or the gateway and <emphasis>NOT</emphasis> the address of the ultimate
1265 target. This is necessary because it may be impossible for the local
1266 <application>Junkbuster</application> to determine the address of the
1267 ultimate target (that's often what gateways are used for).
1271 Here are a few examples to show how the ACL features work:
1275 <quote>localhost</quote> is OK -- no DST_ADDR implies that
1276 <emphasis>ALL</emphasis> destination addresses are OK:
1283 <emphasis>permit-access localhost</emphasis>
1290 A silly example to illustrate permitting any host on the class-C subnet with
1291 <application>Junkbuster</application> to go anywhere:
1298 <emphasis>permit-access www.junkbusters.com/24</emphasis>
1305 Except deny one particular IP address from using it at all:
1312 <emphasis>deny-access ident.junkbusters.com</emphasis>
1319 You can also specify an explicit network address and subnet mask.
1320 Explicit addresses do not have to be resolved to be used.
1327 <emphasis>permit-access 207.153.200.0/24</emphasis>
1334 A subnet mask of 0 matches anything, so the next line permits everyone.
1341 <emphasis>permit-access 0.0.0.0/0</emphasis>
1348 Note, you <emphasis>cannot</emphasis> say:
1355 <emphasis>permit-access .org</emphasis>
1362 to allow all *.org domains. Every IP address listed must resolve fully.
1366 An ISP may want to provide a <application>Junkbuster</application> that is
1367 accessible by <quote>the world</quote> and yet restrict use of some of their
1368 private content to hosts on its internal network (i.e. its own subscribers).
1369 Say, for instance the ISP owns the Class-B IP address block 123.124.0.0 (a 16
1370 bit netmask). This is how they could do it:
1377 <emphasis>permit-access 0.0.0.0/0 0.0.0.0/0</emphasis> # other clients can go anywhere
1378 # with the following exceptions:
1380 <emphasis>deny-access</emphasis> 0.0.0.0/0 123.124.0.0/16 # block all external requests for
1381 # sites on the ISP's network
1383 <emphasis>permit 0.0.0.0/0 www.my_isp.com</emphasis> # except for the ISP's main
1386 <emphasis>permit 123.124.0.0/16 0.0.0.0/0</emphasis> # the ISP's clients can go
1394 Note that if some hostnames are listed with multiple IP addresses,
1395 the primary value returned by DNS (via gethostbyname()) is used. Default:
1396 Anyone can access the proxy.
1401 <!-- ~ End section ~ -->
1404 <!-- ~~~~~ New section ~~~~~ -->
1407 <title>Forwarding</title>
1410 This feature allows chaining of HTTP requests via multiple proxies.
1411 It can be used to better protect privacy and confidentiality when
1412 accessing specific domains by routing requests to those domains
1413 to a special purpose filtering proxy such as lpwa.com. Or to use
1414 a caching proxy to speed up browsing.
1418 It can also be used in an environment with multiple networks to route
1419 requests via multiple gateways allowing transparent access to multiple
1420 networks without having to modify browser configurations.
1424 Also specified here are SOCKS proxies. <application>Junkbuster</application>
1425 SOCKS 4 and SOCKS 4A. The difference is that SOCKS 4A will resolve the target
1426 hostname using DNS on the SOCKS server, not our local DNS client.
1430 The syntax of each line is:
1437 <emphasis>forward target_domain[:port] http_proxy_host[:port]</emphasis>
1438 <emphasis>forward-socks4 target_domain[:port] socks_proxy_host[:port] http_proxy_host[:port]</emphasis>
1439 <emphasis>forward-socks4a target_domain[:port] socks_proxy_host[:port] http_proxy_host[:port]</emphasis>
1446 If http_proxy_host is <quote>.</quote>, then requests are not forwarded to a
1447 HTTP proxy but are made directly to the web servers.
1451 Lines are checked in sequence, and the last match wins.
1455 There is an implicit line equivalent to the following, which specifies that
1456 anything not finding a match on the list is to go out without forwarding
1457 or gateway protocol, like so:
1464 <emphasis>forward .* . </emphasis># implicit
1471 In the following common configuration, everything goes to Lucent's LPWA,
1472 except SSL on port 443 (which it doesn't handle):
1479 <emphasis>forward .* lpwa.com:8000</emphasis>
1480 <emphasis>forward :443 .</emphasis>
1488 See the FAQ for instructions on how to automate the login procedure for LPWA.
1490 Some users have reported difficulties related to LPWA's use of
1491 <quote>.</quote> as the last element of the domain, and have said that this
1492 can be fixed with this:
1499 <emphasis>forward lpwa. lpwa.com:8000</emphasis>
1506 (NOTE: the syntax for specifying target_domain has changed since the
1507 previous paragraph was written -- it will not work now. More information
1512 In this fictitious example, everything goes via an ISP's caching proxy,
1513 except requests to that ISP:
1520 <emphasis>forward .* caching.myisp.net:8000</emphasis>
1521 <emphasis>forward myisp.net .</emphasis>
1528 For the @home network, we're told the forwarding configuration is this:
1536 <emphasis>forward .* proxy:8080</emphasis>
1543 Also, we're told they insist on getting cookies and JavaScript, so you should
1544 allow cookies from home.com. We consider JavaScript a potential security risk.
1545 Java need not be enabled.
1549 In this example direct connections are made to all <quote>internal</quote>
1550 domains, but everything else goes through Lucent's LPWA by way of the
1551 company's SOCKS gateway to the Internet.
1558 <emphasis>forward-socks4 .* lpwa.com:8000 firewall.my_company.com:1080</emphasis>
1559 <emphasis>forward my_company.com .</emphasis>
1566 This is how you could set up a site that always uses SOCKS but no forwarders:
1573 <emphasis>forward-socks4a .* . firewall.my_company.com:1080</emphasis>
1580 An advanced example for network administrators:
1584 If you have links to multiple ISPs that provide various special content to
1585 their subscribers, you can configure forwarding to pass requests to the
1586 specific host that's connected to that ISP so that everybody can see all
1587 of the content on all of the ISPs.
1591 This is a bit tricky, but here's an example:
1596 host-a has a PPP connection to isp-a.com. And host-b has a PPP connection to
1597 isp-b.com. host-a can run a <application>Junkbuster</application> proxy with
1598 forwarding like this:
1605 <emphasis>forward .* .</emphasis>
1606 <emphasis>forward isp-b.com host-b:8118</emphasis>
1613 host-b can run a <application>Junkbuster</application> proxy with forwarding
1621 <emphasis>forward .* .</emphasis>
1622 <emphasis>forward isp-a.com host-a:8118</emphasis>
1629 Now, <emphasis>anyone</emphasis> on the Internet (including users on host-a
1630 and host-b) can set their browser's proxy to <emphasis>either</emphasis>
1631 host-a or host-b and be able to browse the content on isp-a or isp-b.
1635 Here's another practical example, for University of Kent at
1636 Canterbury students with a network connection in their room, who
1637 need to use the University's Squid web cache.
1644 <emphasis>forward *. ssbcache.ukc.ac.uk:3128</emphasis> # Use the proxy, except for:
1645 <emphasis>forward .ukc.ac.uk . </emphasis> # Anything on the same domain as us
1646 <emphasis>forward * . </emphasis> # Host with no domain specified
1647 <emphasis>forward 129.12.*.* . </emphasis> # A dotted IP on our /16 network.
1648 <emphasis>forward 127.*.*.* . </emphasis> # Loopback address
1649 <emphasis>forward localhost.localdomain . </emphasis> # Loopback address
1650 <emphasis>forward www.ukc.mirror.ac.uk . </emphasis> # Specific host
1657 If you intend to chain <application>Junkbuster</application> and
1658 <application>squid</application> locally, then chain as
1659 <literal>browser -> squid -> junkbuster</literal> is the recommended way.
1663 Your squid configuration could then look like this:
1670 # Define junkbuster as parent cache
1671 <!-- per feedback from user...
1672 cache_peer 127.0.0.1 8118 parent 0 no-query
1674 cache_peer 127.0.0.1 parent 8118 0 no-query
1676 # Define ACL for protocol FTP
1679 # Do not forward ACL FTP to junkbuster
1680 always_direct allow FTP
1682 # Do not forward ACL CONNECT (https) to junkbuster
1683 always_direct allow CONNECT
1685 # Forward the rest to junkbuster
1686 never_direct allow all
1694 <!-- ~ End section ~ -->
1697 <!-- ~~~~~ New section ~~~~~ -->
1700 <title>Windows GUI Options</title>
1702 Removed references to Win32. HB 09/23/01
1705 <application>Junkbuster</application> has a number of options specific to the
1706 Windows GUI interface:
1710 If <quote>activity-animation</quote> is set to 1, the
1711 <application>Junkbuster</application> icon will animate when
1712 <quote>Junkbuster</quote> is active. To turn off, set to 0.
1719 <emphasis>activity-animation 1</emphasis>
1726 If <quote>log-messages</quote> is set to 1,
1727 <application>Junkbuster</application> will log messages to the console
1735 <emphasis>log-messages 1</emphasis>
1742 If <quote>log-buffer-size</quote> is set to 1, the size of the log buffer,
1743 i.e. the amount of memory used for the log messages displayed in the
1744 console window, will be limited to <quote>log-max-lines</quote> (see below).
1748 Warning: Setting this to 0 will result in the buffer to grow infinitely and
1749 eat up all your memory!
1756 <emphasis>log-buffer-size 1</emphasis>
1763 <application>log-max-lines</application> is the maximum number of lines held
1764 in the log buffer. See above.
1771 <emphasis>log-max-lines 200</emphasis>
1778 If <quote>log-highlight-messages</quote> is set to 1,
1779 <application>Junkbuster</application> will highlight portions of the log
1780 messages with a bold-faced font:
1787 <emphasis>log-highlight-messages 1</emphasis>
1794 The font used in the console window:
1801 <emphasis>log-font-name Comic Sans MS</emphasis>
1808 Font size used in the console window:
1815 <emphasis>log-font-size 8</emphasis>
1822 <quote>show-on-task-bar</quote> controls whether or not
1823 <application>Junkbuster</application> will appear as a button on the Task bar
1831 <emphasis>show-on-task-bar 0</emphasis>
1838 If <quote>close-button-minimizes</quote> is set to 1, the Windows close
1839 button will minimize <application>Junkbuster</application> instead of closing
1840 the program (close with the exit option on the File menu).
1847 <emphasis>close-button-minimizes 1</emphasis>
1854 The <quote>hide-console</quote> option is specific to the MS-Win console
1855 version of <application>JunkBuster</application>. If this option is used,
1856 <application>Junkbuster</application> will disconnect from and hide the
1873 <!-- ~ End section ~ -->
1876 <!-- ~~~~~ New section ~~~~~ -->
1877 <sect2 id="actionsfile">
1878 <title>The Actions File</title>
1881 The <quote>ijb.action</quote> file (formerly
1882 <filename>actionsfile</filename>) is used to define what actions
1883 <application>Junkbuster</application> takes, and thus determines how images,
1884 cookies and various other aspects of HTTP content and transactions are
1885 handled. Images can be anything you want, including ads, banners, or just
1886 some obnoxious URL that you would rather not see. Cookies can be accepted
1887 or rejected, or accepted only during the current browser session (i.e.
1888 not written to disk). Changes to <filename>ijb.action</filename> should
1889 be immediately visible to <application>Junkbuster</application> without
1890 the need to restart.
1894 The easiest way to edit <quote>actions</quote> file is with a browser by
1895 loading <ulink url="http://i.j.b/">http://i.j.b/</ulink>, and then select
1896 <quote>Edit Actions List</quote>. A text editor can also be used.
1900 To determine which actions apply to a request, the URL of the request is
1901 compared to all patterns in this file. Every time it matches, the list of
1902 applicable actions for the URL is incrementally updated. You can trace
1903 this process by visiting <ulink
1904 url="http://i.j.b/show-url-info">http://i.j.b/show-url-info</ulink>.
1909 There are four types of lines in this file: comments (begin with a
1910 <quote>#</quote> character), actions, aliases and patterns, all of which are
1911 explained below, as well as the configuration file syntax that
1912 <application>Junkbuster</application> understands.
1917 <!-- ~~~~~ New section ~~~~~ -->
1919 <title>URL Domain and Path Syntax</title>
1921 Generally, a pattern has the form <domain>/<path>, where both the
1922 <domain> and <path> part are optional. If you only specify a
1923 domain part, the <quote>/</quote> can be left out:
1927 <emphasis>www.example.com</emphasis> - is a domain only pattern and will match any request to
1928 <quote>www.example.com</quote>.
1932 <emphasis>www.example.com/</emphasis> - means exactly the same.
1936 <emphasis>www.example.com/index.html</emphasis> - matches only the single
1937 document <quote>/index.html</quote> on <quote>www.example.com</quote>.
1941 <emphasis>/index.html</emphasis> - matches the document <quote>/index.html</quote>, regardless of
1946 <emphasis>index.html</emphasis> - matches nothing, since it would be
1947 interpreted as a domain name and there is no top-level domain called
1948 <quote>.html</quote>.
1952 The matching of the domain part offers some flexible options: if the
1953 domain starts or ends with a dot, it becomes unanchored at that end.
1958 <emphasis>.example.com</emphasis> - matches any domain that <emphasis>ENDS</emphasis> in
1959 <quote>.example.com</quote>.
1963 <emphasis>www.</emphasis> - matches any domain that <emphasis>STARTS</emphasis> with
1968 Additionally, there are wild-cards that you can use in the domain names
1969 themselves. They work pretty similar to shell wild-cards: <quote>*</quote>
1970 stands for zero or more arbitrary characters, <quote>?</quote> stands for
1971 any single character. And you can define character classes in square
1972 brackets and they can be freely mixed:
1976 <emphasis>ad*.example.com</emphasis> - matches <quote>adserver.example.com</quote>,
1977 <quote>ads.example.com</quote>, etc but not <quote>sfads.example.com</quote>.
1981 <emphasis>*ad*.example.com</emphasis> - matches all of the above, and then some.
1985 <emphasis>.?pix.com</emphasis> - matches <quote>www.ipix.com</quote>,
1986 <quote>pictures.epix.com</quote>, <quote>a.b.c.d.e.upix.com</quote>, etc.
1990 <emphasis>www[1-9a-ez].example.com</emphasis> - matches <quote>www1.example.com</quote>,
1991 <quote>www4.example.com</quote>, <quote>wwwd.example.com</quote>,
1992 <quote>wwwz.example.com</quote>, etc., but <emphasis>not</emphasis>
1993 <quote>wwww.example.com</quote>.
1997 If <application>Junkbuster</application> was compiled with
1998 <quote>pcre</quote> support (default), Perl compatible regular expressions
1999 can be used. See the <filename>pcre/docs/</filename> directory or <quote>man
2000 perlre</quote> (also available on <ulink
2001 url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>)
2002 for details. A brief discussion of regular expressions is in the
2003 <link linkend="regex">Appendix</link>. For instance:
2007 <emphasis>/.*/advert[0-9]+\.jpe?g</emphasis> - would match a URL from any
2008 domain, with any path that includes <quote>advert</quote> followed
2009 immediately by one or more digits, then a <quote>.</quote> and ending in
2010 either <quote>jpeg</quote> or <quote>jpg</quote>. So we match
2011 <quote>example.com/ads/advert2.jpg</quote>, and
2012 <quote>www.example.com/ads/banners/advert39.jpeg</quote>, but not
2013 <quote>www.example.com/ads/banners/advert39.gif</quote> (no gifs in the
2018 Please note that matching in the path is case
2019 <emphasis>INSENSITIVE</emphasis> by default, but you can switch to case
2020 sensitive at any point in the pattern by using the
2021 <quote>(?-i)</quote> switch:
2025 <emphasis>www.example.com/(?-i)PaTtErN.*</emphasis> - will match only
2026 documents whose path starts with <quote>PaTtErN</quote> in
2027 <emphasis>exactly</emphasis> this capitalization.
2032 <!-- ~ End section ~ -->
2036 <!-- ~~~~~ New section ~~~~~ -->
2039 <title>Actions</title>
2041 Actions are enabled if preceded with a <quote>+</quote>, and disabled if
2042 preceded with a <quote>-</quote>. Actions are invoked by enclosing the
2043 action name in curly braces (e.g. {+some_action}), followed by a list of
2044 URLs to which the action applies. There are three classes of actions:
2052 Boolean (e.g. <quote>+/-block</quote>):
2058 <emphasis>{+name}</emphasis> # enable this action
2059 <emphasis>{-name}</emphasis> # disable this action
2069 parameterized (e.g. <quote>+/-hide-user-agent</quote>):
2075 <emphasis>{+name{param}}</emphasis> # enable action and set parameter to <quote>param</quote>
2076 <emphasis>{-name}</emphasis> # disable action
2085 Multi-value (e.g. <quote>{+/-add-header{Name: value}}</quote>, <quote>{+/-wafer{name=value}}</quote>):
2091 <emphasis>{+name{param}}</emphasis> # enable action and add parameter <quote>param</quote>
2092 <emphasis>{-name{param}}</emphasis> # remove the parameter <quote>param</quote>
2093 <emphasis>{-name}</emphasis> # disable this action totally
2104 If nothing is specified in this file, no <quote>actions</quote> are taken.
2105 So in this case <application>JunkBuster</application> would just be a
2106 normal, non-blocking, non-anonymizing proxy. You must specifically
2107 enable the privacy and blocking features you need (although the
2108 provided default <filename>ijb.action</filename> file will
2109 give a good starting point).
2113 Later defined actions always over-ride earlier ones. For multi-valued
2114 actions, the actions are applied in the order they are specified.
2118 The list of valid <application>Junkbuster</application> <quote>actions</quote> are:
2126 Add the specified HTTP header, which is not checked for validity.
2127 You may specify this many times to specify many different headers:
2133 <emphasis>+add-header{Name: value}</emphasis>
2143 Block this URL totally. In a default installation, a <quote>blocked</quote>
2144 URL will result in bright red banner that says <quote>BLOCKED</quote>,
2145 with a reason why it is being blocked.
2151 <emphasis>+block</emphasis>
2161 De-animate all animated GIF images, i.e. reduce them to their last frame.
2162 This will also shrink the images considerably (in bytes, not pixels!). If
2163 the option <quote>first</quote> is given, the first frame of the animation
2164 is used as the replacement. If <quote>last</quote> is given, the last frame
2165 of the animation is used instead, which probably makes more sense for most
2166 banner animations, but also has the risk of not showing the entire last
2167 frame (if it is only a delta to an earlier frame).
2173 <emphasis>+deanimate-gifs{last}</emphasis>
2174 <emphasis>+deanimate-gifs{first}</emphasis>
2183 <quote>+downgrade</quote> will downgrade HTTP/1.1 client requests to
2184 HTTP/1.0 and downgrade the responses as well. Use this action for servers
2185 that use HTTP/1.1 protocol features that
2186 <application>Junkbuster</application> doesn't handle well yet. HTTP/1.1
2187 is only partially implemented. Default is not to downgrade requests.
2193 <emphasis>+downgrade</emphasis>
2202 Many sites, like yahoo.com, don't just link to other sites. Instead, they
2203 will link to some script on their own server, giving the destination as a
2204 parameter, which will then redirect you to the final target. URLs resulting
2205 from this scheme typically look like:
2206 http://some.place/some_script?http://some.where-else.
2209 Sometimes, there are even multiple consecutive redirects encoded in the
2210 URL. These redirections via scripts make your web browsing more traceable,
2211 since the server from which you follow such a link can see where you go to.
2212 Apart from that, valuable bandwidth and time is wasted, while your browser
2213 ask the server for one redirect after the other. Plus, it feeds the
2217 The <quote>+fast-redirects</quote> option enables interception of these
2218 requests by <application>Junkbuster</application>, who will cut off all but
2219 the last valid URL in the request and send a local redirect back to your
2220 browser without contacting the remote site.
2226 <emphasis>+fast-redirects</emphasis>
2235 Apply the filters in the <literal>section_header</literal>
2236 section of the <filename>re_filterfile</filename> file to the site(s).
2237 <filename>Re_filterfile</filename> sections are grouped according to like
2245 <emphasis>+filter{section_header}</emphasis>
2252 Filter sections that are pre-defined in the supplied
2253 <filename>re_filterfile</filename> include:
2259 <emphasis>html-annoyances</emphasis>: Get rid of particularly annoying HTML abuse.
2264 <emphasis>js-annoyances</emphasis>: Get rid of particularly annoying JavaScript abuse
2269 <emphasis>no-poups</emphasis>: Kill all popups in JS and HTML
2274 <emphasis>frameset-borders</emphasis>: Give frames a border
2279 <emphasis>webbugs</emphasis>: Squish WebBugs (1x1 invisible GIFs used for user tracking)
2284 <emphasis>no-refresh</emphasis>: Automatic refresh sucks on auto-dialup lines
2289 <emphasis>fun</emphasis>: Text replacements for subversive browsing fun!
2294 <emphasis>nimda</emphasis>: Remove (virus) Nimda code.
2299 <emphasis>banners-by-size</emphasis>: Kill banners by size
2304 <emphasis>crude-parental</emphasis>: Kill all web pages that contain the words "sex" or "warez"
2313 Block any existing X-Forwarded-for header, and do not add a new one:
2319 <emphasis>+hide-forwarded</emphasis>
2328 If the browser sends a <quote>From:</quote> header containing your e-mail
2329 address, this either completely removes the header (<quote>block</quote>), or
2330 changes it to the specified e-mail address.
2336 <emphasis>+hide-from{block}</emphasis>
2337 <emphasis>+hide-from{spam@sittingduck.xqq}</emphasis>
2346 Don't send the <quote>Referer:</quote> (sic) header to the web site. You
2347 can block it, forge a URL to the same server as the request (which is
2348 preferred because some sites will not send images otherwise) or set it to a
2349 constant string of your choice.
2355 <emphasis>+hide-referer{block}</emphasis>
2356 <emphasis>+hide-referer{forge}</emphasis>
2357 <emphasis>+hide-referer{http://nowhere.com}</emphasis>
2366 Alternative spelling of <quote>+hide-referer</quote>. It has the same
2367 parameters, and can be freely mixed with, <quote>+hide-referer</quote>.
2368 (<quote>referrer</quote> is the correct English spelling, however the HTTP
2369 specification has a bug - it requires it to be spelled <quote>referer</quote>.)
2375 <emphasis>+hide-referrer{...}</emphasis>
2384 Change the <quote>User-Agent:</quote> header so web servers can't tell your
2385 browser type. Warning! This breaks many web sites. Specify the
2386 user-agent value you want. Example, pretend to be using Netscape on
2393 <emphasis>+hide-user-agent{Mozilla (X11; I; Linux 2.0.32 i586)}</emphasis>
2400 Or to identify yourself explicitly as a <quote>Junkbuster</quote> user:
2406 <emphasis>+hide-user-agent{JunkBuster/1.0}</emphasis>
2411 (Don't change the version number from 1.0 - after all, why tell them?)
2418 <emphasis>+hide-user-agent{browser-type}</emphasis>
2428 Treat this URL as an image. This only matters if it's also <quote>+block</quote>ed,
2429 in which case a <quote>blocked</quote> image can be sent rather than a HTML page.
2430 See <quote>+image-blocker{}</quote> below for the control over what is actually sent.
2431 If you want <emphasis>invisible</emphasis> ads, they should be defined as
2432 <emphasis>images</emphasis> and <emphasis>blocked</emphasis>. And also,
2433 <quote>image-blocker</quote> should be set to <quote>blank</quote>.
2439 <emphasis>+image</emphasis>
2448 Decides what to do with URLs that end up tagged with <quote>{+block
2449 +image}</quote>, e.g an advertizement. There are five options.
2450 <quote>-image-blocker</quote> will send a HTML <quote>blocked</quote> page,
2451 usually resulting in a <quote>broken image</quote> icon.
2452 <quote>+image-blocker{logo}</quote> will send a <quote>JunkBuster</quote>
2453 logo image. <quote>+image-blocker{blank}</quote> will send a 1x1
2454 transparent GIF image. And finally,
2455 <quote>+image-blocker{http://xyz.com}</quote> will send a HTTP temporary
2456 redirect to the specified image. This has the advantage of the icon being
2457 being cached by the browser, which will speed up the display.
2458 <quote>+image-blocker{pattern}</quote> will send a checkboard type pattern,
2459 which scales better than the logo (which can get blocky if the browser
2460 enlarges it too much).
2466 <emphasis>+image-blocker{logo}</emphasis>
2467 <emphasis>+image-blocker{blank}</emphasis>
2468 <emphasis>+image-blocker{pattern}</emphasis>
2469 <emphasis>+image-blocker{http://i.j.b/send-banner}</emphasis>
2478 By default (i.e. in the absence of a <quote>+limit-connect</quote>
2479 action), <application>Junkbuster</application> will only allow CONNECT
2480 requests to port 443, which is the standard port for https as a
2485 The CONNECT methods exists in HTTP to allow access to secure websites
2486 (https:// URLs) through proxies. It works very simply: the proxy
2487 connects to the server on the specified port, and then short-circuits
2488 its connections to the client <emphasis>and</emphasis> to the remote proxy.
2489 This can be a big security hole, since CONNECT-enabled proxies can
2490 be abused as TCP relays very easily.
2494 If you want to allow CONNECT for more ports than this, or want to forbid
2495 CONNECT altogether, you can specify a comma separated list of ports and
2496 port ranges (the latter using dashes, with the minimum defaulting to 0 and
2504 <emphasis>+limit-connect{443} # This is the default and need no be specified.</emphasis>
2505 <emphasis>+limit-connect{80,443} # Ports 80 and 443 are OK.</emphasis>
2506 <emphasis>+limit-connect{-3, 7, 20-100, 500-} # Port less than 3, 7, 20 to 100</emphasis>
2507 <emphasis> #and above 500 are OK.</emphasis>
2517 <quote>+no-compression</quote> prevents the website from compressing the
2518 data. Some websites do this, which can be a problem for
2519 <application>Junkbuster</application>, since <quote>+filter</quote>,
2520 <quote>+no-popup</quote> and <quote>+gif-deanimate</quote> will not work on
2521 compressed data. This will slow down connections to those websites,
2522 though. Default is <quote>nocompression</quote> is turned on.
2529 <emphasis>+nocompression</emphasis>
2538 If the website sets cookies, <quote>no-cookies-keep</quote> will make sure
2539 they are erased when you exit and restart your web browser. This makes
2540 profiling cookies useless, but won't break sites which require cookies so
2541 that you can log in for transactions. Default: on.
2547 <emphasis>+no-cookies-keep</emphasis>
2556 Prevent the website from reading cookies:
2562 <emphasis>+no-cookies-read</emphasis>
2571 Prevent the website from setting cookies:
2577 <emphasis>+no-cookies-set</emphasis>
2586 Filter the website through a built-in filter to disable those obnoxious
2587 JavaScript pop-up windows via window.open(), etc. The two alternative
2588 spellings are equivalent.
2594 <emphasis>+no-popup</emphasis>
2595 <emphasis>+no-popups</emphasis>
2604 This action only applies if you are using a <filename>jarfile</filename>
2605 for saving cookies. It sends a cookie to every site stating that you do not
2606 accept any copyright on cookies sent to you, and asking them not to track
2607 you. Of course, this is a (relatively) unique header they could use to
2614 <emphasis>+vanilla-wafer</emphasis>
2623 This allows you to add an arbitrary cookie. It can be specified multiple
2624 times in order to add as many cookies as you like.
2630 <emphasis>+wafer{name=value}</emphasis>
2641 The meaning of any of the above is reversed by preceding the action with a
2642 <quote>-</quote>, in place of the <quote>+</quote>.
2650 Turn off cookies by default, then allow a few through for specified sites:
2657 # Turn off all persistent cookies
2658 { +no-cookies-read }
2660 # Allow cookies for this browser session ONLY
2661 { +no-cookies-keep }
2663 # Exceptions to the above, sites that benefit from persistent cookies
2664 { -no-cookies-read }
2666 { -no-cookies-keep }
2673 # Alternative way of saying the same thing
2674 {-no-cookies-set -no-cookies-read -no-cookies-keep}
2683 Now turn off <quote>fast redirects</quote>, and then we allow two exceptions:
2693 # Reverse it for these two sites, which don't work right without it.
2695 www.ukc.ac.uk/cgi-bin/wac\.cgi\?
2703 Turn on page filtering according to rules in the defined sections
2704 of <filename>refilterfile</filename>, and make one exception for
2712 # Run everything through the filter file, using only the
2713 # specified sections:
2714 +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}\
2715 +filter{webbugs} +filter{nimda} +filter{banners-by-size}
2717 # Then disable filtering of code from sourceforge!
2719 .cvs.sourceforge.net
2726 Now some URLs that we want <quote>blocked</quote>, ie we won't see them.
2727 Many of these use regular expressions that will expand to match multiple
2737 /.*/(.*[-_.])?ads?[0-9]?(/|[-_.].*|\.(gif|jpe?g))
2738 /.*/(.*[-_.])?count(er)?(\.cgi|\.dll|\.exe|[?/])
2739 /.*/(ng)?adclient\.cgi
2740 /.*/(plain|live|rotate)[-_.]?ads?/
2741 /.*/(sponsor)s?[0-9]?/
2742 /.*/_?(plain|live)?ads?(-banners)?/
2744 /.*/ad(sdna_image|gifs?)/
2745 /.*/ad(server|stream|juggler)\.(cgi|pl|dll|exe)
2749 /.*/adv((er)?ts?|ertis(ing|ements?))?/
2753 /.*/cgi-bin/centralad/getimage
2754 /.*/images/addver\.gif
2755 /.*/images/marketing/.*\.(gif|jpe?g)
2759 /.*/sponsors?[0-9]?/
2760 /.*/advert[0-9]+\.jpg
2767 /graphics/defaultAd/
2769 /image\.ng/transactionID
2770 /images/.*/.*_anim\.gif # alvin brattli
2771 /ip_img/.*\.(gif|jpe?g)
2775 /cgi-bin/nph-adclick.exe/
2776 /.*/Image/BannerAdvertising/
2778 /.*/adlib/server\.cgi
2786 Note that many of these actions have the potential to cause a page to
2787 misbehave, possibly even not to display at all. There are many ways
2788 a site designer may choose to design his site, and what HTTP header
2789 content he may depend on. There is no way to have hard and fast rules
2790 for all sites. See the <link linkend="ACTIONSANAT">Appendix</link>
2791 for a brief example on troubleshooting actions.
2797 <!-- ~ End section ~ -->
2800 <!-- ~~~~~ New section ~~~~~ -->
2802 <title>Aliases</title>
2804 Custom <quote>actions</quote>, known to <application>Junkbuster</application>
2805 as <quote>aliases</quote>, can be defined by combining other <quote>actions</quote>.
2806 These can in turn be invoked just like the built-in <quote>actions</quote>.
2807 Currently, an alias can contain any character except space, tab, <quote>=</quote>,
2808 <quote>{</quote> or <quote>}</quote>. But please use only <quote>a</quote>-
2809 <quote>z</quote>, <quote>0</quote>-<quote>9</quote>, <quote>+</quote>, and
2810 <quote>-</quote>. Alias names are not case sensitive, and
2811 <emphasis>must be defined before anything</emphasis> else in the
2812 <filename>ijb.action</filename>file ! And there can only be one set of
2813 <quote>aliases</quote> defined.
2817 Now let's define a few aliases:
2824 # Useful customer aliases we can use later. These must come first!
2826 +no-cookies = +no-cookies-set +no-cookies-read
2827 -no-cookies = -no-cookies-set -no-cookies-read
2828 fragile = -block -no-cookies -filter -fast-redirects -hide-referer -no-popups
2829 shop = -no-cookies -filter -fast-redirects
2830 +imageblock = +block +image
2832 #For people who don't like to type too much: ;-)
2835 c2 = -no-cookies-set +no-cookies-read
2836 c3 = +no-cookies-set -no-cookies-read
2837 #... etc. Customize to your heart's content.
2844 Some examples using our <quote>shop</quote> and <quote>fragile</quote>
2852 # These sites are very complex and require
2853 # minimal interference.
2855 .office.microsoft.com
2856 .windowsupdate.microsoft.com
2859 # Shopping sites - still want to block ads.
2862 .worldpay.com # for quietpc.com
2866 # These shops require pop-ups
2878 <!-- ~ End section ~ -->
2881 <!-- ~~~~~ New section ~~~~~ -->
2882 <sect2 id="filterfile">
2883 <title>The Filter File</title>
2885 Any web page can be dynamically modified with the filter file. This
2886 modification can be removal, or re-writing, of any web page content,
2887 including tags and non-visible content. The default filter file is
2888 <filename>re_filterfile</filename>, located in the config directory.
2892 The included example file is divided into sections. Each section begins
2893 with the <literal>FILTER</literal> keyword, followed by the identifier
2894 for that section, e.g. <quote>FILTER: webbugs</quote>. Each section performs
2895 a similar type of filtering, such as <quote>html-annoyances</quote>.
2900 This file uses regular expressions to alter or remove any string in the
2901 target page. The expressions can only operate on one line at a time. Some
2902 examples from the included default <filename>re_filterfile</filename>:
2906 Stop web pages from displaying annoying messages in the status bar by
2907 deleting such references:
2914 FILTER: html-annoyances
2916 # New browser windows should be resizeable and have a location and status
2919 s/resizable="?(no|0)"?/resizable=1/ig s/noresize/yesresize/ig
2920 s/location="?(no|0)"?/location=1/ig s/status="?(no|0)"?/status=1/ig
2921 s/scrolling="?(no|0|Auto)"?/scrolling=1/ig
2922 s/menubar="?(no|0)"?/menubar=1/ig
2924 # The <BLINK> tag was a crime!
2926 s*<blink>|</blink>**ig
2930 #s/framespacing="?(no|0)"?//ig
2931 #s/margin(height|width)=[0-9]*//gi
2938 Just for kicks, replace any occurrence of <quote>Microsoft</quote> with
2939 <quote>MicroSuck</quote>, and have a little fun with topical buzzwords:
2948 s/microsoft(?!.com)/MicroSuck/ig
2952 s/industry-leading|cutting-edge|award-winning/<font color=red><b>BINGO!</b></font>/ig
2959 Kill those pesky little web-bugs:
2966 # webbugs: Squish WebBugs (1x1 invisible GIFs used for user tracking)
2969 s/<img\s+[^>]*?(width|height)\s*=\s*['"]?1\D[^>]*?(width|height)\s*=\s*['"]?1(\D[^>]*?)?>/<!-- Squished WebBug -->/sig
2977 <!-- ~ End section ~ -->
2981 <!-- ~~~~~ New section ~~~~~ -->
2984 <title>Templates</title>
2986 When <application>Junkbuster</application> displays one of its internal
2987 pages, such as a 404 Not Found error page, it uses the appropriate template.
2988 On Linux, BSD, and Unix, these are located in
2989 <filename>/etc/junkbuster/templates</filename> by default. These may be
2990 customized, if desired.
2997 <!-- ~ End section ~ -->
3001 <!-- ~~~~~ New section ~~~~~ -->
3002 <sect1 id="quickstart"><title>Quickstart to Using Junkbuster</title>
3004 Install package, then run and enjoy! <application>JunkBuster</application>
3005 is typically started by specifying the main configuration file to be
3006 used on the command line. Example Unix startup command:
3012 # /usr/sbin/junkbuster /etc/junkbuster/config
3018 An init script is provided for SuSE and Redhat.
3022 For for SuSE: /etc/rc.d/junkbuster start
3026 For RedHat: /etc/rc.d/init.d/junkbuster start
3031 If no configuration file is specified on the command line,
3032 <application>Junkbuster</application> will look for a file named
3033 <filename>config</filename> in the current directory. Except on Win32 where
3034 it will try <filename>config.txt</filename>. If no file is specified on the
3035 command line and no default configuration file can be found,
3036 <application>Junkbuster</application> will fail to start.
3040 Be sure your browser is set to use the proxy which is by default at
3041 localhost, port 8118. With <application>Netscape</application> (and
3042 <application>Mozilla</application>), this can be set under <literal>Edit
3043 -> Preferences -> Advanced -> Proxies -> HTTP Proxy</literal>.
3044 For <application>Internet Explorer</application>: <literal>Tools >
3045 Internet Properties -> Connections -> LAN Setting</literal>. Then,
3046 check <quote>Use Proxy</quote> and fill in the appropriate info (Address:
3047 localhost, Port: 8118). Include if HTTPS proxy support too.
3051 The included default configuration files should give a reasonable starting
3052 point, though may be somewhat aggressive in blocking junk. You will probably
3053 want to keep an eye out for sites that require persistent cookies, and add these to
3054 <filename>ijb.action</filename> as needed. By default, most of these will
3055 be accepted only during the current browser session, until you add them to
3056 the configuration. If you want the browser to handle this instead, you will
3057 need to edit <filename>ijb.action</filename> and disable this feature. If you
3058 use more than one browser, it would make more sense to let
3059 <application>Junkbuster</application> handle this. In which case, the
3060 browser(s) should be set to accept all cookies.
3064 If a particular site shows problems loading properly, try adding it
3065 to the <literal>{fragile}</literal> section of
3066 <filename>ijb.action</filename>. This will turn off most actions for
3071 <application>Junkbuster</application> is HTTP/1.1 compliant, but not all 1.1
3072 features are as yet implemented. If browsers that support HTTP/1.1 (like
3073 <application>Mozilla</application> or recent versions of I.E.) experience
3074 problems, you might try to force HTTP/1.0 compatibility. For Mozilla, look
3075 under <literal>Edit -> Preferences -> Debug -> Networking</literal>.
3076 Or set the <quote>+downgrade</quote> config option in
3077 <filename>ijb.action</filename>.
3081 After running <application>Junkbuster</application> for a while, you can
3082 start to fine tune the configuration to suit your personal, or site,
3083 preferences and requirements. There are many, many aspects that can
3084 be customized. <quote>Actions</quote> (as specified in <filename>ijb.action</filename>)
3085 can be adjusted by pointing your browser to
3086 <ulink url="http://i.j.b/">http://i.j.b/</ulink>,
3087 and then follow the link to <quote>edit the actions list</quote>.
3088 (This is an internal page and does not require Internet access.)
3092 In fact, various aspects of <application>Junkbuster</application>
3093 configuration can be viewed from this page, including
3094 current configuration parameters, source code version numbers,
3095 the browser's request headers, and <quote>actions</quote> that apply
3096 to a given URL. In addition to the <filename>ijb.action</filename> file
3097 editor mentioned above, <application>Junkbuster</application> can also
3098 be turned <quote>on</quote> and <quote>off</quote> from this page.
3102 If you encounter problems, please verify it is a
3103 <application>Junkbuster</application> bug, by disabling
3104 <application>Junkbuster</application>, and then trying the same page.
3105 Also, try another browser if possible to eliminate browser or site
3106 problems. Before reporting it as a bug, see if there is not a configuration
3107 option that is enabled that is causing the page not to load. You can
3108 then add an exception for that page or site. If a bug, please report it to
3109 the developers (see below).
3114 <!-- ~~~~~ New section ~~~~~ -->
3117 <title>Command Line Options</title>
3119 <application>JunkBuster</application> may be invoked with the following
3120 command-line options:
3128 <emphasis>--version</emphasis>
3131 Print version info and exit, Unix only.
3136 <emphasis>--help</emphasis>
3139 Print a short usage info and exit, Unix only.
3144 <emphasis>--no-daemon</emphasis>
3147 Don't become a daemon, i.e. don't fork and become process group
3148 leader, don't detach from controlling tty. Unix only.
3153 <emphasis>--pidfile FILE</emphasis>
3157 On startup, write the process ID to <emphasis>FILE</emphasis>. Delete the
3158 <emphasis>FILE</emphasis> on exit. Failiure to create or delete the
3159 <emphasis>FILE</emphasis> is non-fatal. If no <emphasis>FILE</emphasis>
3160 option is given, no PID file will be used. Unix only.
3165 <emphasis>--user USER[.GROUP]</emphasis>
3169 After (optionally) writing the PID file, assume the user ID of
3170 <emphasis>USER</emphasis>, and if included the GID of GROUP. Exit if the
3171 privileges are not sufficient to do so. Unix only.
3176 <emphasis>configfile</emphasis>
3179 If no <emphasis>configfile</emphasis> is included on the command line,
3180 <application>JunkBuster</application> will look for a file named
3181 <quote>config</quote> in the current directory (except on Win32
3182 where it will look for <quote>config.txt</quote> instead). Specify
3183 full path to avoid confusion.
3194 <!-- ~ End section ~ -->
3198 <!-- ~~~~~ New section ~~~~~ -->
3200 <sect1 id="contact"><title>Contacting the Developers, Bug Reporting and Feature
3203 We value your feedback. However, to provide you with the best support,
3208 <listitem><para>Use the <ulink url="http://sourceforge.net/tracker/?group_id=11118&atid=211118">Sourceforge support forum</ulink> to get
3209 help.</para></listitem>
3211 <listitem><para>Submit bugs only thru our <ulink url="http://sourceforge.net/tracker/?group_id=11118&atid=111118">Sourceforge bug
3213 Make sure that the bug has not already been submitted. Please try to
3214 verify that it is a <application>Junkbuster</application> bug, and not
3215 a browser or site bug first. If you are using your own custom configuration,
3216 please try the stock configs to see if the problem is a configuration
3217 related bug. And if not using the latest development snapshot, please
3218 try the latest one. Or even better, CVS sources.</para>
3222 <listitem><para>Submit feature requests only thru our <ulink
3223 url="http://sourceforge.net/tracker/?atid=361118&group_id=11118&func=browse">Sourceforge feature request forum</ulink>.</para></listitem>
3231 For any other issues, feel free to use the <ulink url="http://sourceforge.net/mail/?group_id=11118">mailing lists</ulink>.
3235 Anyone interested in actively participating in development and related
3236 discussions can join the appropriate mailing list
3237 <ulink url="http://sourceforge.net/mail/?group_id=11118">here</ulink>.
3238 Archives are available here too.
3244 <!-- ~~~~~ New section ~~~~~ -->
3245 <sect1 id="copyright"><title>Copyright and History</title>
3248 <title>License</title>
3250 <application>Internet Junkbuster</application> is free software; you can
3251 redistribute it and/or modify it under the terms of the GNU General Public
3252 License as published by the Free Software Foundation; either version 2 of the
3253 License, or (at your option) any later version.
3257 This program is distributed in the hope that it will be useful, but WITHOUT
3258 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
3259 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
3260 details, which is available from <ulink
3261 url="http://www.gnu.org/copyleft/gpl.html">the Free Software Foundation,
3262 Inc</ulink>, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3267 <!-- ~ End section ~ -->
3270 <!-- ~~~~~ New section ~~~~~ -->
3273 <title>History</title>
3275 <application>Junkbuster</application> was originally written by Anonymous
3277 url="http://www.junkbusters.com/ht/en/ijbfaq.html">Junkbuster's
3278 Corporation</ulink>, and was released as free open-source software under the
3279 GNU GPL. <ulink url="http://www.waldherr.org/junkbuster/">Stefan
3280 Waldherr</ulink> made many improvements, and started the <ulink
3281 url="http://sourceforge.net/projects/ijbswa/">SourceForge project</ulink> to
3282 rekindle development. There are now several active developers contributing.
3283 The last stable release was v2.0.2, which has now grown whiskers ;-).
3290 <!-- ~~~~~ New section ~~~~~ -->
3291 <sect1 id="seealso"><title>See also</title>
3296 <ulink url="http://sourceforge.net/projects/ijbswa">http://sourceforge.net/projects/ijbswa</ulink>
3301 <ulink url="http://ijbswa.sourceforge.net/">http://ijbswa.sourceforge.net/</ulink>
3306 <ulink url="http://i.j.b/">http://i.j.b/</ulink>
3311 <ulink url="http://www.junkbusters.com/ht/en/cookies.html">http://www.junkbusters.com/ht/en/cookies.html</ulink>
3316 <ulink url="http://www.waldherr.org/junkbuster/">http://www.waldherr.org/junkbuster/</ulink>
3321 <ulink url="http://privacy.net/analyze/">http://privacy.net/analyze/</ulink>
3326 <ulink url="http://www.squid-cache.org/">http://www.squid-cache.org/</ulink>
3335 <!-- ~~~~~ New section ~~~~~ -->
3336 <sect1 id="appendix"><title>Appendix</title>
3339 <!-- ~~~~~ New section ~~~~~ -->
3341 <title>Regular Expressions</title>
3343 <application>Junkbuster</application> can use <quote>regular expressions</quote>
3344 in various config files. Assuming support for <quote>pcre</quote> (Perl
3345 Compatible Regular Expressions) is compiled in, which is the default. Such
3346 configuration directives do not require regular expressions, but they can be
3347 used to increase flexibility by matching a pattern with wild-cards against
3352 If you are reading this, you probably don't understand what <quote>regular
3353 expressions</quote> are, or what they can do. So this will be a very brief
3354 introduction only. A full explanation would require a book ;-)
3358 <quote>Regular expressions</quote> is a way of matching one character
3359 expression against another to see if it matches or not. One of the
3360 <quote>expressions</quote> is a literal string of readable characters
3361 (letter, numbers, etc), and the other is a complex string of literal
3362 characters combined with wild-cards, and other special characters, called
3363 meta-characters. The <quote>meta-characters</quote> have special meanings and
3364 are used to build the complex pattern to be matched against. Perl Compatible
3365 Regular Expressions is an enhanced form of the regular expression language
3366 with backward compatibility.
3370 To make a simple analogy, we do something similar when we use wild-card
3371 characters when listing files with the <command>dir</command> command in DOS.
3372 <literal>*.*</literal> matches all filenames. The <quote>special</quote>
3373 character here is the asterisk which matches any and all characters. We can be
3374 more specific and use <literal>?</literal> to match just individual
3375 characters. So <quote>dir file?.text</quote> would match
3376 <quote>file1.txt</quote>, <quote>file2.txt</quote>, etc. We are pattern
3377 matching, using a similar technique to <quote>regular expressions</quote>!
3381 Regular expressions do essentially the same thing, but are much, much more
3382 powerful. There are many more <quote>special characters</quote> and ways of
3383 building complex patterns however. Let's look at a few of the common ones,
3384 and then some examples:
3389 <emphasis>.</emphasis> - Matches any single character, e.g. <quote>a</quote>,
3390 <quote>A</quote>, <quote>4</quote>, <quote>:</quote>, or <quote>@</quote>.
3396 <emphasis>?</emphasis> - The preceding character or expression is matched ZERO or ONE
3403 <emphasis>+</emphasis> - The preceding character or expression is matched ONE or MORE
3410 <emphasis>*</emphasis> - The preceding character or expression is matched ZERO or MORE
3417 <emphasis>\</emphasis> - The <quote>escape</quote> character denotes that
3418 the following character should be taken literally. This is used where one of the
3419 special characters (e.g. <quote>.</quote>) needs to be taken literally and
3420 not as a special meta-character.
3426 <emphasis>[]</emphasis> - Characters enclosed in brackets will be matched if
3427 any of the enclosed characters are encountered.
3433 <emphasis>()</emphasis> - parentheses are used to group a sub-expression,
3434 or multiple sub-expressions.
3440 <emphasis>|</emphasis> - The <quote>bar</quote> character works like an
3441 <quote>or</quote> conditional statement. A match is successful if the
3442 sub-expression on either side of <quote>|</quote> matches.
3448 <emphasis>s/string1/string2/g</emphasis> - This is used to rewrite strings of text.
3449 <quote>string1</quote> is replaced by <quote>string2</quote> in this
3455 These are just some of the ones you are likely to use when matching URLs with
3456 <application>Junkbuster</application>, and is a long way from a definitive
3457 list. This is enough to get us started with a few simple examples which may
3458 be more illuminating:
3462 <emphasis><literal>/.*/banners/.*</literal></emphasis> - A simple example
3463 that uses the common combination of <quote>.</quote> and <quote>*</quote> to
3464 denote any character, zero or more times. In other words, any string at all.
3465 So we start with a literal forward slash, then our regular expression pattern
3466 (<quote>.*</quote>) another literal forward slash, the string
3467 <quote>banners</quote>, another forward slash, and lastly another
3468 <quote>.*</quote>. We are building
3469 a directory path here. This will match any file with the path that has a
3470 directory named <quote>banners</quote> in it. The <quote>.*</quote> matches
3471 any characters, and this could conceivably be more forward slashes, so it
3472 might expand into a much longer looking path. For example, this could match:
3473 <quote>/eye/hate/spammers/banners/annoy_me_please.gif</quote>, or just
3474 <quote>/banners/annoying.html</quote>, or almost an infinite number of other
3475 possible combinations, just so it has <quote>banners</quote> in the path
3480 A now something a little more complex:
3484 <emphasis><literal>/.*/adv((er)?ts?|ertis(ing|ements?))?/</literal></emphasis> -
3485 We have several literal forward slashes again (<quote>/</quote>), so we are
3486 building another expression that is a file path statement. We have another
3487 <quote>.*</quote>, so we are matching against any conceivable sub-path, just so
3488 it matches our expression. The only true literal that <emphasis>must
3489 match</emphasis> our pattern is <application>adv</application>, together with
3490 the forward slashes. What comes after the <quote>adv</quote> string is the
3495 Remember the <quote>?</quote> means the preceding expression (either a
3496 literal character or anything grouped with <quote>(...)</quote> in this case)
3497 can exist or not, since this means either zero or one match. So
3498 <quote>((er)?ts?|ertis(ing|ements?))</quote> is optional, as are the
3499 individual sub-expressions: <quote>(er)</quote>,
3500 <quote>(ing|ements?)</quote>, and the <quote>s</quote>. The <quote>|</quote>
3501 means <quote>or</quote>. We have two of those. For instance,
3502 <quote>(ing|ements?)</quote>, can expand to match either <quote>ing</quote>
3503 <emphasis>OR</emphasis> <quote>ements?</quote>. What is being done here, is an
3504 attempt at matching as many variations of <quote>advertisement</quote>, and
3505 similar, as possible. So this would expand to match just <quote>adv</quote>,
3506 or <quote>advert</quote>, or <quote>adverts</quote>, or
3507 <quote>advertising</quote>, or <quote>advertisement</quote>, or
3508 <quote>advertisements</quote>. You get the idea. But it would not match
3509 <quote>advertizements</quote> (with a <quote>z</quote>). We could fix that by
3510 changing our regular expression to:
3511 <quote>/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/</quote>, which would then match
3516 <emphasis><literal>/.*/advert[0-9]+\.(gif|jpe?g)</literal></emphasis> - Again
3517 another path statement with forward slashes. Anything in the square brackets
3518 <quote>[]</quote> can be matched. This is using <quote>0-9</quote> as a
3519 shorthand expression to mean any digit one through nine. It is the same as
3520 saying <quote>0123456789</quote>. So any digit matches. The <quote>+</quote>
3521 means one or more of the preceding expression must be included. The preceding
3522 expression here is what is in the square brackets -- in this case, any digit
3523 one through nine. Then, at the end, we have a grouping: <quote>(gif|jpe?g)</quote>.
3524 This includes a <quote>|</quote>, so this needs to match the expression on
3525 either side of that bar character also. A simple <quote>gif</quote> on one side, and the other
3526 side will in turn match either <quote>jpeg</quote> or <quote>jpg</quote>,
3527 since the <quote>?</quote> means the letter <quote>e</quote> is optional and
3528 can be matched once or not at all. So we are building an expression here to
3529 match image GIF or JPEG type image file. It must include the literal
3530 string <quote>advert</quote>, then one or more digits, and a <quote>.</quote>
3531 (which is now a literal, and not a special character, since it is escaped
3532 with <quote>\</quote>), and lastly either <quote>gif</quote>, or
3533 <quote>jpeg</quote>, or <quote>jpg</quote>. Some possible matches would
3534 include: <quote>//advert1.jpg</quote>,
3535 <quote>/nasty/ads/advert1234.gif</quote>,
3536 <quote>/banners/from/hell/advert99.jpg</quote>. It would not match
3537 <quote>advert1.gif</quote> (no leading slash), or
3538 <quote>/adverts232.jpg</quote> (the expression does not include an
3539 <quote>s</quote>), or <quote>/advert1.jsp</quote> (<quote>jsp</quote> is not
3540 in the expression anywhere).
3544 <emphasis><literal>s/microsoft(?!.com)/MicroSuck/i</literal></emphasis> - This is
3545 a substitution. <quote>MicroSuck</quote> will replace any occurrence of
3546 <quote>microsoft</quote>. The <quote>i</quote> at the end of the expression
3547 means ignore case. The <quote>(?!.com)</quote> means
3548 the match should fail if <quote>microsoft</quote> is followed by
3549 <quote>.com</quote>. In other words, this acts like a <quote>NOT</quote>
3550 modifier. In case this is a hyperlink, we don't want to break it ;-).
3554 We are barely scratching the surface of regular expressions here so that you
3555 can understand the default <application>Junkbuster</application>
3556 configuration files, and maybe use this knowledge to customize your own
3557 installation. There is much, much more that can be done with regular
3558 expressions. Now that you know enough to get started, you can learn more on
3563 More reading on Perl Compatible Regular expressions:
3564 <ulink url="http://www.perldoc.com/perl5.6/pod/perlre.html">http://www.perldoc.com/perl5.6/pod/perlre.html</ulink>
3569 <!-- ~ End section ~ -->
3572 <!-- ~~~~~ New section ~~~~~ -->
3574 <title>JunkBuster's Internal Pages</title>
3577 Since <application>JunkBuster</application> proxies each requested
3578 web page, it is easy for <application>JunkBuster</application> to
3579 trap certain URLs. In this way, we can talk directly to
3580 <application>JunkBuster</application>, and see how it is
3581 configured, see how our rules are being applied, change these
3582 rules and other configuration options, and even turn
3583 <application>JunkBuster's</application> filtering off, all with
3589 The URLs listed below are the special ones that allow direct access
3590 to <application>JunkBuster</application>. Of course,
3591 <application>JunkBuster</application> must be running to access these. If
3592 not, you will get a friendly error message. Internet access is not
3601 Junkbuster main page:
3605 <ulink url="http://ijbswa.sourceforge.net/config/">http://ijbswa.sourceforge.net/config/</ulink>
3609 Alternately, this may be reached at <ulink url="http://i.j.b/">http://i.j.b/</ulink>,
3610 but this variation may not work as reliably as the above in some
3617 Show information about the current configuration:
3621 <ulink url="http://ijbswa.sourceforge.net/config/show-status">http://ijbswa.sourceforge.net/config/show-status</ulink>
3628 Show the source code version numbers:
3632 <ulink url="http://ijbswa.sourceforge.net/config/show-version">http://ijbswa.sourceforge.net/config/show-version</ulink>
3639 Show the client's request headers:
3643 <ulink url="http://ijbswa.sourceforge.net/config/show-request">http://ijbswa.sourceforge.net/config/show-request</ulink>
3650 Show which actions apply to a URL and why:
3654 <ulink url="http://ijbswa.sourceforge.net/config/show-url-info">http://ijbswa.sourceforge.net/config/show-url-info</ulink>
3661 Toggle JunkBuster on or off:
3665 <ulink url="http://ijbswa.sourceforge.net/config/toggle">http://ijbswa.sourceforge.net/config/toggle</ulink>
3669 Short cuts. Turn off, then on:
3673 <ulink url="http://ijbswa.sourceforge.net/config/toggle?set=disable">http://ijbswa.sourceforge.net/config/toggle?set=disable</ulink>
3678 <ulink url="http://ijbswa.sourceforge.net/config/toggle?set=enable">http://ijbswa.sourceforge.net/config/toggle?set=enable</ulink>
3685 Edit the actions list file:
3689 <ulink url="http://ijbswa.sourceforge.net/config/edit-actions">http://ijbswa.sourceforge.net/config/edit-actions</ulink>
3698 These may be bookmarked for quick reference.
3705 <!-- ~~~~~ New section ~~~~~ -->
3706 <sect2 id="actionsanat">
3707 <title>Anatomy of an Action</title>
3710 The way <application>Junkbuster</application> applies <quote>actions</quote>
3711 to any given URL can be complex, and not always so easy to understand what
3712 is happening. And sometimes we need to be able to <emphasis>see</emphasis>
3713 just what <application>Junkbuster</application> is doing. Especially,
3714 if something <application>Junkbuster</application> is doing is causing
3715 us a problem inadvertantly. It can be a little daunting to look at
3716 the actions files themselves, since they tend to be filled with
3717 <quote>regular expressions</quote> whose consequences are not always
3722 First, you enter one URL (or partial URL), and this page will tell you how
3723 the currently configured <application>Junkbuster</application>
3724 <quote>actions</quote> are being applied to that specific URL. This will not
3725 help with filtering effects from the <filename>re_filterfile</filename>! It
3726 also will not tell you about any other URLs that may be embedded within the
3727 URL you are testing. For instance, images such as ads are expressed as URLs
3728 within the raw page source of HTML pages. So you will only get info for the
3729 actual URL that is pasted into the prompt area -- not any sub-URLs. If you
3730 want to know about embedded URLs like ads, you will have to dig those out of
3731 the HTML source. Use your browser's <quote>View Page Source</quote> option
3736 Let's look at an example, <ulink url="http://google.com">google.com</ulink>,
3737 one section at a time:
3742 System default actions:
3744 { -add-header -block -deanimate-gifs -downgrade -fast-redirects -filter
3745 -hide-forwarded -hide-from -hide-referer -hide-user-agent -image
3746 -image-blocker -limit-connect -no-compression -no-cookies-keep
3747 -no-cookies-read -no-cookies-set -no-popups -vanilla-wafer -wafer }
3753 This is the top section, and only tells us of the compiled in defaults. This
3754 is basically what <application>Junkbuster</application> would do if there
3755 were not any <quote>actions</quote> defined, i.e. it does nothing. Every action
3756 is disabled. This is not particularly informative for our purposes here. OK,
3763 Matches for http://google.com:
3765 { -add-header -block +deanimate-gifs -downgrade +fast-redirects
3766 +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}
3767 +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal}
3768 +filter{fun} +hide-forwarded +hide-from{block} +hide-referer{forge}
3769 -hide-user-agent -image +image-blocker{blank} +no-compression
3770 +no-cookies-keep -no-cookies-read -no-cookies-set +no-popups
3771 -vanilla-wafer -wafer }
3774 { -no-cookies-keep -no-cookies-read -no-cookies-set }
3784 This is much more informative, and tells us how we have defined our
3785 <quote>actions</quote>, and which ones match for our example,
3786 <quote>google.com</quote>. The first grouping shows our default
3787 settings, which would apply to all URLs. If you look at your <quote>actions</quote>
3788 file, this would be the section just below the <quote>aliases</quote> section
3789 near the top. This applies to all URLs as signified by the single forward
3790 slash -- <quote>/</quote>.
3795 These are the default actions we have enabled. But we can define additional
3796 actions that would be exceptions to these general rules, and then list
3797 specific URLs that these exceptions would apply to. Last match wins.
3798 Just below this then are two explict matches for <quote>.google.com</quote>.
3799 The first is negating our various cookie blocking actions (i.e. we will allow
3800 cookies here). The second is allowing <quote>fast-redirects</quote>. Note
3801 that there is a leading dot here -- <quote>.google.com</quote>. This will
3802 match any hosts and sub-domains, in the google.com domain also, such as
3803 <quote>www.google.com</quote>. So, apparently, we have these actions defined
3804 somewhere in the lower part of our actions file, and
3805 <quote>google.com</quote> is referenced in these sections.
3810 And now we pull it altogether in the bottom section and summarize how
3811 <application>Junkbuster</application> is appying all its <quote>actions</quote>
3812 to <quote>google.com</quote>:
3821 -add-header -block -deanimate-gifs -downgrade -fast-redirects
3822 +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}
3823 +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal}
3824 +filter{fun} +hide-forwarded +hide-from{block} +hide-referer{forge}
3825 -hide-user-agent -image +image-blocker{blank} -limit-connect +no-compression
3826 -no-cookies-keep -no-cookies-read -no-cookies-set +no-popups -vanilla-wafer
3833 Now another example, <quote>ad.doubleclick.net</quote>:
3852 We'll just show the interesting part here, the explicit matches. It is
3853 matched three different times. Each as an <quote>+block +image</quote>,
3854 which is the expanded form of one of our aliases that had been defined as:
3855 <quote>+imageblock</quote>. (<quote>Aliases</quote> are defined in the
3856 first section of the actions file and typically used to combine more
3861 Any one of these would have done the trick and blocked this as an unwanted
3862 image. This is unnecessarily redundant since the last case effectively
3863 would also cover the first. No point in taking chances with these guys
3864 though ;-) Note that if you want an ad or obnoxious
3865 URL to be invisible, it should be defined as <quote>ad.doubleclick.net</quote>
3866 is done here -- as both a <quote>+block</quote> <emphasis>and</emphasis> an
3867 <quote>+image</quote>. The custom alias <quote>+imageblock</quote> does this
3872 One last example. Let's try <quote>http://www.rhapsodyk.net/adsl/HOWTO/</quote>.
3873 This one is giving us problems. We are getting a blank page. Hmmm...
3879 Matches for http://www.rhapsodyk.net/adsl/HOWTO/:
3881 { -add-header -block +deanimate-gifs -downgrade +fast-redirects
3882 +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}
3883 +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal}
3884 +filter{fun} +hide-forwarded +hide-from{block} +hide-referer{forge}
3885 -hide-user-agent -image +image-blocker{blank} +no-compression
3886 +no-cookies-keep -no-cookies-read -no-cookies-set +no-popups
3887 -vanilla-wafer -wafer }
3897 Ooops, the <quote>/adsl/</quote> is matching <quote>/ads</quote>! But
3898 we did not want this at all! Now we see why we get the blank page. We could
3899 now add a new action below this that explictly does <emphasis>not</emphasis>
3900 block (-block) pages with <quote>adsl</quote>. There are various ways to
3901 handle such exceptions. Example:
3914 Now the page displays ;-)
3924 This program is free software; you can redistribute it
3925 and/or modify it under the terms of the GNU General
3926 Public License as published by the Free Software
3927 Foundation; either version 2 of the License, or (at
3928 your option) any later version.
3930 This program is distributed in the hope that it will
3931 be useful, but WITHOUT ANY WARRANTY; without even the
3932 implied warranty of MERCHANTABILITY or FITNESS FOR A
3933 PARTICULAR PURPOSE. See the GNU General Public
3934 License for more details.
3936 The GNU General Public License should be included with
3937 this file. If not, you can view it at
3938 http://www.gnu.org/copyleft/gpl.html
3939 or write to the Free Software Foundation, Inc., 59
3940 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
3942 $Log: user-manual.sgml,v $
3943 Revision 1.48 2002/03/12 06:33:01 hal9
3944 Catching up to Andreas and re_filterfile changes.
3946 Revision 1.47 2002/03/11 13:13:27 swa
3947 correct feedback channels
3949 Revision 1.46 2002/03/10 00:51:08 hal9
3950 Added section on JB internal pages in Appendix.
3952 Revision 1.45 2002/03/09 17:43:53 swa
3955 Revision 1.44 2002/03/09 17:08:48 hal9
3956 New section on Jon's actions file editor, and move some stuff around.
3958 Revision 1.43 2002/03/08 00:47:32 hal9
3959 Added imageblock{pattern}.
3961 Revision 1.42 2002/03/07 18:16:55 swa
3964 Revision 1.41 2002/03/07 16:46:43 hal9
3965 Fix a few markup problems for jade.
3967 Revision 1.40 2002/03/07 16:28:39 swa
3968 provide correct feedback channels
3970 Revision 1.39 2002/03/06 16:19:28 hal9
3971 Note on perceived filtering slowdown per FR.
3973 Revision 1.38 2002/03/05 23:55:14 hal9
3974 Stupid I did it again. Double hyphen in comment breaks jade.
3976 Revision 1.37 2002/03/05 23:53:49 hal9
3977 jade barfs on '- -' embedded in comments. - -user option broke it.
3979 Revision 1.36 2002/03/05 22:53:28 hal9
3980 Add new - - user option.
3982 Revision 1.35 2002/03/05 00:17:27 hal9
3983 Added section on command line options.
3985 Revision 1.34 2002/03/04 19:32:07 oes
3986 Changed default port to 8118
3988 Revision 1.33 2002/03/03 19:46:13 hal9
3989 Emphasis on where/how to report bugs, etc
3991 Revision 1.32 2002/03/03 09:26:06 joergs
3992 AmigaOS changes, config is now loaded from PROGDIR: instead of
3993 AmiTCP:db/junkbuster/ if no configuration file is specified on the
3996 Revision 1.31 2002/03/02 22:45:52 david__schmidt
3999 Revision 1.30 2002/03/02 22:00:14 hal9
4000 Updated 'New Features' list. Ran through spell-checker.
4002 Revision 1.29 2002/03/02 20:34:07 david__schmidt
4003 Update OS/2 build section
4005 Revision 1.28 2002/02/24 14:34:24 jongfoster
4006 Formatting changes. Now changing the doctype to DocBook XML 4.1
4007 will work - no other changes are needed.
4009 Revision 1.27 2002/01/11 14:14:32 hal9
4010 Added a very short section on Templates
4012 Revision 1.26 2002/01/09 20:02:50 hal9
4013 Fix bug re: auto-detect config file changes.
4015 Revision 1.25 2002/01/09 18:20:30 hal9
4016 Touch ups for *.action files.
4018 Revision 1.24 2001/12/02 01:13:42 hal9
4021 Revision 1.23 2001/12/02 00:20:41 hal9
4022 Updates for recent changes.
4024 Revision 1.22 2001/11/05 23:57:51 hal9
4025 Minor update for startup now daemon mode.
4027 Revision 1.21 2001/10/31 21:11:03 hal9
4028 Correct 2 minor errors
4030 Revision 1.18 2001/10/24 18:45:26 hal9
4031 *** empty log message ***
4033 Revision 1.17 2001/10/24 17:10:55 hal9
4034 Catching up with Jon's recent work, and a few other things.
4036 Revision 1.16 2001/10/21 17:19:21 swa
4037 wrong url in documentation
4039 Revision 1.15 2001/10/14 23:46:24 hal9
4040 Various minor changes. Fleshed out SEE ALSO section.
4042 Revision 1.13 2001/10/10 17:28:33 hal9
4045 Revision 1.12 2001/09/28 02:57:04 hal9
4048 Revision 1.11 2001/09/28 02:25:20 hal9
4051 Revision 1.9 2001/09/27 23:50:29 hal9
4052 A few changes. A short section on regular expression in appendix.
4054 Revision 1.8 2001/09/25 00:34:59 hal9
4055 Some additions, and re-arranging.
4057 Revision 1.7 2001/09/24 14:31:36 hal9
4060 Revision 1.6 2001/09/24 14:10:32 hal9
4061 Including David's OS/2 installation instructions.
4063 Revision 1.2 2001/09/13 15:27:40 swa
4066 Revision 1.1 2001/09/12 15:36:41 swa
4067 source files for junkbuster documentation
4069 Revision 1.3 2001/09/10 17:43:59 swa
4070 first proposal of a structure.
4072 Revision 1.2 2001/06/13 14:28:31 swa
4073 docs should have an author.
4075 Revision 1.1 2001/06/13 14:20:37 swa
4076 first import of project's documentation for the webserver.