Detect Website Backends
RSS icon Email icon
  • Filter

    The extension now includes a developer toolbox, making it a breeze to test and improve filters!

    Filters are small javascript objects, detecting a single backend such as Drupal, WordPress, etc. A filter includes a specific URL that needs to be valid, and optional a set of strings that have to be found in that URL. Filter can depend on one another (eg “Drupal 6.4″ may only be checked if “Drupal 6.x” is found).

    Please help us build a comprehensive database of backends! You can create and share a new filter or a set of filters, as well as improve current ones. Please exchange about the development in the forums!

    Here is an example filter for “Drupal 6.x”:

    filters.push({
        name: "Drupal 6.x",
        image: "chrome://backendinfo/skin/drupal.png",
        require: new Array({
            url: '/',
            contains: new Array(
                'modules/system/system.css?',
                'modules/node/node.css?',
                'modules/user/user.css?'
            )}
        )
    });

    All three strings have to be detected in that URL for this filter to verify. You may specifiy more than one required URL’s, which are OR-connected. If any one of the supplied URLs contains all strings, this filter will be valid.

    Attributes

    • name: unique identification string
    • require: set of or-connected requirements
    • image (optional): 16×16px image url
    • parent (optional): identification of parent filter

    Requirements
    An array with as many unique identifications, possessing the following attributes:

    • url: url that must be found (response of http request = 200)
    • contains: array with strings or regular expressions. all of these have to be found in the url’s html
    • excludes (optional): array with strings or regular expressions. none of these must be found in the url’s html

    Conditional Filters (parent attribute)

    It is possible to create filters that depend on another one, and that are tested only if that specified filter was found. The only thing that is different is that you add a ‘parent’ attribute to the object, containing the name-string of the parent-filter.

        filters.push({
            name: "Drupal 6.9",
            parent: "Drupal 6.x", /* This string is the parent filter id string! */
            require: new Array(
                { url: '/CHANGELOG.txt', contains: new Array('1.253.2.22 2009/01/14') }
            )
        });

    This filter includes two ways of detecting “Drupal 6.9″. If any one succeeds the filter is valid, and conditional filters on the current one will be tried out. If no image is specified, the image of the parent filter will be used!

    Regular Expressions

    Instead of just detecting strings, regular expressions can be applied to detect patterns. Such regular expressions are much more flexible than hard-coded strings and may be used to require or exclude patterns in the request source code.

    This example demonstrates the use of regular expressions in filters compared to strings. The first source code is a string based detection:

    filters.push({
        name: "TestBackend 1.5",
        parent: "TestBackend",
        require: new Array(
            { url: '/',  contains: new Array('testbackend-2007-06-26.css') },
            { url: '/',  contains: new Array('testbackend-2007-11-23.css') },
            { url: '/',  contains: new Array('testbackend-2008-05-05.css') },
            { url: '/',  contains: new Array('testbackend-2009-01-26.css') }
        )
    });
    

    The following source code does exactly the same with a regular expression:

    filters.push({
        name: "TestBackend 1.5",
        parent: "TestBackend",
        require: new Array(
            { url: '/',  contains: new Array(/testbackend[-]200(7[-]06[-]26|7[-]11[-]23|8[-]05[-]05|9[-]01[-]26).css/) }
        )
    });

    You can find a nice regexp cheat sheet here.

    Examples

    Have a look at our included filters for more inspiration:

    If you have any questions, ideas or feedback, please visit the forum!

    Filter Blueprint

    This is a basic filter blueprint you can use to create new ones:

    filters.push({
        name: "BackendName",
        require: new Array(
            { url: '/',  contains: new Array('string', /regexp/) }
        )
    });
brought to you by linuxuser.at