diff --git a/README.md b/README.md index 88cd4b6c9..a1c80beab 100644 --- a/README.md +++ b/README.md @@ -48,14 +48,14 @@ Copy `drivers/chrome/_locales/en`. ```javascript "Application Name": { - "cats": [ 1 ], - "headers": { "X-Powered-By": "Application Name" }, - "url": ".+\\.application-name\\.com", - "html": "]application-name\\.css", - "meta": { "generator": [ "Application Name", "Alternative Application Name" ] }, - "script": "application-name-([0-9.]+)\\.js\\;confidence:100\\;version:\\1", - "env": "ApplicationName", - "implies": [ "PHP" ], + "cats": [ 1 ], + "headers": { "X-Powered-By": "Application Name" }, + "url": ".+\\.application-name\\.com", + "html": "]application-name\\.css", + "meta": { "generator": [ "Application Name", "Alternative Application Name" ] }, + "script": "application-name-([0-9.]+)\\.js\\;confidence:50\\;version:\\1", + "env": "ApplicationName", + "implies": "PHP\\;confidence:50", } ``` @@ -88,6 +88,8 @@ 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. +The confidence field can also be applied to the `implied` field. + #### Version syntax diff --git a/drivers/bookmarklet/images/icons/OpenSSL.png b/drivers/bookmarklet/images/icons/OpenSSL.png index 96bac2d48..7dc7dbebb 100644 Binary files a/drivers/bookmarklet/images/icons/OpenSSL.png and b/drivers/bookmarklet/images/icons/OpenSSL.png differ diff --git a/drivers/bookmarklet/images/icons/mod_ssl.png b/drivers/bookmarklet/images/icons/mod_ssl.png index 96bac2d48..550702d33 100644 Binary files a/drivers/bookmarklet/images/icons/mod_ssl.png and b/drivers/bookmarklet/images/icons/mod_ssl.png differ diff --git a/drivers/bookmarklet/js/wappalyzer.js b/drivers/bookmarklet/js/wappalyzer.js index bcc79ff08..b40361afd 100644 --- a/drivers/bookmarklet/js/wappalyzer.js +++ b/drivers/bookmarklet/js/wappalyzer.js @@ -81,7 +81,7 @@ var wappalyzer = (function() { if ( matches ) { matches.map(function(match, i) { - version = version.replace('\\' + i, match); + version = version.replace('\\' + i, match ? match : ''); }); self.versions.push(version); @@ -133,6 +133,8 @@ var wappalyzer = (function() { attrs[attr[0]] = attr[1]; } } else { + attrs.string = attr; + try { attrs.regex = new RegExp(attr.replace('/', '\\\/'), 'i'); // Escape slashes in regular expression } catch (e) { @@ -372,20 +374,27 @@ var wappalyzer = (function() { confidence = apps[app].confidence; if ( w.apps[app] && w.apps[app].implies ) { + // Cast strings to an array + if ( typeof w.apps[app].implies === 'string' ) { + w.apps[app].implies = [ w.apps[app].implies ]; + } + w.apps[app].implies.map(function(implied) { - if ( !w.apps[implied] ) { - w.log('Implied application ' + implied + ' does not exist'); + implied = parse(implied)[0]; + + if ( !w.apps[implied.string] ) { + w.log('Implied application ' + implied.string + ' does not exist'); return; } - // Apply app confidence to implied app - if ( !apps.hasOwnProperty(implied) ) { - apps[implied] = new Application(implied, true); + if ( !apps.hasOwnProperty(implied.string) ) { + apps[implied.string] = new Application(implied.string, true); } + // Apply app confidence to implied app for ( id in confidence ) { - apps[implied].confidence[id + ' implied by ' + app] = confidence[id]; + apps[implied.string].confidence[id + ' implied by ' + app] = confidence[id] * ( implied.confidence ? implied.confidence / 100 : 1 ); } }); } diff --git a/drivers/bookmarklet/json b/drivers/bookmarklet/json index 1b4374c5c..bc46f80bd 100644 --- a/drivers/bookmarklet/json +++ b/drivers/bookmarklet/json @@ -43,12 +43,12 @@ "headers": { "X-Powered-CMS": "Bitrix Site Manager", "Set-Cookie": "BITRIX_" }, "html": "]+components/bitrix|(src|href)=\\\"/bitrix/(js|templates)", "script": "1c-bitrix", - "implies": [ "PHP" ] + "implies": "PHP" }, "1und1": { "cats": [ 6 ], "url": "/shop/catalog/browse\\?sessid=", - "implies": [ "PHP" ] + "implies": "PHP" }, "2z Project": { "cats": [ 1 ], @@ -62,7 +62,7 @@ "Accessible Portal": { "cats": [ 1 ], "meta": { "generator": "Accessible Portal" }, - "implies": [ "PHP" ] + "implies": "PHP" }, "AddThis": { "cats": [ 5 ], @@ -73,7 +73,7 @@ "cats": [ 1 ], "url": "/etc/designs/", "html": "