|
|
@ -92,67 +92,107 @@ var wappalyzer = wappalyzer || (function() {
|
|
|
|
analyze: function(hostname, url, data) {
|
|
|
|
analyze: function(hostname, url, data) {
|
|
|
|
w.log('w.analyze');
|
|
|
|
w.log('w.analyze');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.url = url;
|
|
|
|
|
|
|
|
|
|
|
|
if ( w.apps == null || w.categories == null ) {
|
|
|
|
if ( w.apps == null || w.categories == null ) {
|
|
|
|
w.log('apps.json not loaded');
|
|
|
|
w.log('apps.json not loaded');
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var i, app, type, regex, match, content, meta, header, apps = [];
|
|
|
|
if ( w.detected[url] == null ) {
|
|
|
|
|
|
|
|
w.detected[url] = [];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( w.detected[url] == null ) { w.detected[url] = []; }
|
|
|
|
var
|
|
|
|
|
|
|
|
i, app, type, regex, match, content, meta, header,
|
|
|
|
|
|
|
|
profiler = {
|
|
|
|
|
|
|
|
regexCount: 0,
|
|
|
|
|
|
|
|
startTime: ( new Date ).getTime()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
apps = []
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
if ( data ) {
|
|
|
|
|
|
|
|
for ( app in w.apps ) {
|
|
|
|
for ( app in w.apps ) {
|
|
|
|
for ( type in w.apps[app] ) {
|
|
|
|
|
|
|
|
// Skip if the app has already been detected
|
|
|
|
// Skip if the app has already been detected
|
|
|
|
if ( w.detected[url].indexOf(app) !== -1 || apps.indexOf(app) !== -1 ) {
|
|
|
|
if ( w.detected[url].indexOf(app) !== -1 || apps.indexOf(app) !== -1 ) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
next:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for ( type in w.apps[app] ) {
|
|
|
|
|
|
|
|
if ( data[type] == null ) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
switch ( type ) {
|
|
|
|
switch ( type ) {
|
|
|
|
case 'url':
|
|
|
|
case 'url':
|
|
|
|
regex = new RegExp(w.apps[app][type], 'i');
|
|
|
|
regex = new RegExp(w.apps[app][type], 'i');
|
|
|
|
|
|
|
|
|
|
|
|
if ( regex.test(url) ) { apps.push(app); }
|
|
|
|
profiler.regexCount ++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( regex.test(url) ) {
|
|
|
|
|
|
|
|
apps.push(app);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break next;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'html':
|
|
|
|
case 'html':
|
|
|
|
if ( data[type] == null ) { break; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
regex = new RegExp(w.apps[app][type], 'i');
|
|
|
|
regex = new RegExp(w.apps[app][type], 'i');
|
|
|
|
|
|
|
|
|
|
|
|
if ( regex.test(data[type]) ) { apps.push(app); }
|
|
|
|
profiler.regexCount ++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( regex.test(data[type]) ) {
|
|
|
|
|
|
|
|
apps.push(app);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break next;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'script':
|
|
|
|
case 'script':
|
|
|
|
if ( data['html'] == null ) { break; }
|
|
|
|
if ( data['html'] == null ) {
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
regex = /<script[^>]+src=("|')([^"']+)\1/ig;
|
|
|
|
regex = new RegExp(w.apps[app][type], 'i');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
profiler.regexCount ++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while ( match = new RegExp('<script[^>]+src=("|\')([^"\']+)\1', 'ig').exec(data['html']) ) {
|
|
|
|
|
|
|
|
profiler.regexCount ++;
|
|
|
|
|
|
|
|
|
|
|
|
while ( match = regex.exec(data['html']) ) {
|
|
|
|
if ( regex.test(match[2]) ) {
|
|
|
|
if ( w.apps[app][type].test(match[2]) ) {
|
|
|
|
|
|
|
|
apps.push(app);
|
|
|
|
apps.push(app);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'meta':
|
|
|
|
case 'meta':
|
|
|
|
if ( data['html'] == null ) { break; }
|
|
|
|
if ( data['html'] == null ) {
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
regex = /<meta[^>]+>/ig;
|
|
|
|
profiler.regexCount ++;
|
|
|
|
|
|
|
|
|
|
|
|
while ( match = regex.exec(data['html']) ) {
|
|
|
|
while ( match = new RegExp('<meta[^>]+>', 'ig').exec(data['html']) ) {
|
|
|
|
for ( meta in w.apps[app][type] ) {
|
|
|
|
for ( meta in w.apps[app][type] ) {
|
|
|
|
|
|
|
|
profiler.regexCount ++;
|
|
|
|
|
|
|
|
|
|
|
|
if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) {
|
|
|
|
if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) {
|
|
|
|
content = match.toString().match(/content=("|')([^"']+)("|')/i);
|
|
|
|
content = match.toString().match(/content=("|')([^"']+)("|')/i);
|
|
|
|
|
|
|
|
|
|
|
|
if ( content && content.length == 4 && w.apps[app].meta[meta].test(content[2]) ) {
|
|
|
|
regex = new RegExp(w.apps[app].meta[meta], 'i');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
profiler.regexCount ++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( content && content.length === 4 && regex.test(content[2]) ) {
|
|
|
|
apps.push(app);
|
|
|
|
apps.push(app);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -160,29 +200,37 @@ var wappalyzer = wappalyzer || (function() {
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'headers':
|
|
|
|
case 'headers':
|
|
|
|
if ( data[type] == null ) { break; }
|
|
|
|
if ( data[type] == null ) {
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for ( header in w.apps[app].headers ) {
|
|
|
|
for ( header in w.apps[app].headers ) {
|
|
|
|
regex = new RegExp(w.apps[app][type][header], 'i');
|
|
|
|
regex = new RegExp(w.apps[app][type][header], 'i');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
profiler.regexCount ++;
|
|
|
|
|
|
|
|
|
|
|
|
if ( data[type][header] != null && regex.test(data[type][header]) ) {
|
|
|
|
if ( data[type][header] != null && regex.test(data[type][header]) ) {
|
|
|
|
apps.push(app);
|
|
|
|
apps.push(app);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'env':
|
|
|
|
case 'env':
|
|
|
|
if ( data[type] == null ) { break; }
|
|
|
|
if ( data[type] == null ) {
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
regex = RegExp(w.apps[app][type], 'i');
|
|
|
|
regex = RegExp(w.apps[app][type], 'i');
|
|
|
|
|
|
|
|
|
|
|
|
for ( i in data[type] ) {
|
|
|
|
for ( i in data[type] ) {
|
|
|
|
|
|
|
|
profiler.regexCount ++;
|
|
|
|
|
|
|
|
|
|
|
|
if ( regex.test(data[type][i]) ) {
|
|
|
|
if ( regex.test(data[type][i]) ) {
|
|
|
|
apps.push(app);
|
|
|
|
apps.push(app);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -191,6 +239,8 @@ var wappalyzer = wappalyzer || (function() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
w.log('Tested ' + profiler.regexCount + ' regular expressions in ' + ( ( ( new Date ).getTime() - profiler.startTime ) / 1000 ) + 's');
|
|
|
|
|
|
|
|
|
|
|
|
// Implied applications
|
|
|
|
// Implied applications
|
|
|
|
var i, j, k, implied;
|
|
|
|
var i, j, k, implied;
|
|
|
|
|
|
|
|
|
|
|
@ -258,7 +308,6 @@ var wappalyzer = wappalyzer || (function() {
|
|
|
|
|
|
|
|
|
|
|
|
apps = null;
|
|
|
|
apps = null;
|
|
|
|
data = null;
|
|
|
|
data = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
driver('displayApps');
|
|
|
|
driver('displayApps');
|
|
|
|
}
|
|
|
|
}
|
|
|
|