3 By: Junkbuster Developers
5 $Id: user-manual.sgml,v 1.48 2002/03/12 06:33:01 hal9 Exp $
7 The user manual gives users information on how to install, configure and use
8 Internet Junkbuster. Internet Junkbuster is a web proxy with advanced filtering
9 capabilities for protecting privacy, filtering web page content, managing
10 cookies, controlling access, and removing ads, banners, pop-ups and other
11 obnoxious Internet Junk. Junkbuster has a very flexible configuration and can
12 be customized to suit individual needs and tastes. Internet Junkbuster has
13 application for both stand-alone systems and multi-user networks.
15 You can find the latest version of the user manual at http://
16 ijbswa.sourceforge.net/user-manual/.
18 -------------------------------------------------------------------------------
34 3. JunkBuster Configuration
36 3.1. Controlling Junkbuster with Your Web Browser
37 3.2. Configuration Files Overview
38 3.3. The Main Configuration File
40 3.3.1. Defining Other Configuration Files
41 3.3.2. Other Configuration Options
42 3.3.3. Access Control List (ACL)
44 3.3.5. Windows GUI Options
48 3.4.1. URL Domain and Path Syntax
55 4. Quickstart to Using Junkbuster
57 4.1. Command Line Options
59 5. Contacting the Developers, Bug Reporting and Feature Requests
60 6. Copyright and History
68 8.1. Regular Expressions
69 8.2. JunkBuster's Internal Pages
70 8.3. Anatomy of an Action
74 Internet Junkbuster is a web proxy with advanced filtering capabilities for
75 protecting privacy, filtering and modifying web page content, managing cookies,
76 controlling access, and removing ads, banners, pop-ups and other obnoxious
77 Internet Junk. Junkbuster has a very flexible configuration and can be
78 customized to suit individual needs and tastes. Internet Junkbuster has
79 application for both stand-alone systems and multi-user networks.
81 This documentation is included with the current BETA version of Internet
82 Junkbuster and is mostly complete at this point. The most up to date reference
83 for the time being is still the comments in the source files and in the
84 individual configuration files. Development of version 3.0 is currently nearing
85 completion, and includes many significant changes and enhancements over earlier
86 versions. The target release date for stable v3.0 is "soon" ;-)
88 Since this is a BETA version, not all new features are well tested. This
89 documentation may be slightly out of sync as a result (especially with CVS
90 sources). And there may be bugs, though hopefully not many!
92 -------------------------------------------------------------------------------
96 In addition to Junkbuster's traditional features of ad and banner blocking and
97 cookie management, this is a list of new features currently under development:
99 * Integrated browser based configuration and control utility (http://i.j.b).
100 Browser-based tracing of rule and filter effects.
102 * Blocking of annoying pop-up browser windows.
104 * HTTP/1.1 compliant (most, but not all 1.1 features are supported).
106 * Support for Perl Compatible Regular Expressions in the configuration files,
107 and generally a more sophisticated and flexible configuration syntax over
112 * Web page content filtering (removes banners based on size, invisible
113 "web-bugs", JavaScript, pop-ups, status bar abuse, etc.)
115 * Bypass many click-tracking scripts (avoids script redirection).
117 * Multi-threaded (POSIX and native threads).
119 * Auto-detection and re-reading of config file changes.
121 * User-customizable HTML templates (e.g. 404 error page).
123 * Improved cookie management features (e.g. session based cookies).
125 * Builds from source on most UNIX-like systems. Packages available for: Linux
126 (RedHat, SuSE, or Debian), Windows, Sun Solaris, Mac OSX, OS/2, HP-UX 11
129 * In addition, the configuration is much more powerful and versatile
132 -------------------------------------------------------------------------------
136 Junkbuster is available as raw source code, or pre-compiled binaries. See the
137 Junkbuster Home Page for binaries and current release info. Junkbuster is also
138 available via CVS. This is the recommended approach at this time. But please be
139 aware that CVS is constantly changing, and it may break in mysterious ways.
141 -------------------------------------------------------------------------------
145 For gzipped tar archives, unpack the source:
147 tar xzvf ijb_source_* [.tgz or .tar.gz]
148 cd ijb_source_2.9.11_beta
151 For retrieving the current CVS sources, you'll need the CVS package installed
152 first. To download CVS source:
154 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
155 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co current
159 This will create a directory named current/, which will contain the source
162 Then, in either case, to build from tarball/CVS source:
164 ./configure (--help to see options)
165 make (the make from gnu, gmake for *BSD)
167 make -n install (to see where all the files will go)
168 make install (to really install)
171 For Redhat and SuSE Linux RPM packages, see below.
173 -------------------------------------------------------------------------------
177 To build Redhat RPM packages, install source as above. Then:
179 autoheader [suggested for CVS source]
180 autoconf [suggested for CVS source]
185 This will create both binary and src RPMs in the usual places. Example:
187 /usr/src/redhat/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
189 /usr/src/redhat/SRPMS/junkbuster-2.9.11-1.src.rpm
191 To install, of course:
193 rpm -Uvv /usr/src/redhat/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
196 This will place the Junkbuster configuration files in /etc/junkbuster/, and log
197 files in /var/log/junkbuster/.
199 -------------------------------------------------------------------------------
203 To build SuSE RPM packages, install source as above. Then:
205 autoheader [suggested for CVS source]
206 autoconf [suggested for CVS source]
211 This will create both binary and src RPMs in the usual places. Example:
213 /usr/src/packages/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
215 /usr/src/packages/SRPMS/junkbuster-2.9.11-1.src.rpm
217 To install, of course:
219 rpm -Uvv /usr/src/packages/RPMS/i686/junkbuster-2.9.11-1.i686.rpm
222 This will place the Junkbuster configuration files in /etc/junkbuster/, and log
223 files in /var/log/junkbuster/.
225 -------------------------------------------------------------------------------
229 Junkbuster is packaged in a WarpIN self- installing archive. The
230 self-installing program will be named depending on the release version,
231 something like: ijbos2_setup_1.2.3.exe. In order to install it, simply run this
232 executable or double-click on its icon and follow the WarpIN installation
233 panels. A shadow of the Junkbuster executable will be placed in your startup
234 folder so it will start automatically whenever OS/2 starts.
236 The directory you choose to install Junkbuster into will contain all of the
239 If you would like to build binary images on OS/2 yourself, you will need a few
240 Unix-like tools: autoconf, autoheader and sh. These tools will be used to
241 create the required config.h file, which is not part of the source distribution
242 because it differs based on platform. You will also need a compiler. The
243 distribution has been created using IBM VisualAge compilers, but you can use
244 any compiler you like. GCC/EMX has the disadvantage of needing to be
245 single-threaded due to a limitation of EMX's implementation of the select()
248 In addition to needing the source code distribution as outlined earlier, you
249 will want to extract the os2seutp directory from CVS:
251 cvs -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa login
252 cvs -z3 -d:pserver:anonymous@cvs.ijbswa.sourceforge.net:/cvsroot/ijbswa co os2setup
255 This will create a directory named os2setup/, which will contain the
256 Makefile.vac makefile and os2build.cmd which is used to completely create the
257 binary distribution. The sequence of events for building the executable for
258 yourself goes something like this:
265 nmake -f Makefile.vac
268 You will see this sequence laid out in os2build.cmd.
270 -------------------------------------------------------------------------------
274 Click-click. (I need help on this. Not a clue here. Also for configuration
277 -------------------------------------------------------------------------------
281 Some quick notes on other Operating Systems.
283 For FreeBSD (and other *BSDs?), the build will require gmake instead of the
284 included make. gmake is available from http://www.gnu.org. The rest should be
285 the same as above for Linux/Unix.
287 -------------------------------------------------------------------------------
289 3. JunkBuster Configuration
291 All JunkBuster configuration is kept in text files. These files can be edited
292 with a text editor. Many important aspects of JunkBuster can also be controlled
293 easily with a web browser.
295 -------------------------------------------------------------------------------
297 3.1. Controlling Junkbuster with Your Web Browser
299 JunkBuster can be reached by the special URL http://i.j.b/ (or alternately
300 http://ijbswa.sourceforge.net/config/), which is an internal page. You will see
301 the following section:
303 Please choose from the following options:
305 * Show information about the current configuration
306 * Show the source code version numbers
307 * Show the client's request headers.
308 * Show which actions apply to a URL and why
309 * Toggle JunkBuster on or off
310 * Edit the actions list
314 This should be self-explanatory. Note the last item is an editor for the
315 "actions list", which is where much of the ad, banner, cookie, and URL blocking
316 magic is configured as well as other advanced features of Junkbuster. This is
317 an easy way to adjust various aspects of Junkbuster configuration. The actions
318 file, and other configuration files, are explained in detail below. Junkbuster
319 will automatically detect any changes to these files.
321 "Toggle JunkBuster On or Off" is handy for sites that might have problems with
322 your current actions and filters, or just to test if a site misbehaves, whether
323 it is JunkBuster causing the problem or not. Junkbuster continues to run as a
324 proxy in this case, but all filtering is disabled.
326 -------------------------------------------------------------------------------
328 3.2. Configuration Files Overview
330 For Unix, *BSD and Linux, all configuration files are located in /etc/
331 junkbuster/ by default. For MS Windows, OS/2, and AmigaOS these are all in the
332 same directory as the Junkbuster executable. The name and number of
333 configuration files has changed from previous versions, and is subject to
334 change as development progresses.
336 The installed defaults provide a reasonable starting point, though possibly
337 aggressive by some standards. For the time being, there are only three default
338 configuration files (this will change in time):
340 * The main configuration file is named config on Linux, Unix, BSD, OS/2, and
341 AmigaOS and config.txt on Windows.
343 * The ijb.action file is used to define various "actions" relating to images,
344 banners, pop-ups, access restrictions, banners and cookies. There is a CGI
345 based editor for this file that can be accessed via http://i.j.b. (Other
346 actions files are included as well with differing levels of filtering and
347 blocking, e.g. ijb-basic.action.)
349 * The re_filterfile file can be used to re-write the raw page content,
350 including viewable text as well as embedded HTML and JavaScript, and
351 whatever else lurks on any given web page.
353 ijb.action and re_filterfile can use Perl style regular expressions for maximum
354 flexibility. All files use the "#" character to denote a comment. Such lines
355 are not processed by Junkbuster. After making any changes, there is no need to
356 restart Junkbuster in order for the changes to take effect. Junkbuster should
357 detect such changes automatically.
359 While under development, the configuration content is subject to change. The
360 below documentation may not be accurate by the time you read this. Also, what
361 constitutes a "default" setting, may change, so please check all your
362 configuration files on important issues.
364 -------------------------------------------------------------------------------
366 3.3. The Main Configuration File
368 Again, the main configuration file is named config on Linux/Unix/BSD and OS/2,
369 and config.txt on Windows. Configuration lines consist of an initial keyword
370 followed by a list of values, all separated by whitespace (any number of spaces
371 or tabs). For example:
373 blockfile blocklist.ini
376 Indicates that the blockfile is named "blocklist.ini". (A default installation
379 A "#" indicates a comment. Any part of a line following a "#" is ignored,
380 except if the "#" is preceded by a "\".
382 Thus, by placing a "#" at the start of an existing configuration line, you can
383 make it a comment and it will be treated as if it weren't there. This is called
384 "commenting out" an option and can be useful to turn off features: If you
385 comment out the "logfile" line, junkbuster will not log to a file at all. Watch
386 for the "default:" section in each explanation to see what happens if the
387 option is left unset (or commented out).
389 Long lines can be continued on the next line by using a "\" as the very last
392 There are various aspects of Junkbuster behavior that can be tuned.
394 -------------------------------------------------------------------------------
396 3.3.1. Defining Other Configuration Files
398 Junkbuster can use a number of other files to tell it what ads to block, what
399 cookies to accept, etc. This section of the configuration file tells Junkbuster
400 where to find all those other files.
402 On Windows and AmigaOS, Junkbuster looks for these files in the same directory
403 as the executable. On Unix and OS/2, Junkbuster looks for these files in the
404 current working directory. In either case, an absolute path name can be used to
407 When development goes modular and multi-user, the blocker, filter, and per-user
408 config will be stored in subdirectories of "confdir". For now, only confdir/
409 templates is used for storing HTML templates for CGI results.
411 The location of the configuration files:
413 confdir /etc/junkbuster # No trailing /, please.
416 The directory where all logging (i.e. logfile and jarfile) takes place. No
417 trailing "/", please:
419 logdir /var/log/junkbuster
422 Note that all file specifications below are relative to the above two
425 The "ijb.action" file contains patterns to specify the actions to apply to
426 requests for each site. Default: Cookies to and from all destinations are kept
427 only during the current browser session (i.e. they are not saved to disk).
428 Pop-ups are disabled for all sites. All sites are filtered through selected
429 sections of "re_filterfile". No sites are blocked. The JunkBuster logo is
430 displayed for filtered ads and other images. The syntax of this file is
431 explained in detail below. Other "actions" files are included, and you are free
432 to use any of them. They have varying degrees of aggressiveness.
434 actionsfile ijb.action
437 The "re_filterfile" file contains content modification rules that use "regular
438 expressions". These rules permit powerful changes on the content of Web pages,
439 e.g., you could disable your favorite JavaScript annoyances, re-write the
440 actual displayed text, or just have some fun replacing "Microsoft" with
441 "MicroSuck" wherever it appears on a Web page. Default: whatever the developers
444 Filtering requires buffering the page content, which may appear to slow down
445 page rendering since nothing is displayed until all content has passed the
446 filters. (It does not really take longer, but seems that way since the page is
447 not incrementally displayed.) This effect will be more noticeable on slower
450 re_filterfile re_filterfile
453 The logfile is where all logging and error messages are written. The logfile
454 can be useful for tracking down a problem with Junkbuster (e.g., it's not
455 blocking an ad you think it should block) but in most cases you probably will
458 Your logfile will grow indefinitely, and you will probably want to periodically
459 remove it. On Unix systems, you can do this with a cron job (see "man cron").
460 For Redhat, a logrotate script has been included.
462 On SuSE Linux systems, you can place a line like "/var/log/junkbuster.* +1024k
463 644 nobody.nogroup" in /etc/logfiles, with the effect that cron.daily will
464 automatically archive, gzip, and empty the log, when it exceeds 1M size.
466 Default: Log to the a file named logfile. Comment out to disable logging.
471 The "jarfile" defines where Junkbuster stores the cookies it intercepts. Note
472 that if you use a "jarfile", it may grow quite large. Default: Don't store
478 If you specify a "trustfile", Junkbuster will only allow access to sites that
479 are named in the trustfile. You can also mark sites as trusted referrers, with
480 the effect that access to untrusted sites will be granted, if a link from a
481 trusted referrer was used. The link target will then be added to the
482 "trustfile". This is a very restrictive feature that typical users most
483 probably want to leave disabled. Default: Disabled, don't use the trust
489 If you use the trust mechanism, it is a good idea to write up some on-line
490 documentation about your blocking policy and to specify the URL(s) here. They
491 will appear on the page that your users receive when they try to access
492 untrusted content. Use multiple times for multiple URLs. Default: Don't display
493 links on the "untrusted" info page.
495 trust-info-url http://www.your-site.com/why_we_block.html
496 trust-info-url http://www.your-site.com/what_we_allow.html
499 -------------------------------------------------------------------------------
501 3.3.2. Other Configuration Options
503 This part of the configuration file contains options that control how
506 "Admin-address" should be set to the email address of the proxy administrator.
507 It is used in many of the proxy-generated pages. Default: fill@me.in.please.
509 #admin-address fill@me.in.please
512 "Proxy-info-url" can be set to a URL that contains more info about this
513 Junkbuster installation, it's configuration and policies. It is used in many of
514 the proxy-generated pages and its use is highly recommended in multi-user
515 installations, since your users will want to know why certain content is
516 blocked or modified. Default: Don't show a link to on-line documentation.
518 proxy-info-url http://www.your-site.com/proxy.html
521 "Listen-address" specifies the address and port where Junkbuster will listen
522 for connections from your Web browser. The default is to listen on the
523 localhost port 8118, and this is suitable for most users. (In your web browser,
524 under proxy configuration, list the proxy server as "localhost" and the port as
527 If you already have another service running on port 8118, or if you want to
528 serve requests from other machines (e.g. on your local network) as well, you
529 will need to override the default. The syntax is "listen-address
530 [<ip-address>]:<port>". If you leave out the IP address, junkbuster will bind
531 to all interfaces (addresses) on your machine and may become reachable from the
532 Internet. In that case, consider using access control lists (acl's) (see
533 "aclfile" above), or a firewall.
535 For example, suppose you are running Junkbuster on a machine which has the
536 address 192.168.0.1 on your local private network (192.168.0.0) and has another
537 outside connection with a different address. You want it to serve requests from
540 listen-address 192.168.0.1:8118
543 If you want it to listen on all addresses (including the outside connection):
548 If you do this, consider using ACLs (see "aclfile" above). Note: you will need
549 to point your browser(s) to the address and port that you have configured here.
550 Default: localhost:8118 (127.0.0.1:8118).
552 The debug option sets the level of debugging information to log in the logfile
553 (and to the console in the Windows version). A debug level of 1 is informative
554 because it will show you each request as it happens. Higher levels of debug are
555 probably only of interest to developers.
557 debug 1 # GPC = show each GET/POST/CONNECT request
558 debug 2 # CONN = show each connection status
559 debug 4 # IO = show I/O status
560 debug 8 # HDR = show header parsing
561 debug 16 # LOG = log all data into the logfile
562 debug 32 # FRC = debug force feature
563 debug 64 # REF = debug regular expression filter
564 debug 128 # = debug fast redirects
565 debug 256 # = debug GIF de-animation
566 debug 512 # CLF = Common Log Format
567 debug 1024 # = debug kill pop-ups
568 debug 4096 # INFO = Startup banner and warnings.
569 debug 8192 # ERROR = Non-fatal errors
572 It is highly recommended that you enable ERROR reporting (debug 8192), at least
573 until v3.0 is released.
575 The reporting of FATAL errors (i.e. ones which crash JunkBuster) is always on
576 and cannot be disabled.
578 If you want to use CLF (Common Log Format), you should set "debug 512" ONLY, do
579 not enable anything else.
581 Multiple "debug" directives, are OK - they're logical-OR'd together.
583 debug 15 # same as setting the first 4 listed above
590 debug 8192 # Errors - *we highly recommended enabling this*
593 Junkbuster normally uses "multi-threading", a software technique that permits
594 it to handle many different requests simultaneously. In some cases you may wish
595 to disable this -- particularly if you're trying to debug a problem. The
596 "single-threaded" option forces Junkbuster to handle requests sequentially.
597 Default: Multi-threaded mode.
602 "toggle" allows you to temporarily disable all Junkbuster's filtering. Just set
605 The Windows version of Junkbuster puts an icon in the system tray, which also
606 allows you to change this option. If you right-click on that icon (or select
607 the "Options" menu), one choice is "Enable". Clicking on enable toggles
608 Junkbuster on and off. This is useful if you want to temporarily disable
609 Junkbuster, e.g., to access a site that requires cookies which you would
610 otherwise have blocked. This can also be toggled via a web browser at the
611 Junkbuster internal address of http://i.j.b on any platform.
613 "toggle 1" means Junkbuster runs normally, "toggle 0" means that Junkbuster
614 becomes a non-anonymizing non-blocking proxy. Default: 1 (on).
619 For content filtering, i.e. the "+filter" and "+deanimate-gif" actions, it is
620 necessary that Junkbuster buffers the entire document body. This can be
621 potentially dangerous, since a server could just keep sending data indefinitely
622 and wait for your RAM to exhaust. With nasty consequences.
624 The buffer-limit option lets you set the maximum size in Kbytes that each
625 buffer may use. When the documents buffer exceeds this size, it is flushed to
626 the client unfiltered and no further attempt to filter the rest of it is made.
627 Remember that there may multiple threads running, which might require
628 increasing the "buffer-limit" Kbytes each, unless you have enabled
629 "single-threaded" above.
634 To enable the web-based ijb.action file editor set enable-edit-actions to 1, or
635 0 to disable. Note that you must have compiled JunkBuster with support for this
636 feature, otherwise this option has no effect. This internal page can be reached
639 Security note: If this is enabled, anyone who can use the proxy can edit the
640 actions file, and their changes will affect all users. For shared proxies, you
641 probably want to disable this. Default: enabled.
643 enable-edit-actions 1
646 Allow JunkBuster to be toggled on and off remotely, using your web browser. Set
647 "enable-remote-toggle"to 1 to enable, and 0 to disable. Note that you must have
648 compiled JunkBuster with support for this feature, otherwise this option has no
651 Security note: If this is enabled, anyone who can use the proxy can toggle it
652 on or off (see http://i.j.b), and their changes will affect all users. For
653 shared proxies, you probably want to disable this. Default: enabled.
655 enable-remote-toggle 1
658 -------------------------------------------------------------------------------
660 3.3.3. Access Control List (ACL)
662 Access controls are included at the request of some ISPs and systems
663 administrators, and are not usually needed by individual users. Please note the
664 warnings in the FAQ that this proxy is not intended to be a substitute for a
665 firewall or to encourage anyone to defer addressing basic security weaknesses.
667 If no access settings are specified, the proxy talks to anyone that connects.
668 If any access settings file are specified, then the proxy talks only to IP
669 addresses permitted somewhere in this file and not denied later in this file.
671 Summary -- if using an ACL:
673 Client must have permission to receive service.
675 LAST match in ACL wins.
677 Default behavior is to deny service.
679 The syntax for an entry in the Access Control List is:
681 ACTION SRC_ADDR[/SRC_MASKLEN] [ DST_ADDR[/DST_MASKLEN] ]
684 Where the individual fields are:
686 ACTION = "permit-access" or "deny-access"
688 SRC_ADDR = client hostname or dotted IP address
689 SRC_MASKLEN = number of bits in the subnet mask for the source
691 DST_ADDR = server or forwarder hostname or dotted IP address
692 DST_MASKLEN = number of bits in the subnet mask for the target
695 The field separator (FS) is whitespace (space or tab).
697 IMPORTANT NOTE: If the junkbuster is using a forwarder (see below) or a gateway
698 for a particular destination URL, the DST_ADDR that is examined is the address
699 of the forwarder or the gateway and NOT the address of the ultimate target.
700 This is necessary because it may be impossible for the local Junkbuster to
701 determine the address of the ultimate target (that's often what gateways are
704 Here are a few examples to show how the ACL features work:
706 "localhost" is OK -- no DST_ADDR implies that ALL destination addresses are OK:
708 permit-access localhost
711 A silly example to illustrate permitting any host on the class-C subnet with
712 Junkbuster to go anywhere:
714 permit-access www.junkbusters.com/24
717 Except deny one particular IP address from using it at all:
719 deny-access ident.junkbusters.com
722 You can also specify an explicit network address and subnet mask. Explicit
723 addresses do not have to be resolved to be used.
725 permit-access 207.153.200.0/24
728 A subnet mask of 0 matches anything, so the next line permits everyone.
730 permit-access 0.0.0.0/0
733 Note, you cannot say:
738 to allow all *.org domains. Every IP address listed must resolve fully.
740 An ISP may want to provide a Junkbuster that is accessible by "the world" and
741 yet restrict use of some of their private content to hosts on its internal
742 network (i.e. its own subscribers). Say, for instance the ISP owns the Class-B
743 IP address block 123.124.0.0 (a 16 bit netmask). This is how they could do it:
745 permit-access 0.0.0.0/0 0.0.0.0/0 # other clients can go anywhere
746 # with the following exceptions:
748 deny-access 0.0.0.0/0 123.124.0.0/16 # block all external requests for
749 # sites on the ISP's network
751 permit 0.0.0.0/0 www.my_isp.com # except for the ISP's main
754 permit 123.124.0.0/16 0.0.0.0/0 # the ISP's clients can go
758 Note that if some hostnames are listed with multiple IP addresses, the primary
759 value returned by DNS (via gethostbyname()) is used. Default: Anyone can access
762 -------------------------------------------------------------------------------
766 This feature allows chaining of HTTP requests via multiple proxies. It can be
767 used to better protect privacy and confidentiality when accessing specific
768 domains by routing requests to those domains to a special purpose filtering
769 proxy such as lpwa.com. Or to use a caching proxy to speed up browsing.
771 It can also be used in an environment with multiple networks to route requests
772 via multiple gateways allowing transparent access to multiple networks without
773 having to modify browser configurations.
775 Also specified here are SOCKS proxies. Junkbuster SOCKS 4 and SOCKS 4A. The
776 difference is that SOCKS 4A will resolve the target hostname using DNS on the
777 SOCKS server, not our local DNS client.
779 The syntax of each line is:
781 forward target_domain[:port] http_proxy_host[:port]
782 forward-socks4 target_domain[:port] socks_proxy_host[:port] http_proxy_host[:
784 forward-socks4a target_domain[:port] socks_proxy_host[:port] http_proxy_host[:
788 If http_proxy_host is ".", then requests are not forwarded to a HTTP proxy but
789 are made directly to the web servers.
791 Lines are checked in sequence, and the last match wins.
793 There is an implicit line equivalent to the following, which specifies that
794 anything not finding a match on the list is to go out without forwarding or
795 gateway protocol, like so:
797 forward .* . # implicit
800 In the following common configuration, everything goes to Lucent's LPWA, except
801 SSL on port 443 (which it doesn't handle):
803 forward .* lpwa.com:8000
807 Some users have reported difficulties related to LPWA's use of "." as the last
808 element of the domain, and have said that this can be fixed with this:
810 forward lpwa. lpwa.com:8000
813 (NOTE: the syntax for specifying target_domain has changed since the previous
814 paragraph was written -- it will not work now. More information is welcome.)
816 In this fictitious example, everything goes via an ISP's caching proxy, except
817 requests to that ISP:
819 forward .* caching.myisp.net:8000
823 For the @home network, we're told the forwarding configuration is this:
825 forward .* proxy:8080
828 Also, we're told they insist on getting cookies and JavaScript, so you should
829 allow cookies from home.com. We consider JavaScript a potential security risk.
830 Java need not be enabled.
832 In this example direct connections are made to all "internal" domains, but
833 everything else goes through Lucent's LPWA by way of the company's SOCKS
834 gateway to the Internet.
836 forward-socks4 .* lpwa.com:8000 firewall.my_company.com:1080
837 forward my_company.com .
840 This is how you could set up a site that always uses SOCKS but no forwarders:
842 forward-socks4a .* . firewall.my_company.com:1080
845 An advanced example for network administrators:
847 If you have links to multiple ISPs that provide various special content to
848 their subscribers, you can configure forwarding to pass requests to the
849 specific host that's connected to that ISP so that everybody can see all of the
850 content on all of the ISPs.
852 This is a bit tricky, but here's an example:
854 host-a has a PPP connection to isp-a.com. And host-b has a PPP connection to
855 isp-b.com. host-a can run a Junkbuster proxy with forwarding like this:
858 forward isp-b.com host-b:8118
861 host-b can run a Junkbuster proxy with forwarding like this:
864 forward isp-a.com host-a:8118
867 Now, anyone on the Internet (including users on host-a and host-b) can set
868 their browser's proxy to either host-a or host-b and be able to browse the
869 content on isp-a or isp-b.
871 Here's another practical example, for University of Kent at Canterbury students
872 with a network connection in their room, who need to use the University's Squid
875 forward *. ssbcache.ukc.ac.uk:3128 # Use the proxy, except for:
876 forward .ukc.ac.uk . # Anything on the same domain as us
877 forward * . # Host with no domain specified
878 forward 129.12.*.* . # A dotted IP on our /16 network.
879 forward 127.*.*.* . # Loopback address
880 forward localhost.localdomain . # Loopback address
881 forward www.ukc.mirror.ac.uk . # Specific host
884 If you intend to chain Junkbuster and squid locally, then chain as browser ->
885 squid -> junkbuster is the recommended way.
887 Your squid configuration could then look like this:
889 # Define junkbuster as parent cache
891 cache_peer 127.0.0.1 parent 8118 0 no-query
893 # Define ACL for protocol FTP
896 # Do not forward ACL FTP to junkbuster
897 always_direct allow FTP
899 # Do not forward ACL CONNECT (https) to junkbuster
900 always_direct allow CONNECT
902 # Forward the rest to junkbuster
903 never_direct allow all
906 -------------------------------------------------------------------------------
908 3.3.5. Windows GUI Options
910 Junkbuster has a number of options specific to the Windows GUI interface:
912 If "activity-animation" is set to 1, the Junkbuster icon will animate when
913 "Junkbuster" is active. To turn off, set to 0.
918 If "log-messages" is set to 1, Junkbuster will log messages to the console
924 If "log-buffer-size" is set to 1, the size of the log buffer, i.e. the amount
925 of memory used for the log messages displayed in the console window, will be
926 limited to "log-max-lines" (see below).
928 Warning: Setting this to 0 will result in the buffer to grow infinitely and eat
934 log-max-lines is the maximum number of lines held in the log buffer. See above.
939 If "log-highlight-messages" is set to 1, Junkbuster will highlight portions of
940 the log messages with a bold-faced font:
942 log-highlight-messages 1
945 The font used in the console window:
947 log-font-name Comic Sans MS
950 Font size used in the console window:
955 "show-on-task-bar" controls whether or not Junkbuster will appear as a button
956 on the Task bar when minimized:
961 If "close-button-minimizes" is set to 1, the Windows close button will minimize
962 Junkbuster instead of closing the program (close with the exit option on the
965 close-button-minimizes 1
968 The "hide-console" option is specific to the MS-Win console version of
969 JunkBuster. If this option is used, Junkbuster will disconnect from and hide
975 -------------------------------------------------------------------------------
977 3.4. The Actions File
979 The "ijb.action" file (formerly actionsfile) is used to define what actions
980 Junkbuster takes, and thus determines how images, cookies and various other
981 aspects of HTTP content and transactions are handled. Images can be anything
982 you want, including ads, banners, or just some obnoxious URL that you would
983 rather not see. Cookies can be accepted or rejected, or accepted only during
984 the current browser session (i.e. not written to disk). Changes to ijb.action
985 should be immediately visible to Junkbuster without the need to restart.
987 To determine which actions apply to a request, the URL of the request is
988 compared to all patterns in this file. Every time it matches, the list of
989 applicable actions for the URL is incrementally updated. You can trace this
990 process by visiting http://i.j.b/show-url-info.
992 The actions file can be edited with a browser by loading http://i.j.b/, and
993 then select "Edit Actions List".
995 There are four types of lines in this file: comments (begin with a "#"
996 character), actions, aliases and patterns, all of which are explained below, as
997 well as the configuration file syntax that Junkbuster understands.
999 -------------------------------------------------------------------------------
1001 3.4.1. URL Domain and Path Syntax
1003 Generally, a pattern has the form <domain>/<path>, where both the <domain> and
1004 <path> part are optional. If you only specify a domain part, the "/" can be
1007 www.example.com - is a domain only pattern and will match any request to
1010 www.example.com/ - means exactly the same.
1012 www.example.com/index.html - matches only the single document "/index.html" on
1015 /index.html - matches the document "/index.html", regardless of the domain.
1017 index.html - matches nothing, since it would be interpreted as a domain name
1018 and there is no top-level domain called ".html".
1020 The matching of the domain part offers some flexible options: if the domain
1021 starts or ends with a dot, it becomes unanchored at that end. For example:
1023 .example.com - matches any domain that ENDS in ".example.com".
1025 www. - matches any domain that STARTS with "www".
1027 Additionally, there are wild-cards that you can use in the domain names
1028 themselves. They work pretty similar to shell wild-cards: "*" stands for zero
1029 or more arbitrary characters, "?" stands for any single character. And you can
1030 define character classes in square brackets and they can be freely mixed:
1032 ad*.example.com - matches "adserver.example.com", "ads.example.com", etc but
1033 not "sfads.example.com".
1035 *ad*.example.com - matches all of the above, and then some.
1037 .?pix.com - matches "www.ipix.com", "pictures.epix.com", "a.b.c.d.e.upix.com",
1040 www[1-9a-ez].example.com - matches "www1.example.com", "www4.example.com",
1041 "wwwd.example.com", "wwwz.example.com", etc., but not "wwww.example.com".
1043 If Junkbuster was compiled with "pcre" support (default), Perl compatible
1044 regular expressions can be used. See the pcre/docs/ directory or "man perlre"
1045 (also available on http://www.perldoc.com/perl5.6/pod/perlre.html) for details.
1046 A brief discussion of regular expressions is in the Appendix. For instance:
1048 /.*/advert[0-9]+\.jpe?g - would match a URL from any domain, with any path that
1049 includes "advert" followed immediately by one or more digits, then a "." and
1050 ending in either "jpeg" or "jpg". So we match "example.com/ads/advert2.jpg",
1051 and "www.example.com/ads/banners/advert39.jpeg", but not "www.example.com/ads/
1052 banners/advert39.gif" (no gifs in the example pattern).
1054 Please note that matching in the path is case INSENSITIVE by default, but you
1055 can switch to case sensitive at any point in the pattern by using the "(?-i)"
1058 www.example.com/(?-i)PaTtErN.* - will match only documents whose path starts
1059 with "PaTtErN" in exactly this capitalization.
1061 -------------------------------------------------------------------------------
1065 Actions are enabled if preceded with a "+", and disabled if preceded with a
1066 "-". Actions are invoked by enclosing the action name in curly braces (e.g.
1067 {+some_action}), followed by a list of URLs to which the action applies. There
1068 are three classes of actions:
1070 * Boolean (e.g. "+/-block"):
1072 {+name} # enable this action
1073 {-name} # disable this action
1076 * parameterized (e.g. "+/-hide-user-agent"):
1078 {+name{param}} # enable action and set parameter to "param"
1079 {-name} # disable action
1082 * Multi-value (e.g. "{+/-add-header{Name: value}}", "{+/-wafer{name=value}}
1085 {+name{param}} # enable action and add parameter "param"
1086 {-name{param}} # remove the parameter "param"
1087 {-name} # disable this action totally
1090 If nothing is specified in this file, no "actions" are taken. So in this case
1091 JunkBuster would just be a normal, non-blocking, non-anonymizing proxy. You
1092 must specifically enable the privacy and blocking features you need (although
1093 the provided default ijb.action file will give a good starting point).
1095 Later defined actions always over-ride earlier ones. For multi-valued actions,
1096 the actions are applied in the order they are specified.
1098 The list of valid Junkbuster "actions" are:
1100 * Add the specified HTTP header, which is not checked for validity. You may
1101 specify this many times to specify many different headers:
1103 +add-header{Name: value}
1106 * Block this URL totally. In a default installation, a "blocked" URL will
1107 result in bright red banner that says "BLOCKED", with a reason why it is
1113 * De-animate all animated GIF images, i.e. reduce them to their last frame.
1114 This will also shrink the images considerably (in bytes, not pixels!). If
1115 the option "first" is given, the first frame of the animation is used as
1116 the replacement. If "last" is given, the last frame of the animation is
1117 used instead, which probably makes more sense for most banner animations,
1118 but also has the risk of not showing the entire last frame (if it is only a
1119 delta to an earlier frame).
1121 +deanimate-gifs{last}
1122 +deanimate-gifs{first}
1125 * "+downgrade" will downgrade HTTP/1.1 client requests to HTTP/1.0 and
1126 downgrade the responses as well. Use this action for servers that use HTTP/
1127 1.1 protocol features that Junkbuster doesn't handle well yet. HTTP/1.1 is
1128 only partially implemented. Default is not to downgrade requests.
1133 * Many sites, like yahoo.com, don't just link to other sites. Instead, they
1134 will link to some script on their own server, giving the destination as a
1135 parameter, which will then redirect you to the final target. URLs resulting
1136 from this scheme typically look like: http://some.place/some_script?http://
1139 Sometimes, there are even multiple consecutive redirects encoded in the
1140 URL. These redirections via scripts make your web browsing more traceable,
1141 since the server from which you follow such a link can see where you go to.
1142 Apart from that, valuable bandwidth and time is wasted, while your browser
1143 ask the server for one redirect after the other. Plus, it feeds the
1146 The "+fast-redirects" option enables interception of these requests by
1147 Junkbuster, who will cut off all but the last valid URL in the request and
1148 send a local redirect back to your browser without contacting the remote
1154 * Apply the filters in the section_header section of the re_filterfile file
1155 to the site(s). Re_filterfile sections are grouped according to like
1158 +filter{section_header}
1161 Filter sections that are pre-defined in the supplied re_filterfile include:
1163 html-annoyances: Get rid of particularly annoying HTML abuse.
1165 js-annoyances: Get rid of particularly annoying JavaScript abuse
1167 no-poups: Kill all popups in JS and HTML
1169 frameset-borders: Give frames a border
1171 webbugs: Squish WebBugs (1x1 invisible GIFs used for user tracking)
1173 no-refresh: Automatic refresh sucks on auto-dialup lines
1175 fun: Text replacements for subversive browsing fun!
1177 nimda: Remove (virus) Nimda code.
1179 banners-by-size: Kill banners by size
1181 crude-parental: Kill all web pages that contain the words "sex" or
1184 * Block any existing X-Forwarded-for header, and do not add a new one:
1189 * If the browser sends a "From:" header containing your e-mail address, this
1190 either completely removes the header ("block"), or changes it to the
1191 specified e-mail address.
1194 +hide-from{spam@sittingduck.xqq}
1197 * Don't send the "Referer:" (sic) header to the web site. You can block it,
1198 forge a URL to the same server as the request (which is preferred because
1199 some sites will not send images otherwise) or set it to a constant string
1202 +hide-referer{block}
1203 +hide-referer{forge}
1204 +hide-referer{http://nowhere.com}
1207 * Alternative spelling of "+hide-referer". It has the same parameters, and
1208 can be freely mixed with, "+hide-referer". ("referrer" is the correct
1209 English spelling, however the HTTP specification has a bug - it requires it
1210 to be spelled "referer".)
1215 * Change the "User-Agent:" header so web servers can't tell your browser
1216 type. Warning! This breaks many web sites. Specify the user-agent value you
1217 want. Example, pretend to be using Netscape on Linux:
1219 +hide-user-agent{Mozilla (X11; I; Linux 2.0.32 i586)}
1222 * Treat this URL as an image. This only matters if it's also "+block"ed, in
1223 which case a "blocked" image can be sent rather than a HTML page. See
1224 "+image-blocker{}" below for the control over what is actually sent. If you
1225 want invisible ads, they should be defined as images and blocked. And also,
1226 "image-blocker" should be set to "blank".
1231 * Decides what to do with URLs that end up tagged with "{+block +image}", e.g
1232 an advertizement. There are five options. "-image-blocker" will send a HTML
1233 "blocked" page, usually resulting in a "broken image" icon. "+image-blocker
1234 {logo}" will send a "JunkBuster" logo image. "+image-blocker{blank}" will
1235 send a 1x1 transparent GIF image. And finally, "+image-blocker{http://
1236 xyz.com}" will send a HTTP temporary redirect to the specified image. This
1237 has the advantage of the icon being being cached by the browser, which will
1238 speed up the display. "+image-blocker{pattern}" will send a checkboard type
1239 pattern, which scales better than the logo (which can get blocky if the
1240 browser enlarges it too much).
1242 +image-blocker{logo}
1243 +image-blocker{blank}
1244 +image-blocker{pattern}
1245 +image-blocker{http://i.j.b/send-banner}
1248 * By default (i.e. in the absence of a "+limit-connect" action), Junkbuster
1249 will only allow CONNECT requests to port 443, which is the standard port
1250 for https as a precaution.
1252 The CONNECT methods exists in HTTP to allow access to secure websites
1253 (https:// URLs) through proxies. It works very simply: the proxy connects
1254 to the server on the specified port, and then short-circuits its
1255 connections to the client and to the remote proxy. This can be a big
1256 security hole, since CONNECT-enabled proxies can be abused as TCP relays
1259 If you want to allow CONNECT for more ports than this, or want to forbid
1260 CONNECT altogether, you can specify a comma separated list of ports and
1261 port ranges (the latter using dashes, with the minimum defaulting to 0 and
1264 +limit-connect{443} # This is the default and need no be specified.
1265 +limit-connect{80,443} # Ports 80 and 443 are OK.
1266 +limit-connect{-3, 7, 20-100, 500-} # Port less than 3, 7, 20 to 100
1267 #and above 500 are OK.
1270 * "+no-compression" prevents the website from compressing the data. Some
1271 websites do this, which can be a problem for Junkbuster, since "+filter",
1272 "+no-popup" and "+gif-deanimate" will not work on compressed data. This
1273 will slow down connections to those websites, though. Default is
1274 "nocompression" is turned on.
1279 * If the website sets cookies, "no-cookies-keep" will make sure they are
1280 erased when you exit and restart your web browser. This makes profiling
1281 cookies useless, but won't break sites which require cookies so that you
1282 can log in for transactions. Default: on.
1287 * Prevent the website from reading cookies:
1292 * Prevent the website from setting cookies:
1297 * Filter the website through a built-in filter to disable those obnoxious
1298 JavaScript pop-up windows via window.open(), etc. The two alternative
1299 spellings are equivalent.
1305 * This action only applies if you are using a jarfile for saving cookies. It
1306 sends a cookie to every site stating that you do not accept any copyright
1307 on cookies sent to you, and asking them not to track you. Of course, this
1308 is a (relatively) unique header they could use to track you.
1313 * This allows you to add an arbitrary cookie. It can be specified multiple
1314 times in order to add as many cookies as you like.
1319 The meaning of any of the above is reversed by preceding the action with a "-",
1320 in place of the "+".
1324 Turn off cookies by default, then allow a few through for specified sites:
1326 # Turn off all persistent cookies
1327 { +no-cookies-read }
1329 # Allow cookies for this browser session ONLY
1330 { +no-cookies-keep }
1332 # Exceptions to the above, sites that benefit from persistent cookies
1333 { -no-cookies-read }
1335 { -no-cookies-keep }
1342 # Alternative way of saying the same thing
1343 {-no-cookies-set -no-cookies-read -no-cookies-keep}
1348 Now turn off "fast redirects", and then we allow two exceptions:
1353 # Reverse it for these two sites, which don't work right without it.
1355 www.ukc.ac.uk/cgi-bin/wac\.cgi\?
1359 Turn on page filtering according to rules in the defined sections of
1360 refilterfile, and make one exception for sourceforge:
1362 # Run everything through the filter file, using only the
1363 # specified sections:
1364 +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}\
1365 +filter{webbugs} +filter{nimda} +filter{banners-by-size}
1367 # Then disable filtering of code from sourceforge!
1369 .cvs.sourceforge.net
1372 Now some URLs that we want "blocked", ie we won't see them. Many of these use
1373 regular expressions that will expand to match multiple URLs:
1377 /.*/(.*[-_.])?ads?[0-9]?(/|[-_.].*|\.(gif|jpe?g))
1378 /.*/(.*[-_.])?count(er)?(\.cgi|\.dll|\.exe|[?/])
1379 /.*/(ng)?adclient\.cgi
1380 /.*/(plain|live|rotate)[-_.]?ads?/
1381 /.*/(sponsor)s?[0-9]?/
1382 /.*/_?(plain|live)?ads?(-banners)?/
1384 /.*/ad(sdna_image|gifs?)/
1385 /.*/ad(server|stream|juggler)\.(cgi|pl|dll|exe)
1389 /.*/adv((er)?ts?|ertis(ing|ements?))?/
1393 /.*/cgi-bin/centralad/getimage
1394 /.*/images/addver\.gif
1395 /.*/images/marketing/.*\.(gif|jpe?g)
1399 /.*/sponsors?[0-9]?/
1400 /.*/advert[0-9]+\.jpg
1407 /graphics/defaultAd/
1409 /image\.ng/transactionID
1410 /images/.*/.*_anim\.gif # alvin brattli
1411 /ip_img/.*\.(gif|jpe?g)
1415 /cgi-bin/nph-adclick.exe/
1416 /.*/Image/BannerAdvertising/
1418 /.*/adlib/server\.cgi
1422 Note that many of these actions have the potential to cause a page to
1423 misbehave, possibly even not to display at all. There are many ways a site
1424 designer may choose to design his site, and what HTTP header content he may
1425 depend on. There is no way to have hard and fast rules for all sites. See the
1426 Appendix for a brief example on troubleshooting actions.
1428 -------------------------------------------------------------------------------
1432 Custom "actions", known to Junkbuster as "aliases", can be defined by combining
1433 other "actions". These can in turn be invoked just like the built-in "actions".
1434 Currently, an alias can contain any character except space, tab, "=", "{" or "}
1435 ". But please use only "a"- "z", "0"-"9", "+", and "-". Alias names are not
1436 case sensitive, and must be defined before anything else in the ijb.actionfile
1437 ! And there can only be one set of "aliases" defined.
1439 Now let's define a few aliases:
1441 # Useful customer aliases we can use later. These must come first!
1443 +no-cookies = +no-cookies-set +no-cookies-read
1444 -no-cookies = -no-cookies-set -no-cookies-read
1446 -block -no-cookies -filter -fast-redirects -hide-referer -no-popups
1447 shop = -no-cookies -filter -fast-redirects
1448 +imageblock = +block +image
1450 #For people who don't like to type too much: ;-)
1453 c2 = -no-cookies-set +no-cookies-read
1454 c3 = +no-cookies-set -no-cookies-read
1455 #... etc. Customize to your heart's content.
1458 Some examples using our "shop" and "fragile" aliases from above:
1460 # These sites are very complex and require
1461 # minimal interference.
1463 .office.microsoft.com
1464 .windowsupdate.microsoft.com
1467 # Shopping sites - still want to block ads.
1470 .worldpay.com # for quietpc.com
1474 # These shops require pop-ups
1480 -------------------------------------------------------------------------------
1482 3.5. The Filter File
1484 Any web page can be dynamically modified with the filter file. This
1485 modification can be removal, or re-writing, of any web page content, including
1486 tags and non-visible content. The default filter file is re_filterfile, located
1487 in the config directory.
1489 The included example file is divided into sections. Each section begins with
1490 the FILTER keyword, followed by the identifier for that section, e.g. "FILTER:
1491 webbugs". Each section performs a similar type of filtering, such as
1494 This file uses regular expressions to alter or remove any string in the target
1495 page. The expressions can only operate on one line at a time. Some examples
1496 from the included default re_filterfile:
1498 Stop web pages from displaying annoying messages in the status bar by deleting
1501 FILTER: html-annoyances
1503 # New browser windows should be resizeable and have a location and status
1506 s/resizable="?(no|0)"?/resizable=1/ig s/noresize/yesresize/ig
1507 s/location="?(no|0)"?/location=1/ig s/status="?(no|0)"?/status=1/ig
1508 s/scrolling="?(no|0|Auto)"?/scrolling=1/ig
1509 s/menubar="?(no|0)"?/menubar=1/ig
1511 # The <BLINK> tag was a crime!
1513 s*<blink>|</blink>**ig
1517 #s/framespacing="?(no|0)"?//ig
1518 #s/margin(height|width)=[0-9]*//gi
1521 Just for kicks, replace any occurrence of "Microsoft" with "MicroSuck", and
1522 have a little fun with topical buzzwords:
1526 s/microsoft(?!.com)/MicroSuck/ig
1530 s/industry-leading|cutting-edge|award-winning/<font color=red><b>BINGO!</b></
1534 Kill those pesky little web-bugs:
1536 # webbugs: Squish WebBugs (1x1 invisible GIFs used for user tracking)
1539 s/<img\s+[^>]*?(width|height)\s*=\s*['"]?1\D[^>]*?(width|height)\s*=\s*['"]?1
1540 (\D[^>]*?)?>/<!-- Squished WebBug -->/sig
1543 -------------------------------------------------------------------------------
1547 When Junkbuster displays one of its internal pages, such as a 404 Not Found
1548 error page, it uses the appropriate template. On Linux, BSD, and Unix, these
1549 are located in /etc/junkbuster/templates by default. These may be customized,
1552 -------------------------------------------------------------------------------
1554 4. Quickstart to Using Junkbuster
1556 Install package, then run and enjoy! JunkBuster is typically started by
1557 specifying the main configuration file to be used on the command line. Example
1558 Unix startup command:
1561 # /usr/sbin/junkbuster /etc/junkbuster/config
1565 An init script is provided for SuSE and Redhat.
1567 For for SuSE: /etc/rc.d/junkbuster start
1569 For RedHat: /etc/rc.d/init.d/junkbuster start
1571 If no configuration file is specified on the command line, Junkbuster will look
1572 for a file named config in the current directory. Except on Win32 where it will
1573 try config.txt. If no file is specified on the command line and no default
1574 configuration file can be found, Junkbuster will fail to start.
1576 Be sure your browser is set to use the proxy which is by default at localhost,
1577 port 8118. With Netscape (and Mozilla), this can be set under Edit ->
1578 Preferences -> Advanced -> Proxies -> HTTP Proxy. For Internet Explorer: Tools
1579 > Internet Properties -> Connections -> LAN Setting. Then, check "Use Proxy"
1580 and fill in the appropriate info (Address: localhost, Port: 8118). Include if
1581 HTTPS proxy support too.
1583 The included default configuration files should give a reasonable starting
1584 point, though may be somewhat aggressive in blocking junk. You will probably
1585 want to keep an eye out for sites that require persistent cookies, and add
1586 these to ijb.action as needed. By default, most of these will be accepted only
1587 during the current browser session, until you add them to the configuration. If
1588 you want the browser to handle this instead, you will need to edit ijb.action
1589 and disable this feature. If you use more than one browser, it would make more
1590 sense to let Junkbuster handle this. In which case, the browser(s) should be
1591 set to accept all cookies.
1593 If a particular site shows problems loading properly, try adding it to the
1594 {fragile} section of ijb.action. This will turn off most actions for this site.
1596 Junkbuster is HTTP/1.1 compliant, but not all 1.1 features are as yet
1597 implemented. If browsers that support HTTP/1.1 (like Mozilla or recent versions
1598 of I.E.) experience problems, you might try to force HTTP/1.0 compatibility.
1599 For Mozilla, look under Edit -> Preferences -> Debug -> Networking. Or set the
1600 "+downgrade" config option in ijb.action.
1602 After running Junkbuster for a while, you can start to fine tune the
1603 configuration to suit your personal, or site, preferences and requirements.
1604 There are many, many aspects that can be customized. "Actions" (as specified in
1605 ijb.action) can be adjusted by pointing your browser to http://i.j.b/, and then
1606 follow the link to "edit the actions list". (This is an internal page and does
1607 not require Internet access.)
1609 In fact, various aspects of Junkbuster configuration can be viewed from this
1610 page, including current configuration parameters, source code version numbers,
1611 the browser's request headers, and "actions" that apply to a given URL. In
1612 addition to the ijb.action file editor mentioned above, Junkbuster can also be
1613 turned "on" and "off" from this page.
1615 If you encounter problems, please verify it is a Junkbuster bug, by disabling
1616 Junkbuster, and then trying the same page. Also, try another browser if
1617 possible to eliminate browser or site problems. Before reporting it as a bug,
1618 see if there is not a configuration option that is enabled that is causing the
1619 page not to load. You can then add an exception for that page or site. If a
1620 bug, please report it to the developers (see below).
1622 -------------------------------------------------------------------------------
1624 4.1. Command Line Options
1626 JunkBuster may be invoked with the following command-line options:
1630 Print version info and exit, Unix only.
1634 Print a short usage info and exit, Unix only.
1638 Don't become a daemon, i.e. don't fork and become process group leader,
1639 don't detach from controlling tty. Unix only.
1643 On startup, write the process ID to FILE. Delete the FILE on exit. Failiure
1644 to create or delete the FILE is non-fatal. If no FILE option is given, no
1645 PID file will be used. Unix only.
1647 * --user USER[.GROUP]
1649 After (optionally) writing the PID file, assume the user ID of USER, and if
1650 included the GID of GROUP. Exit if the privileges are not sufficient to do
1655 If no configfile is included on the command line, JunkBuster will look for
1656 a file named "config" in the current directory (except on Win32 where it
1657 will look for "config.txt" instead). Specify full path to avoid confusion.
1659 -------------------------------------------------------------------------------
1661 5. Contacting the Developers, Bug Reporting and Feature Requests
1663 We value your feedback. However, to provide you with the best support, please
1666 * Use the Sourceforge support forum to get help.
1668 * Submit bugs only thru our Sourceforge bug forum. Make sure that the bug has
1669 not already been submitted. Please try to verify that it is a Junkbuster
1670 bug, and not a browser or site bug first. If you are using your own custom
1671 configuration, please try the stock configs to see if the problem is a
1672 configuration related bug. And if not using the latest development
1673 snapshot, please try the latest one. Or even better, CVS sources.
1675 * Submit feature requests only thru our Sourceforge feature request forum.
1679 For any other issues, feel free to use the mailing lists.
1681 Anyone interested in actively participating in development and related
1682 discussions can join the appropriate mailing list here. Archives are available
1685 -------------------------------------------------------------------------------
1687 6. Copyright and History
1691 Internet Junkbuster is free software; you can redistribute it and/or modify it
1692 under the terms of the GNU General Public License as published by the Free
1693 Software Foundation; either version 2 of the License, or (at your option) any
1696 This program is distributed in the hope that it will be useful, but WITHOUT ANY
1697 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1698 PARTICULAR PURPOSE. See the GNU General Public License for more details, which
1699 is available from the Free Software Foundation, Inc, 59 Temple Place - Suite
1700 330, Boston, MA 02111-1307, USA.
1702 -------------------------------------------------------------------------------
1706 Junkbuster was originally written by Anonymous Coders and Junkbuster's
1707 Corporation, and was released as free open-source software under the GNU GPL.
1708 Stefan Waldherr made many improvements, and started the SourceForge project to
1709 rekindle development. There are now several active developers contributing. The
1710 last stable release was v2.0.2, which has now grown whiskers ;-).
1712 -------------------------------------------------------------------------------
1716 http://sourceforge.net/projects/ijbswa
1718 http://ijbswa.sourceforge.net/
1722 http://www.junkbusters.com/ht/en/cookies.html
1724 http://www.waldherr.org/junkbuster/
1726 http://privacy.net/analyze/
1728 http://www.squid-cache.org/
1732 -------------------------------------------------------------------------------
1736 8.1. Regular Expressions
1738 Junkbuster can use "regular expressions" in various config files. Assuming
1739 support for "pcre" (Perl Compatible Regular Expressions) is compiled in, which
1740 is the default. Such configuration directives do not require regular
1741 expressions, but they can be used to increase flexibility by matching a pattern
1742 with wild-cards against URLs.
1744 If you are reading this, you probably don't understand what "regular
1745 expressions" are, or what they can do. So this will be a very brief
1746 introduction only. A full explanation would require a book ;-)
1748 "Regular expressions" is a way of matching one character expression against
1749 another to see if it matches or not. One of the "expressions" is a literal
1750 string of readable characters (letter, numbers, etc), and the other is a
1751 complex string of literal characters combined with wild-cards, and other
1752 special characters, called meta-characters. The "meta-characters" have special
1753 meanings and are used to build the complex pattern to be matched against. Perl
1754 Compatible Regular Expressions is an enhanced form of the regular expression
1755 language with backward compatibility.
1757 To make a simple analogy, we do something similar when we use wild-card
1758 characters when listing files with the dir command in DOS. *.* matches all
1759 filenames. The "special" character here is the asterisk which matches any and
1760 all characters. We can be more specific and use ? to match just individual
1761 characters. So "dir file?.text" would match "file1.txt", "file2.txt", etc. We
1762 are pattern matching, using a similar technique to "regular expressions"!
1764 Regular expressions do essentially the same thing, but are much, much more
1765 powerful. There are many more "special characters" and ways of building complex
1766 patterns however. Let's look at a few of the common ones, and then some
1769 . - Matches any single character, e.g. "a", "A", "4", ":", or "@".
1771 ? - The preceding character or expression is matched ZERO or ONE times. Either/
1774 + - The preceding character or expression is matched ONE or MORE times.
1776 * - The preceding character or expression is matched ZERO or MORE times.
1778 \ - The "escape" character denotes that the following character should be taken
1779 literally. This is used where one of the special characters (e.g. ".") needs to
1780 be taken literally and not as a special meta-character.
1782 [] - Characters enclosed in brackets will be matched if any of the enclosed
1783 characters are encountered.
1785 () - parentheses are used to group a sub-expression, or multiple
1788 | - The "bar" character works like an "or" conditional statement. A match is
1789 successful if the sub-expression on either side of "|" matches.
1791 s/string1/string2/g - This is used to rewrite strings of text. "string1" is
1792 replaced by "string2" in this example.
1794 These are just some of the ones you are likely to use when matching URLs with
1795 Junkbuster, and is a long way from a definitive list. This is enough to get us
1796 started with a few simple examples which may be more illuminating:
1798 /.*/banners/.* - A simple example that uses the common combination of "." and "
1799 *" to denote any character, zero or more times. In other words, any string at
1800 all. So we start with a literal forward slash, then our regular expression
1801 pattern (".*") another literal forward slash, the string "banners", another
1802 forward slash, and lastly another ".*". We are building a directory path here.
1803 This will match any file with the path that has a directory named "banners" in
1804 it. The ".*" matches any characters, and this could conceivably be more forward
1805 slashes, so it might expand into a much longer looking path. For example, this
1806 could match: "/eye/hate/spammers/banners/annoy_me_please.gif", or just "/
1807 banners/annoying.html", or almost an infinite number of other possible
1808 combinations, just so it has "banners" in the path somewhere.
1810 A now something a little more complex:
1812 /.*/adv((er)?ts?|ertis(ing|ements?))?/ - We have several literal forward
1813 slashes again ("/"), so we are building another expression that is a file path
1814 statement. We have another ".*", so we are matching against any conceivable
1815 sub-path, just so it matches our expression. The only true literal that must
1816 match our pattern is adv, together with the forward slashes. What comes after
1817 the "adv" string is the interesting part.
1819 Remember the "?" means the preceding expression (either a literal character or
1820 anything grouped with "(...)" in this case) can exist or not, since this means
1821 either zero or one match. So "((er)?ts?|ertis(ing|ements?))" is optional, as
1822 are the individual sub-expressions: "(er)", "(ing|ements?)", and the "s". The "
1823 |" means "or". We have two of those. For instance, "(ing|ements?)", can expand
1824 to match either "ing" OR "ements?". What is being done here, is an attempt at
1825 matching as many variations of "advertisement", and similar, as possible. So
1826 this would expand to match just "adv", or "advert", or "adverts", or
1827 "advertising", or "advertisement", or "advertisements". You get the idea. But
1828 it would not match "advertizements" (with a "z"). We could fix that by changing
1829 our regular expression to: "/.*/adv((er)?ts?|erti(s|z)(ing|ements?))?/", which
1830 would then match either spelling.
1832 /.*/advert[0-9]+\.(gif|jpe?g) - Again another path statement with forward
1833 slashes. Anything in the square brackets "[]" can be matched. This is using
1834 "0-9" as a shorthand expression to mean any digit one through nine. It is the
1835 same as saying "0123456789". So any digit matches. The "+" means one or more of
1836 the preceding expression must be included. The preceding expression here is
1837 what is in the square brackets -- in this case, any digit one through nine.
1838 Then, at the end, we have a grouping: "(gif|jpe?g)". This includes a "|", so
1839 this needs to match the expression on either side of that bar character also. A
1840 simple "gif" on one side, and the other side will in turn match either "jpeg"
1841 or "jpg", since the "?" means the letter "e" is optional and can be matched
1842 once or not at all. So we are building an expression here to match image GIF or
1843 JPEG type image file. It must include the literal string "advert", then one or
1844 more digits, and a "." (which is now a literal, and not a special character,
1845 since it is escaped with "\"), and lastly either "gif", or "jpeg", or "jpg".
1846 Some possible matches would include: "//advert1.jpg", "/nasty/ads/
1847 advert1234.gif", "/banners/from/hell/advert99.jpg". It would not match
1848 "advert1.gif" (no leading slash), or "/adverts232.jpg" (the expression does not
1849 include an "s"), or "/advert1.jsp" ("jsp" is not in the expression anywhere).
1851 s/microsoft(?!.com)/MicroSuck/i - This is a substitution. "MicroSuck" will
1852 replace any occurrence of "microsoft". The "i" at the end of the expression
1853 means ignore case. The "(?!.com)" means the match should fail if "microsoft" is
1854 followed by ".com". In other words, this acts like a "NOT" modifier. In case
1855 this is a hyperlink, we don't want to break it ;-).
1857 We are barely scratching the surface of regular expressions here so that you
1858 can understand the default Junkbuster configuration files, and maybe use this
1859 knowledge to customize your own installation. There is much, much more that can
1860 be done with regular expressions. Now that you know enough to get started, you
1861 can learn more on your own :/
1863 More reading on Perl Compatible Regular expressions: http://www.perldoc.com/
1864 perl5.6/pod/perlre.html
1866 -------------------------------------------------------------------------------
1868 8.2. JunkBuster's Internal Pages
1870 Since JunkBuster proxies each requested web page, it is easy for JunkBuster to
1871 trap certain URLs. In this way, we can talk directly to JunkBuster, and see how
1872 it is configured, see how our rules are being applied, change these rules and
1873 other configuration options, and even turn JunkBuster's filtering off, all with
1876 The URLs listed below are the special ones that allow direct access to
1877 JunkBuster. Of course, JunkBuster must be running to access these. If not, you
1878 will get a friendly error message. Internet access is not necessary either.
1880 * Junkbuster main page:
1882 http://ijbswa.sourceforge.net/config/
1884 Alternately, this may be reached at http://i.j.b/, but this variation may
1885 not work as reliably as the above in some configurations.
1887 * Show information about the current configuration:
1889 http://ijbswa.sourceforge.net/config/show-status
1891 * Show the source code version numbers:
1893 http://ijbswa.sourceforge.net/config/show-version
1895 * Show the client's request headers:
1897 http://ijbswa.sourceforge.net/config/show-request
1899 * Show which actions apply to a URL and why:
1901 http://ijbswa.sourceforge.net/config/show-url-info
1903 * Toggle JunkBuster on or off:
1905 http://ijbswa.sourceforge.net/config/toggle
1907 Short cuts. Turn off, then on:
1909 http://ijbswa.sourceforge.net/config/toggle?set=disable
1911 http://ijbswa.sourceforge.net/config/toggle?set=enable
1913 * Edit the actions list file:
1915 http://ijbswa.sourceforge.net/config/edit-actions
1917 These may be bookmarked for quick reference.
1919 -------------------------------------------------------------------------------
1921 8.3. Anatomy of an Action
1923 The way Junkbuster applies "actions" to any given URL can be complex, and not
1924 always so easy to understand what is happening. And sometimes we need to be
1925 able to see just what Junkbuster is doing. Especially, if something Junkbuster
1926 is doing is causing us a problem inadvertantly. It can be a little daunting to
1927 look at the actions files themselves, since they tend to be filled with
1928 "regular expressions" whose consequences are not always so obvious.
1930 First, you enter one URL (or partial URL), and this page will tell you how the
1931 currently configured Junkbuster "actions" are being applied to that specific
1932 URL. This will not help with filtering effects from the re_filterfile! It also
1933 will not tell you about any other URLs that may be embedded within the URL you
1934 are testing. For instance, images such as ads are expressed as URLs within the
1935 raw page source of HTML pages. So you will only get info for the actual URL
1936 that is pasted into the prompt area -- not any sub-URLs. If you want to know
1937 about embedded URLs like ads, you will have to dig those out of the HTML
1938 source. Use your browser's "View Page Source" option for this.
1940 Let's look at an example, google.com, one section at a time:
1942 System default actions:
1944 { -add-header -block -deanimate-gifs -downgrade -fast-redirects -filter
1945 -hide-forwarded -hide-from -hide-referer -hide-user-agent -image
1946 -image-blocker -limit-connect -no-compression -no-cookies-keep
1947 -no-cookies-read -no-cookies-set -no-popups -vanilla-wafer -wafer }
1951 This is the top section, and only tells us of the compiled in defaults. This is
1952 basically what Junkbuster would do if there were not any "actions" defined,
1953 i.e. it does nothing. Every action is disabled. This is not particularly
1954 informative for our purposes here. OK, next section:
1956 Matches for http://google.com:
1958 { -add-header -block +deanimate-gifs -downgrade +fast-redirects
1959 +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}
1960 +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal}
1961 +filter{fun} +hide-forwarded +hide-from{block} +hide-referer{forge}
1962 -hide-user-agent -image +image-blocker{blank} +no-compression
1963 +no-cookies-keep -no-cookies-read -no-cookies-set +no-popups
1964 -vanilla-wafer -wafer }
1967 { -no-cookies-keep -no-cookies-read -no-cookies-set }
1975 This is much more informative, and tells us how we have defined our "actions",
1976 and which ones match for our example, "google.com". The first grouping shows
1977 our default settings, which would apply to all URLs. If you look at your
1978 "actions" file, this would be the section just below the "aliases" section near
1979 the top. This applies to all URLs as signified by the single forward slash -- "
1982 These are the default actions we have enabled. But we can define additional
1983 actions that would be exceptions to these general rules, and then list specific
1984 URLs that these exceptions would apply to. Last match wins. Just below this
1985 then are two explict matches for ".google.com". The first is negating our
1986 various cookie blocking actions (i.e. we will allow cookies here). The second
1987 is allowing "fast-redirects". Note that there is a leading dot here --
1988 ".google.com". This will match any hosts and sub-domains, in the google.com
1989 domain also, such as "www.google.com". So, apparently, we have these actions
1990 defined somewhere in the lower part of our actions file, and "google.com" is
1991 referenced in these sections.
1993 And now we pull it altogether in the bottom section and summarize how
1994 Junkbuster is appying all its "actions" to "google.com":
1998 -add-header -block -deanimate-gifs -downgrade -fast-redirects
1999 +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}
2000 +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal}
2001 +filter{fun} +hide-forwarded +hide-from{block} +hide-referer{forge}
2002 -hide-user-agent -image +image-blocker{blank} -limit-connect +no-compression
2003 -no-cookies-keep -no-cookies-read -no-cookies-set +no-popups -vanilla-wafer
2008 Now another example, "ad.doubleclick.net":
2021 We'll just show the interesting part here, the explicit matches. It is matched
2022 three different times. Each as an "+block +image", which is the expanded form
2023 of one of our aliases that had been defined as: "+imageblock". ("Aliases" are
2024 defined in the first section of the actions file and typically used to combine
2025 more than one action.)
2027 Any one of these would have done the trick and blocked this as an unwanted
2028 image. This is unnecessarily redundant since the last case effectively would
2029 also cover the first. No point in taking chances with these guys though ;-)
2030 Note that if you want an ad or obnoxious URL to be invisible, it should be
2031 defined as "ad.doubleclick.net" is done here -- as both a "+block" and an
2032 "+image". The custom alias "+imageblock" does this for us.
2034 One last example. Let's try "http://www.rhapsodyk.net/adsl/HOWTO/". This one is
2035 giving us problems. We are getting a blank page. Hmmm...
2037 Matches for http://www.rhapsodyk.net/adsl/HOWTO/:
2039 { -add-header -block +deanimate-gifs -downgrade +fast-redirects
2040 +filter{html-annoyances} +filter{js-annoyances} +filter{no-popups}
2041 +filter{webbugs} +filter{nimda} +filter{banners-by-size} +filter{hal}
2042 +filter{fun} +hide-forwarded +hide-from{block} +hide-referer{forge}
2043 -hide-user-agent -image +image-blocker{blank} +no-compression
2044 +no-cookies-keep -no-cookies-read -no-cookies-set +no-popups
2045 -vanilla-wafer -wafer }
2053 Ooops, the "/adsl/" is matching "/ads"! But we did not want this at all! Now we
2054 see why we get the blank page. We could now add a new action below this that
2055 explictly does not block (-block) pages with "adsl". There are various ways to
2056 handle such exceptions. Example:
2063 Now the page displays ;-)