The source code to XTroll could be used in textbooks as an example of insecure programming. Potential buffer overflows abound. XTroll is intended to be run in conjunction with a web browser on a single computer with a single user. Any other configuration is fraught with peril.
XTroll licensed under the terms of the GNU General Public License (GPL) version 3.
XTroll opens a TCP/IP port (4004 by default) on the computer on which XTroll is running. Web browser HTTP requests made to this port are relayed to a web server (http://www.reason.com by default). Server replies are relayed back to the web browser. Hit & Run blog comments are deleted if the commentator's name or link is found in the XTroll configuration file.
XTroll is a command line program. It is invoked by entering the following into a command prompt window:
XTroll first displays its configuration and the name and IP address of the web server and of the computer on which XTroll is running. Then XTroll displays information on the number of removed embedded URLs and posts.
An example of XTroll's initial output is:
XTroll v1.0 2007-07-11 servername: "www.reason.com" hostname: "omega.dumpnet" port: 4004 Server "www.reason.com" resolves to "184.108.40.206" Hostname "omega.dumpnet" resolves to "127.0.0.1"
XTroll is accessed by entering into a web browser's address bar a local URL consisting of the name of the computer on which XTroll reports it is running, a colon, and the port number. The local URL for the above example is:
Web browser accesses to the local URL should behave exactly the same as Reason's server's URL except for the comment filtering functions. Any deviation is a bug that should be fixed.
XTroll is stopped by pressing Control-C.
XTroll configures itself from file
# xtroll.conf: The XTroll configuration file # The '#' character at the beginning of a line indicates a comment. # All configuration lines in this file are commented out. # Remove the '#' character in front of a configuration line # to configure XTroll. # The name of the web server with which XTroll corresponds (default) #server www.reason.com # The name of computer on which XTroll is running (optional) #host mycomputer.mydomain # The TCP/IP port to which XTroll listens (default) #port 4004 # Plonk this dweeb and all references to him (optional) #name Richard Heurtley #link mailto:richard#64;heurtley.com #cont heurtley # Remove embedded video (optional) #xurl reason.tv #xurl youtube.com #xurl ytimg.com #xurl macromedia.com # Remove tracking (optional) #xurl google-analytics.com #xurl urchinTracker() #xurl mavenapps.net # Remove advertising (optional) #xurl ads.reason.com
Note the format of the mailto link. This is how Hit & Run formats e-mail addresses.
XTroll adds a small (X) link next to the commentator's name.
Clicking this link adds the commentator's name and link, if
there is one, to the
XTroll can filter by post content.
XTroll can remove embedded URLs.
XTroll replaces instances of explicit references to
XTroll is contained in a single C language source code file xtroll.c that compiles cleanly with high warning settings under Open Watcom (Windows), Microsoft Visual C++ Express (Windows) and gcc (Linux). XTroll is built in Linux with the following command:
Copyright © 2007-2008 Richard Heurtley.
Verbatim copying and distribution of this entire document is permitted in any medium, provided this notice is preserved.