Added 'excludes' field, added JBoss

main
Elbert Alias 11 years ago
parent a7437e0926
commit 4adc73a3f3

@ -94,7 +94,6 @@
"AdInfinity": {
"website": "adinfinity.com.au",
"cats": [ 36 ],
"env": [ "" ],
"script": [ "adinfinity\\.com\\.au" ]
},
"Adobe ColdFusion": {
@ -1061,8 +1060,8 @@
"website": "google.com/adsense",
"cats": [ 36 ],
"env": [ "^google_ad_", "^__google_ad_", "^Goog_AdSense_" ],
"script": [ "googlesyndication\\.com/pagead/show_ads\\.js", "ad\\.ca\\.doubleclick\\.net", "2mdn\\.net" ]
"env": [ "^google_ad_" ],
"script": [ "googlesyndication\\.com/pagead/show_ads\\.js", "ad\\.ca\\.doubleclick\\.net", "2mdn\\.net" ],
"env": "^google_ad_",
"script": [ "googlesyndication\\.com/pagead/show_ads\\.js", "ad\\.ca\\.doubleclick.net" ]
},
"Google App Engine": {
@ -1351,9 +1350,21 @@
"Java Servlet": {
"website": "www.oracle.com/technetwork/java/index-jsp-135475.html",
"cats": [ 18 ],
"headers": { "X-Powered-By": "Servlet(?:/([\\d.]+))?\\;version:\\1" },
"headers": { "X-Powered-By": "Servlet(?:.([\\d.]+))?\\;version:\\1" },
"implies": "Java"
},
"JBoss Application Server": {
"website": "jboss.org/jbossas.html",
"cats": [ 22 ],
"headers": { "X-Powered-By": "JBoss(?:-([\\d.]+))?\\;version:\\1" }
},
"JBoss Web": {
"website": "jboss.org/jbossweb",
"cats": [ 22 ],
"headers": { "X-Powered-By": "JBossWeb(?:-([\\d.]+))?\\;version:\\1" },
"implies": "JBoss Application Server",
"excludes": "Apache Tomcat"
},
"Jetty": {
"website": "www.eclipse.org/jetty",
"cats": [ 22 ],
@ -1786,7 +1797,7 @@
"website": "perl.apache.org",
"cats": [ 33 ],
"headers": { "Server": "mod_perl(?:/([\\d\\.]+))?\\;version:\\1" },
"implies": [ "Perl", "Apache" ]
"implies": [ "Apache" ]
},
"mod_python": {
"website": "www.modpython.org",
@ -2254,7 +2265,7 @@
"Project Wonderful": {
"website": "projectwonderful.com",
"cats": [ 36 ],
"html": "<div[^>]+id=\"pw_adbox_"
"html": "<div[^>]+id=\"pw_adbox_",
"script": "^https?://(?:www\\.)?projectwonderful\\.com/(?:pwa\\.js|gen\\.php)",
"env": "^pw_adloader$"
},
@ -2339,7 +2350,7 @@
"Red Hat": {
"website": "redhat.com",
"cats": [ 28 ],
"headers": { "Server": "(?:.*rhel(\\d+)|Red Hat)\\;version:\\1", "X-Powered-By": "Red Hat" }
"headers": { "Server": "Red Hat", "X-Powered-By": "Red Hat" }
},
"Reddit": {
"website": "code.reddit.com",

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 B

After

Width:  |  Height:  |  Size: 693 B

@ -17,6 +17,7 @@ var wappalyzer = (function() {
this.confidence = {};
this.confidenceTotal = 0;
this.detected = Boolean(detected);
this.excludes = [];
this.version = '';
this.versions = [];
};
@ -52,11 +53,11 @@ var wappalyzer = (function() {
resolved = this.versions[0];
for ( i = 1; i < this.versions.length; i++ ) {
if ( this.versions[i].indexOf(resolved) !== -1 ) {
resolved = this.versions[i];
} else {
if ( this.versions[i].indexOf(resolved) === -1 ) {
break;
}
resolved = this.versions[i];
}
return this.version = resolved;
@ -74,15 +75,12 @@ var wappalyzer = (function() {
version = pattern.version,
matches = pattern.regex.exec(value);
w.log({ matches: matches, version: version });
if ( matches ) {
matches.forEach(function(match, i) {
// Parse ternary operator
var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version);
if ( ternary && ternary.length === 3 ) {
w.log({ match: match, i: i, ternary: ternary });
version = version.replace(ternary[0], match ? ternary[1] : ternary[2]);
@ -141,7 +139,9 @@ var wappalyzer = (function() {
return;
}
if ( func !== 'log' ) { w.log('w.driver.' + func); }
if ( func !== 'log' ) {
w.log('w.driver.' + func);
}
return w.driver[func](args);
};
@ -178,7 +178,7 @@ var wappalyzer = (function() {
} catch (e) {
attrs.regex = new RegExp();
w.log(e + ': ' + attr, 'warn');
w.log(e + ': ' + attr, 'error');
}
}
});
@ -199,7 +199,6 @@ var wappalyzer = (function() {
detected: {},
config: {
environment: 'dev', // dev | live
websiteURL: 'https://wappalyzer.com/',
twitterURL: 'https://twitter.com/Wappalyzer',
githubURL: 'https://github.com/ElbertF/Wappalyzer',
@ -209,8 +208,7 @@ var wappalyzer = (function() {
* Log messages to console
*/
log: function(message, type) {
if ( w.config.environment === 'dev' ) {
if ( typeof type === 'undefined' ) {
if ( type === undefined ) {
type = 'debug';
}
@ -219,7 +217,6 @@ var wappalyzer = (function() {
}
driver('log', { message: '[wappalyzer ' + type + '] ' + message, type: type });
}
},
/**
@ -229,7 +226,7 @@ var wappalyzer = (function() {
w.log('w.init');
// Checks
if ( typeof w.driver === 'undefined' ) {
if ( w.driver === undefined ) {
w.log('no driver, exiting');
return;
@ -244,21 +241,24 @@ var wappalyzer = (function() {
*/
analyze: function(hostname, url, data) {
var
i, j, app, confidence, type, regexMeta, regexScript, match, content, meta, header, checkImplies, version, id,
i, j, app, confidence, type, regexMeta, regexScript, match, content, meta, header, version, id,
profiler = new Profiler(),
apps = {};
apps = {},
excludes = [],
checkImplies = true;
w.log('w.analyze');
// Remove hash from URL
data.url = url = url.split('#')[0];
if ( typeof w.apps === 'undefined' || typeof w.categories === 'undefined' ) {
if ( w.apps === undefined || w.categories === undefined ) {
w.log('apps.json not loaded, check for syntax errors');
return;
}
if ( typeof w.detected[url] === 'undefined' ) {
if ( w.detected[url] === undefined ) {
w.detected[url] = {};
}
@ -380,19 +380,28 @@ var wappalyzer = (function() {
}
}
w.log('[ PROFILER ] Tested ' + profiler.regexCount + ' regular expressions in ' + ( (new Date().getTime() - profiler.startTime) / 1000 ) + 's');
w.log('[ PROFILER ] Slowest pattern took ' + ( profiler.slowest.duration / 1000 ) + 's: ' + profiler.slowest.app + ' | ' + profiler.slowest.type + ' | ' + profiler.slowest.regex);
w.log('[ profiler ] Tested ' + profiler.regexCount + ' regular expressions in ' + ( (new Date().getTime() - profiler.startTime) / 1000 ) + 's');
w.log('[ profiler ] Slowest pattern took ' + ( profiler.slowest.duration / 1000 ) + 's: ' + profiler.slowest.app + ' | ' + profiler.slowest.type + ' | ' + profiler.slowest.regex);
for ( app in apps ) {
if ( !apps[app].detected ) {
delete apps[app];
}
if ( w.apps[app].excludes ) {
excludes.push(w.apps[app].excludes)
}
}
// Remove excluded applications
for ( app in apps ) {
if ( excludes.indexOf(app) !== -1 ) {
delete apps[app];
}
}
// Implied applications
// Run several passes as implied apps may imply other apps
checkImplies = true;
while ( checkImplies ) {
checkImplies = false;
@ -489,10 +498,12 @@ var wappalyzer = (function() {
}
}
w.log({ hostname: hostname, ping: w.ping.hostnames[hostname] });
//w.log({ hostname: hostname, ping: w.ping.hostnames[hostname] });
}
if ( Object.keys(w.ping.hostnames).length >= 20 ) { driver('ping'); }
if ( Object.keys(w.ping.hostnames).length >= 20 ) {
driver('ping');
}
apps = null;
data = null;

Loading…
Cancel
Save