diff --git a/README.md b/README.md index 43a0cfa9f..6fa071867 100644 --- a/README.md +++ b/README.md @@ -52,20 +52,18 @@ Copy `drivers/chrome/_locales/en`. "headers": { "X-Powered-By": "Application Name" }, "url": ".+\\.application-name\\.com", "html": "]application-name\\.css", - "meta": { "generator": "Application Name" }, - "script": "application-name\\.js", + "meta": { "generator": [ "Application Name", "Alternative Application Name" ] }, + "script": "application-name-([0-9.]+)\\.js\\;confidence:100\\;version:\\1", "env": "ApplicationName", "implies": [ "PHP" ], - "confidence": { "html": 50, "script": 50 } } ``` ### JSON fields field | type | description ------------|--------|----------------------- +-----------|--------|------------ cats | array | List of category IDs. See [apps.json](https://github.com/ElbertF/Wappalyzer/blob/master/share/apps.json) for the complete list. -confidence | object | Indicates less reliable patterns that may cause false positives. The aim is to achieve a combined confidence of 100%. Defaults to 100% for unspecified fields. env | string | Global JavaScript variables, e.g. `jQuery`. headers | object | HTTP Response headers, e.g. `X-Powered-By`. html | string | Full HTML response body. @@ -76,6 +74,31 @@ script | string | `src` attribute of HTML script tags, e.g. `jquery.js`. Except `cats`, all fields are optional. +Except `cats` and `implied` all fields except one or more patterns (either a string or an array of regular expressions). + + +### Patterns + +Patterns are case insensitive [regular expressions](https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Regular_Expressions). No surrounding delimiters or flags are used. + +Optional fields can be added, separated by `\\;`: + +field | description +-----------|------------ +confidence | Indicates less reliable patterns that may cause false positives. The aim is to achieve a combined confidence of 100%. Defaults to 100% for unspecified fields. +version | Gets the version number from a pattern match using a special syntax. + + +#### Version syntax + +example | description +-----------|------------ +`\\1` | Returns the first match +`\\1?a:` | Returns `a` if the first match contains a value, nothing otherwise +`\\1?a:b` | Returns `a` if the first match contains a value, `b` otherwise +`\\1?:b` | Returns nothing if the first match contains a value, `b` otherwise +`foo\\1` | Returns `foo` with the first match appended. + ## Drivers @@ -171,4 +194,4 @@ https://github.com/skroutz/wappalyzer-ruby Wappalyzer on Firefox: -![A screenshot of Wappalyzer on Firefox](http://wappalyzer.com/sites/default/themes/wappalyzer/images/installed.png) \ No newline at end of file +![A screenshot of Wappalyzer on Firefox](http://wappalyzer.com/sites/default/themes/wappalyzer/images/installed.png)