@ -1,19 +1,11 @@
|
||||
.vagrant
|
||||
|
||||
build/*
|
||||
|
||||
drivers/npm/node_modules
|
||||
drivers/npm/npm-debug.log
|
||||
|
||||
src/icons/converted/*
|
||||
|
||||
package.json
|
||||
node_modules/
|
||||
node_modules
|
||||
npm-debug.log
|
||||
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
Desktop.ini
|
||||
$RECYCLE.BIN/
|
||||
tags
|
||||
|
||||
!.gitkeep
|
||||
|
@ -1,118 +0,0 @@
|
||||
div#wappalyzer-container * {
|
||||
background-color: transparent !important;
|
||||
border: none !important;
|
||||
border-left: none !important;
|
||||
border-top: none !important;
|
||||
border-right: none !important;
|
||||
border-bottom: none !important;
|
||||
border-spacing: 0 !important;
|
||||
color: inherit !important;
|
||||
font-size: inherit !important;
|
||||
font-weight: inherit !important;
|
||||
font-family: inherit !important;
|
||||
font-style: inherit !important;
|
||||
line-height: inherit !important;
|
||||
list-style: none inside !important;
|
||||
margin: 0 !important;
|
||||
outline: none !important;
|
||||
padding: 0 !important;
|
||||
text-align: inherit !important;
|
||||
text-decoration: none !important;
|
||||
white-space: inherit !important;
|
||||
}
|
||||
|
||||
#wappalyzer-container {
|
||||
background: #fff !important;
|
||||
border: 1px solid #999;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, .2) !important;
|
||||
color: #222 !important;
|
||||
font-family: Arial, sans-serif !important;
|
||||
font-size: 14px !important;
|
||||
line-height: 1.5em !important;
|
||||
margin: 0 !important;
|
||||
position: fixed !important;
|
||||
text-align: left !important;
|
||||
right: 20px !important;
|
||||
top: 20px !important;
|
||||
width: 250px !important;
|
||||
z-index: 99999 !important;
|
||||
}
|
||||
|
||||
#wappalyzer-container #wappalyzer-pending {
|
||||
background-repeat: no-repeat !important;
|
||||
background-position: center center !important;
|
||||
height: 60px !important;
|
||||
}
|
||||
|
||||
#wappalyzer-container a#wappalyzer-close:link,
|
||||
#wappalyzer-container a#wappalyzer-close:hover,
|
||||
#wappalyzer-container a#wappalyzer-close:active,
|
||||
#wappalyzer-container a#wappalyzer-close:visited {
|
||||
background: #f8f8f8 !important;
|
||||
border-bottom: 1px solid #ccc !important;
|
||||
display: block !important;
|
||||
font-weight: bold !important;
|
||||
line-height: 30px !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
#wappalyzer-container #wappalyzer-close:hover {
|
||||
background: #f4f4f4 !important;
|
||||
color: #0072B6 !important;
|
||||
}
|
||||
|
||||
#wappalyzer-container #wappalyzer-empty {
|
||||
border-bottom: 1px solid #ccc !important;
|
||||
color: #999 !important;
|
||||
display: block !important;
|
||||
line-height: 30px !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
#wappalyzer-container #wappalyzer-apps {
|
||||
padding-top: 2px !important;
|
||||
}
|
||||
|
||||
#wappalyzer-container #wappalyzer-apps img {
|
||||
vertical-align: middle !important;
|
||||
}
|
||||
|
||||
#wappalyzer-container #wappalyzer-apps a:link,
|
||||
#wappalyzer-container #wappalyzer-apps a:hover,
|
||||
#wappalyzer-container #wappalyzer-apps a:active,
|
||||
#wappalyzer-container #wappalyzer-apps a:visited {
|
||||
display: block !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
#wappalyzer-container #wappalyzer-apps a:hover {
|
||||
color: #0072B6 !important;
|
||||
}
|
||||
|
||||
#wappalyzer-container #wappalyzer-apps div.wappalyzer-app {
|
||||
background: #fff !important;
|
||||
border-radius: 5px !important;
|
||||
-moz-border-radius: 5px !important;
|
||||
-webkit-border-radius: 5px !important;
|
||||
margin: 0 2px 2px 2px !important;
|
||||
padding: 7px 10px !important;
|
||||
}
|
||||
|
||||
#wappalyzer-container #wappalyzer-apps a.wappalyzer-application:link,
|
||||
#wappalyzer-container #wappalyzer-apps a.wappalyzer-application:hover,
|
||||
#wappalyzer-container #wappalyzer-apps a.wappalyzer-application:active,
|
||||
#wappalyzer-container #wappalyzer-apps a.wappalyzer-application:visited {
|
||||
font-weight: bold !important;
|
||||
margin-bottom: 3px !important;
|
||||
}
|
||||
|
||||
#wappalyzer-container #wappalyzer-apps a.wappalyzer-category:link,
|
||||
#wappalyzer-container #wappalyzer-apps a.wappalyzer-category:hover,
|
||||
#wappalyzer-container #wappalyzer-apps a.wappalyzer-category:active,
|
||||
#wappalyzer-container #wappalyzer-apps a.wappalyzer-category:visited {
|
||||
color: #999 !important;
|
||||
}
|
||||
|
||||
#wappalyzer-container #wappalyzer-apps a.wappalyzer-category:hover {
|
||||
color: #0072B6 !important;
|
||||
}
|
Before Width: | Height: | Size: 3.9 KiB |
@ -1,94 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>Wappalyzer</title>
|
||||
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
color: #000;
|
||||
font-family: Verdana, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#bookmarklet {
|
||||
border: 1px solid #333;
|
||||
color: #000;
|
||||
display: inline-block;
|
||||
padding: 10px 25px;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
Drag this button to your bookmarks toolbar:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a id="bookmarklet" href="javascript: void(0);">Wappalyzer</a>
|
||||
</p>
|
||||
|
||||
<div id="bookmarklet-code" style="display: none">
|
||||
(function() {
|
||||
var
|
||||
d = document,
|
||||
e = d.getElementById('wappalyzer-container');
|
||||
|
||||
if ( e !== null ) {
|
||||
d.body.removeChild(e);
|
||||
}
|
||||
|
||||
var
|
||||
u = 'https://wappalyzer.com/bookmarklet/',
|
||||
t = new Date().getTime(),
|
||||
c = d.createElement('div'),
|
||||
p = d.createElement('div'),
|
||||
l = d.createElement('link'),
|
||||
s = d.createElement('script');
|
||||
|
||||
c.setAttribute('id', 'wappalyzer-container');
|
||||
|
||||
l.setAttribute('rel', 'stylesheet');
|
||||
l.setAttribute('href', u + 'css/wappalyzer.css');
|
||||
|
||||
d.head.appendChild(l);
|
||||
|
||||
p.setAttribute('id', 'wappalyzer-pending');
|
||||
p.setAttribute('style', 'background-image: url(' + u + 'images/pending.gif) !important');
|
||||
|
||||
c.appendChild(p);
|
||||
|
||||
s.setAttribute('src', u + 'js/wappalyzer.js?' + t);
|
||||
|
||||
s.onload = function() {
|
||||
s = d.createElement('script');
|
||||
|
||||
s.setAttribute('src', u + 'js/apps.js?' + t);
|
||||
|
||||
s.onload = function() {
|
||||
s = d.createElement('script');
|
||||
|
||||
s.setAttribute('src', u + 'js/driver.js?' + t);
|
||||
|
||||
c.appendChild(s);
|
||||
};
|
||||
|
||||
c.appendChild(s);
|
||||
};
|
||||
|
||||
c.appendChild(s);
|
||||
|
||||
d.body.appendChild(c);
|
||||
})();
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('#bookmarklet').attr('href', 'javascript:' + $('#bookmarklet-code').html().replace(/\s+/g, ' '));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,5 +1,7 @@
|
||||
apps.json
|
||||
images/icons/converted/*.png
|
||||
images/icons/*.png
|
||||
images/icons/*.svg
|
||||
js/wappalyzer.js
|
||||
js/iframe.js
|
||||
js/network.js
|
||||
|
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 665 B After Width: | Height: | Size: 643 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 634 B After Width: | Height: | Size: 555 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 363 B |
Before Width: | Height: | Size: 273 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 143 B |
Before Width: | Height: | Size: 926 B |
Before Width: | Height: | Size: 635 B |
Before Width: | Height: | Size: 752 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 554 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 136 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 143 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 800 B |
Before Width: | Height: | Size: 780 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 594 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 171 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 834 B |
Before Width: | Height: | Size: 734 B |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 851 B |
Before Width: | Height: | Size: 964 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 842 B |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 613 B |
Before Width: | Height: | Size: 634 B |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 4.6 KiB |
@ -1,530 +0,0 @@
|
||||
/**
|
||||
* Wappalyzer v2
|
||||
*
|
||||
* Created by Elbert Alias <elbert@alias.io>
|
||||
*
|
||||
* License: GPLv3 http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
*/
|
||||
|
||||
var wappalyzer = (function() {
|
||||
//'use strict';
|
||||
|
||||
/**
|
||||
* Application class
|
||||
*/
|
||||
var Application = function(app, detected) {
|
||||
this.app = app;
|
||||
this.confidence = {};
|
||||
this.confidenceTotal = 0;
|
||||
this.detected = Boolean(detected);
|
||||
this.excludes = [];
|
||||
this.version = '';
|
||||
this.versions = [];
|
||||
};
|
||||
|
||||
Application.prototype = {
|
||||
/**
|
||||
* Calculate confidence total
|
||||
*/
|
||||
getConfidence: function() {
|
||||
var total = 0, id;
|
||||
|
||||
for ( id in this.confidence ) {
|
||||
total += this.confidence[id];
|
||||
}
|
||||
|
||||
return this.confidenceTotal = Math.min(total, 100);
|
||||
},
|
||||
|
||||
/**
|
||||
* Resolve version number (find the longest version number that contains all shorter detected version numbers)
|
||||
*/
|
||||
getVersion: function() {
|
||||
var i, resolved;
|
||||
|
||||
if ( !this.versions.length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.versions.sort(function(a, b) {
|
||||
return a.length - b.length;
|
||||
});
|
||||
|
||||
resolved = this.versions[0];
|
||||
|
||||
for ( i = 1; i < this.versions.length; i++ ) {
|
||||
if ( this.versions[i].indexOf(resolved) === -1 ) {
|
||||
break;
|
||||
}
|
||||
|
||||
resolved = this.versions[i];
|
||||
}
|
||||
|
||||
return this.version = resolved;
|
||||
},
|
||||
|
||||
setDetected: function(pattern, type, value, key) {
|
||||
this.detected = true;
|
||||
|
||||
// Set confidence level
|
||||
this.confidence[type + ' ' + ( key ? key + ' ' : '' ) + pattern.regex] = pattern.confidence ? pattern.confidence : 100;
|
||||
|
||||
// Detect version number
|
||||
if ( pattern.version ) {
|
||||
var
|
||||
version = pattern.version,
|
||||
matches = pattern.regex.exec(value);
|
||||
|
||||
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]);
|
||||
|
||||
w.log({ version: version });
|
||||
}
|
||||
|
||||
// Replace back references
|
||||
version = version.replace(new RegExp('\\\\' + i, 'g'), match ? match : '');
|
||||
});
|
||||
|
||||
if ( version && this.versions.indexOf(version) < 0 ) {
|
||||
this.versions.push(version);
|
||||
}
|
||||
|
||||
this.getVersion();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var Profiler = function() {
|
||||
this.regexCount = 0;
|
||||
this.startTime = new Date().getTime();
|
||||
this.lastTime = new Date().getTime();
|
||||
this.slowest = { duration: null, app: '', type: '', pattern: '' };
|
||||
this.timedOut = false;
|
||||
};
|
||||
|
||||
Profiler.prototype = {
|
||||
checkPoint: function(app, type, regex) {
|
||||
var duration = new Date().getTime() - this.lastTime;
|
||||
|
||||
if ( !this.slowest.duration || duration > this.slowest.duration ) {
|
||||
this.slowest.duration = duration;
|
||||
this.slowest.app = app;
|
||||
this.slowest.type = type;
|
||||
this.slowest.regex = regex;
|
||||
}
|
||||
|
||||
this.regexCount++;
|
||||
|
||||
this.lastTime = new Date().getTime();
|
||||
|
||||
this.timedOut = this.lastTime - this.startTime > 1000;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Call driver functions
|
||||
*/
|
||||
var driver = function(func, args) {
|
||||
if ( typeof w.driver[func] !== 'function' ) {
|
||||
w.log('not implemented: w.driver.' + func, 'warn');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( func !== 'log' ) {
|
||||
w.log('w.driver.' + func);
|
||||
}
|
||||
|
||||
return w.driver[func](args);
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse apps.json patterns
|
||||
*/
|
||||
var parse = function(patterns) {
|
||||
var
|
||||
attrs,
|
||||
parsed = [];
|
||||
|
||||
// Convert single patterns to an array
|
||||
if ( typeof patterns === 'string' ) {
|
||||
patterns = [ patterns ];
|
||||
}
|
||||
|
||||
patterns.forEach(function(pattern) {
|
||||
attrs = {};
|
||||
|
||||
pattern.split('\\;').forEach(function(attr, i) {
|
||||
if ( i ) {
|
||||
// Key value pairs
|
||||
attr = attr.split(':');
|
||||
|
||||
if ( attr.length > 1 ) {
|
||||
attrs[attr.shift()] = attr.join(':');
|
||||
}
|
||||
} else {
|
||||
attrs.string = attr;
|
||||
|
||||
try {
|
||||
attrs.regex = new RegExp(attr.replace('/', '\/'), 'i'); // Escape slashes in regular expression
|
||||
} catch (e) {
|
||||
attrs.regex = new RegExp();
|
||||
|
||||
w.log(e + ': ' + attr, 'error');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
parsed.push(attrs);
|
||||
});
|
||||
|
||||
return parsed;
|
||||
};
|
||||
|
||||
/**
|
||||
* Main script
|
||||
*/
|
||||
var w = {
|
||||
apps: {},
|
||||
cats: null,
|
||||
ping: { hostnames: {} },
|
||||
adCache: [],
|
||||
detected: {},
|
||||
|
||||
config: {
|
||||
websiteURL: 'https://wappalyzer.com/',
|
||||
twitterURL: 'https://twitter.com/Wappalyzer',
|
||||
githubURL: 'https://github.com/AliasIO/Wappalyzer',
|
||||
},
|
||||
|
||||
/**
|
||||
* Log messages to console
|
||||
*/
|
||||
log: function(message, type) {
|
||||
if ( type === undefined ) {
|
||||
type = 'debug';
|
||||
}
|
||||
|
||||
if ( typeof message === 'object' ) {
|
||||
message = JSON.stringify(message);
|
||||
}
|
||||
|
||||
driver('log', { message: message, type: type });
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize
|
||||
*/
|
||||
init: function() {
|
||||
w.log('w.init');
|
||||
|
||||
// Checks
|
||||
if ( w.driver === undefined ) {
|
||||
w.log('no driver, exiting');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize driver
|
||||
driver('init');
|
||||
},
|
||||
|
||||
/**
|
||||
* Analyze the request
|
||||
*/
|
||||
analyze: function(hostname, url, data) {
|
||||
var
|
||||
i, j, app, confidence, type, regexMeta, regexScript, match, content, meta, header, version, id,
|
||||
profiler = new Profiler(),
|
||||
apps = {},
|
||||
excludes = [],
|
||||
checkImplies = true;
|
||||
|
||||
w.log('w.analyze');
|
||||
|
||||
// Remove hash from URL
|
||||
data.url = url = url.split('#')[0];
|
||||
|
||||
if ( w.apps === undefined || w.categories === undefined ) {
|
||||
w.log('apps.json not loaded, check for syntax errors');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( w.detected[url] === undefined ) {
|
||||
w.detected[url] = {};
|
||||
}
|
||||
|
||||
for ( app in w.apps ) {
|
||||
// Exit loop after one second to prevent CPU hogging
|
||||
// Remaining patterns will not be evaluated
|
||||
if ( profiler.timedOut ) {
|
||||
w.log('Timeout, exiting loop');
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
apps[app] = w.detected[url] && w.detected[url][app] ? w.detected[url][app] : new Application(app);
|
||||
|
||||
for ( type in w.apps[app] ) {
|
||||
switch ( type ) {
|
||||
case 'url':
|
||||
parse(w.apps[app][type]).forEach(function(pattern) {
|
||||
if ( pattern.regex.test(url) ) {
|
||||
apps[app].setDetected(pattern, type, url);
|
||||
}
|
||||
|
||||
profiler.checkPoint(app, type, pattern.regex);
|
||||
});
|
||||
|
||||
break;
|
||||
case 'html':
|
||||
if ( typeof data[type] !== 'string' || !data.html ) {
|
||||
break;
|
||||
}
|
||||
|
||||
parse(w.apps[app][type]).forEach(function(pattern) {
|
||||
if ( pattern.regex.test(data[type]) ) {
|
||||
apps[app].setDetected(pattern, type, data[type]);
|
||||
}
|
||||
|
||||
profiler.checkPoint(app, type, pattern.regex);
|
||||
});
|
||||
|
||||
break;
|
||||
case 'script':
|
||||
if ( typeof data.html !== 'string' || !data.html ) {
|
||||
break;
|
||||
}
|
||||
|
||||
regexScript = new RegExp('<script[^>]+src=("|\')([^"\']+)', 'ig');
|
||||
|
||||
parse(w.apps[app][type]).forEach(function(pattern) {
|
||||
while ( match = regexScript.exec(data.html) ) {
|
||||
if ( pattern.regex.test(match[2]) ) {
|
||||
apps[app].setDetected(pattern, type, match[2]);
|
||||
}
|
||||
}
|
||||
|
||||
profiler.checkPoint(app, type, pattern.regex);
|
||||
});
|
||||
|
||||
break;
|
||||
case 'meta':
|
||||
if ( typeof data.html !== 'string' || !data.html ) {
|
||||
break;
|
||||
}
|
||||
|
||||
regexMeta = /<meta[^>]+>/ig;
|
||||
|
||||
while ( match = regexMeta.exec(data.html) ) {
|
||||
for ( meta in w.apps[app][type] ) {
|
||||
profiler.checkPoint(app, type, regexMeta);
|
||||
|
||||
if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) {
|
||||
content = match.toString().match(/content=("|')([^"']+)("|')/i);
|
||||
|
||||
parse(w.apps[app].meta[meta]).forEach(function(pattern) {
|
||||
if ( content && content.length === 4 && pattern.regex.test(content[2]) ) {
|
||||
apps[app].setDetected(pattern, type, content[2], meta);
|
||||
}
|
||||
|
||||
profiler.checkPoint(app, type, pattern.regex);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case 'headers':
|
||||
if ( typeof data[type] !== 'object' || !data[type] ) {
|
||||
break;
|
||||
}
|
||||
|
||||
for ( header in w.apps[app].headers ) {
|
||||
parse(w.apps[app][type][header]).forEach(function(pattern) {
|
||||
if ( typeof data[type][header.toLowerCase()] === 'string' && pattern.regex.test(data[type][header.toLowerCase()]) ) {
|
||||
apps[app].setDetected(pattern, type, data[type][header.toLowerCase()], header);
|
||||
}
|
||||
|
||||
profiler.checkPoint(app, type, pattern.regex);
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
case 'env':
|
||||
if ( typeof data[type] !== 'object' || !data[type] ) {
|
||||
break;
|
||||
}
|
||||
|
||||
parse(w.apps[app][type]).forEach(function(pattern) {
|
||||
for ( i in data[type] ) {
|
||||
|
||||
if ( pattern.regex.test(data[type][i]) ) {
|
||||
apps[app].setDetected(pattern, type, data[type][i]);
|
||||
}
|
||||
}
|
||||
|
||||
profiler.checkPoint(app, type, pattern.regex);
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
// Exclude app in detected apps only
|
||||
for ( app in apps ) {
|
||||
if (w.apps[app].excludes ) {
|
||||
if ( typeof w.apps[app].excludes === 'string' ) {
|
||||
w.apps[app].excludes = [ w.apps[app].excludes ];
|
||||
}
|
||||
|
||||
w.apps[app].excludes.forEach(function(excluded) {
|
||||
excludes.push(excluded);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
while ( checkImplies ) {
|
||||
checkImplies = false;
|
||||
|
||||
for ( app in apps ) {
|
||||
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.forEach(function(implied) {
|
||||
implied = parse(implied)[0];
|
||||
|
||||
if ( !w.apps[implied.string] ) {
|
||||
w.log('Implied application ' + implied.string + ' does not exist', 'warn');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !apps.hasOwnProperty(implied.string) ) {
|
||||
apps[implied.string] = w.detected[url] && w.detected[url][implied.string] ? w.detected[url][implied.string] : new Application(implied.string, true);
|
||||
|
||||
checkImplies = true;
|
||||
}
|
||||
|
||||
// Apply app confidence to implied app
|
||||
for ( id in confidence ) {
|
||||
apps[implied.string].confidence[id + ' implied by ' + app] = confidence[id] * ( implied.confidence ? implied.confidence / 100 : 1 );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
w.log(Object.keys(apps).length + ' apps detected: ' + Object.keys(apps).join(', ') + ' on ' + url);
|
||||
|
||||
// Keep history of detected apps
|
||||
for ( app in apps ) {
|
||||
confidence = apps[app].confidence;
|
||||
version = apps[app].version;
|
||||
|
||||
// Per URL
|
||||
w.detected[url][app] = apps[app];
|
||||
|
||||
for ( id in confidence ) {
|
||||
w.detected[url][app].confidence[id] = confidence[id];
|
||||
}
|
||||
|
||||
if ( w.detected[url][app].getConfidence() >= 100 ) {
|
||||
// Per hostname
|
||||
if ( /(www.)?((.+?)\.(([a-z]{2,3}\.)?[a-z]{2,6}))$/.test(hostname) && !/((local|dev(elopment)?|stag(e|ing)?|test(ing)?|demo(shop)?|admin|google|cache)\.|\/admin|\.local)/.test(url) ) {
|
||||
if ( !w.ping.hostnames.hasOwnProperty(hostname) ) {
|
||||
w.ping.hostnames[hostname] = { applications: {}, meta: {} };
|
||||
}
|
||||
|
||||
if ( !w.ping.hostnames[hostname].applications.hasOwnProperty(app) ) {
|
||||
w.ping.hostnames[hostname].applications[app] = { hits: 0 };
|
||||
}
|
||||
|
||||
w.ping.hostnames[hostname].applications[app].hits ++;
|
||||
|
||||
if ( version ) {
|
||||
w.ping.hostnames[hostname].applications[app].version = version;
|
||||
}
|
||||
} else {
|
||||
w.log('Ignoring hostname "' + hostname + '"');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Additional information
|
||||
if ( w.ping.hostnames.hasOwnProperty(hostname) ) {
|
||||
if ( typeof data.html === 'string' && data.html ) {
|
||||
match = data.html.match(/<html[^>]*[: ]lang="([a-z]{2}((-|_)[A-Z]{2})?)"/i);
|
||||
|
||||
if ( match && match.length ) {
|
||||
w.ping.hostnames[hostname].meta['language'] = match[1];
|
||||
}
|
||||
|
||||
regexMeta = /<meta[^>]+>/ig;
|
||||
|
||||
while ( match = regexMeta.exec(data.html) ) {
|
||||
if ( !match.length ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
match = match[0].match(/name="(author|copyright|country|description|keywords)"[^>]*content="([^"]+)"/i);
|
||||
|
||||
if ( match && match.length === 3 ) {
|
||||
w.ping.hostnames[hostname].meta[match[1]] = match[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( Object.keys(w.ping.hostnames).length >= 20 || w.adCache.length >= 40 ) {
|
||||
driver('ping');
|
||||
}
|
||||
|
||||
apps = null;
|
||||
data = null;
|
||||
|
||||
driver('displayApps');
|
||||
}
|
||||
};
|
||||
|
||||
return w;
|
||||
})();
|
||||
|
||||
// CommonJS package
|
||||
// See http://wiki.commonjs.org/wiki/CommonJS
|
||||
if ( typeof exports === 'object' ) {
|
||||
exports.wappalyzer = wappalyzer;
|
||||
}
|
@ -1,530 +0,0 @@
|
||||
/**
|
||||
* Wappalyzer v2
|
||||
*
|
||||
* Created by Elbert Alias <elbert@alias.io>
|
||||
*
|
||||
* License: GPLv3 http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
*/
|
||||
|
||||
var wappalyzer = (function() {
|
||||
//'use strict';
|
||||
|
||||
/**
|
||||
* Application class
|
||||
*/
|
||||
var Application = function(app, detected) {
|
||||
this.app = app;
|
||||
this.confidence = {};
|
||||
this.confidenceTotal = 0;
|
||||
this.detected = Boolean(detected);
|
||||
this.excludes = [];
|
||||
this.version = '';
|
||||
this.versions = [];
|
||||
};
|
||||
|
||||
Application.prototype = {
|
||||
/**
|
||||
* Calculate confidence total
|
||||
*/
|
||||
getConfidence: function() {
|
||||
var total = 0, id;
|
||||
|
||||
for ( id in this.confidence ) {
|
||||
total += this.confidence[id];
|
||||
}
|
||||
|
||||
return this.confidenceTotal = Math.min(total, 100);
|
||||
},
|
||||
|
||||
/**
|
||||
* Resolve version number (find the longest version number that contains all shorter detected version numbers)
|
||||
*/
|
||||
getVersion: function() {
|
||||
var i, resolved;
|
||||
|
||||
if ( !this.versions.length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.versions.sort(function(a, b) {
|
||||
return a.length - b.length;
|
||||
});
|
||||
|
||||
resolved = this.versions[0];
|
||||
|
||||
for ( i = 1; i < this.versions.length; i++ ) {
|
||||
if ( this.versions[i].indexOf(resolved) === -1 ) {
|
||||
break;
|
||||
}
|
||||
|
||||
resolved = this.versions[i];
|
||||
}
|
||||
|
||||
return this.version = resolved;
|
||||
},
|
||||
|
||||
setDetected: function(pattern, type, value, key) {
|
||||
this.detected = true;
|
||||
|
||||
// Set confidence level
|
||||
this.confidence[type + ' ' + ( key ? key + ' ' : '' ) + pattern.regex] = pattern.confidence ? pattern.confidence : 100;
|
||||
|
||||
// Detect version number
|
||||
if ( pattern.version ) {
|
||||
var
|
||||
version = pattern.version,
|
||||
matches = pattern.regex.exec(value);
|
||||
|
||||
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]);
|
||||
|
||||
w.log({ version: version });
|
||||
}
|
||||
|
||||
// Replace back references
|
||||
version = version.replace(new RegExp('\\\\' + i, 'g'), match ? match : '');
|
||||
});
|
||||
|
||||
if ( version && this.versions.indexOf(version) < 0 ) {
|
||||
this.versions.push(version);
|
||||
}
|
||||
|
||||
this.getVersion();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var Profiler = function() {
|
||||
this.regexCount = 0;
|
||||
this.startTime = new Date().getTime();
|
||||
this.lastTime = new Date().getTime();
|
||||
this.slowest = { duration: null, app: '', type: '', pattern: '' };
|
||||
this.timedOut = false;
|
||||
};
|
||||
|
||||
Profiler.prototype = {
|
||||
checkPoint: function(app, type, regex) {
|
||||
var duration = new Date().getTime() - this.lastTime;
|
||||
|
||||
if ( !this.slowest.duration || duration > this.slowest.duration ) {
|
||||
this.slowest.duration = duration;
|
||||
this.slowest.app = app;
|
||||
this.slowest.type = type;
|
||||
this.slowest.regex = regex;
|
||||
}
|
||||
|
||||
this.regexCount++;
|
||||
|
||||
this.lastTime = new Date().getTime();
|
||||
|
||||
this.timedOut = this.lastTime - this.startTime > 1000;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Call driver functions
|
||||
*/
|
||||
var driver = function(func, args) {
|
||||
if ( typeof w.driver[func] !== 'function' ) {
|
||||
w.log('not implemented: w.driver.' + func, 'warn');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( func !== 'log' ) {
|
||||
w.log('w.driver.' + func);
|
||||
}
|
||||
|
||||
return w.driver[func](args);
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse apps.json patterns
|
||||
*/
|
||||
var parse = function(patterns) {
|
||||
var
|
||||
attrs,
|
||||
parsed = [];
|
||||
|
||||
// Convert single patterns to an array
|
||||
if ( typeof patterns === 'string' ) {
|
||||
patterns = [ patterns ];
|
||||
}
|
||||
|
||||
patterns.forEach(function(pattern) {
|
||||
attrs = {};
|
||||
|
||||
pattern.split('\\;').forEach(function(attr, i) {
|
||||
if ( i ) {
|
||||
// Key value pairs
|
||||
attr = attr.split(':');
|
||||
|
||||
if ( attr.length > 1 ) {
|
||||
attrs[attr.shift()] = attr.join(':');
|
||||
}
|
||||
} else {
|
||||
attrs.string = attr;
|
||||
|
||||
try {
|
||||
attrs.regex = new RegExp(attr.replace('/', '\/'), 'i'); // Escape slashes in regular expression
|
||||
} catch (e) {
|
||||
attrs.regex = new RegExp();
|
||||
|
||||
w.log(e + ': ' + attr, 'error');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
parsed.push(attrs);
|
||||
});
|
||||
|
||||
return parsed;
|
||||
};
|
||||
|
||||
/**
|
||||
* Main script
|
||||
*/
|
||||
var w = {
|
||||
apps: {},
|
||||
cats: null,
|
||||
ping: { hostnames: {} },
|
||||
detected: {},
|
||||
adCache: [],
|
||||
|
||||
config: {
|
||||
websiteURL: 'https://wappalyzer.com/',
|
||||
twitterURL: 'https://twitter.com/Wappalyzer',
|
||||
githubURL: 'https://github.com/AliasIO/Wappalyzer',
|
||||
},
|
||||
|
||||
/**
|
||||
* Log messages to console
|
||||
*/
|
||||
log: function(message, type) {
|
||||
if ( type === undefined ) {
|
||||
type = 'debug';
|
||||
}
|
||||
|
||||
if ( typeof message === 'object' ) {
|
||||
message = JSON.stringify(message);
|
||||
}
|
||||
|
||||
driver('log', { message: '[wappalyzer ' + type + '] ' + message, type: type });
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize
|
||||
*/
|
||||
init: function() {
|
||||
w.log('w.init');
|
||||
|
||||
// Checks
|
||||
if ( w.driver === undefined ) {
|
||||
w.log('no driver, exiting');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize driver
|
||||
driver('init');
|
||||
},
|
||||
|
||||
/**
|
||||
* Analyze the request
|
||||
*/
|
||||
analyze: function(hostname, url, data) {
|
||||
var
|
||||
i, j, app, confidence, type, regexMeta, regexScript, match, content, meta, header, version, id,
|
||||
profiler = new Profiler(),
|
||||
apps = {},
|
||||
excludes = [],
|
||||
checkImplies = true;
|
||||
|
||||
w.log('w.analyze');
|
||||
|
||||
// Remove hash from URL
|
||||
data.url = url = url.split('#')[0];
|
||||
|
||||
if ( w.apps === undefined || w.categories === undefined ) {
|
||||
w.log('apps.json not loaded, check for syntax errors');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( w.detected[url] === undefined ) {
|
||||
w.detected[url] = {};
|
||||
}
|
||||
|
||||
for ( app in w.apps ) {
|
||||
// Exit loop after one second to prevent CPU hogging
|
||||
// Remaining patterns will not be evaluated
|
||||
if ( profiler.timedOut ) {
|
||||
w.log('Timeout, exiting loop');
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
apps[app] = w.detected[url] && w.detected[url][app] ? w.detected[url][app] : new Application(app);
|
||||
|
||||
for ( type in w.apps[app] ) {
|
||||
switch ( type ) {
|
||||
case 'url':
|
||||
parse(w.apps[app][type]).forEach(function(pattern) {
|
||||
if ( pattern.regex.test(url) ) {
|
||||
apps[app].setDetected(pattern, type, url);
|
||||
}
|
||||
|
||||
profiler.checkPoint(app, type, pattern.regex);
|
||||
});
|
||||
|
||||
break;
|
||||
case 'html':
|
||||
if ( typeof data[type] !== 'string' || !data.html ) {
|
||||
break;
|
||||
}
|
||||
|
||||
parse(w.apps[app][type]).forEach(function(pattern) {
|
||||
if ( pattern.regex.test(data[type]) ) {
|
||||
apps[app].setDetected(pattern, type, data[type]);
|
||||
}
|
||||
|
||||
profiler.checkPoint(app, type, pattern.regex);
|
||||
});
|
||||
|
||||
break;
|
||||
case 'script':
|
||||
if ( typeof data.html !== 'string' || !data.html ) {
|
||||
break;
|
||||
}
|
||||
|
||||
regexScript = new RegExp('<script[^>]+src=("|\')([^"\']+)', 'ig');
|
||||
|
||||
parse(w.apps[app][type]).forEach(function(pattern) {
|
||||
while ( match = regexScript.exec(data.html) ) {
|
||||
if ( pattern.regex.test(match[2]) ) {
|
||||
apps[app].setDetected(pattern, type, match[2]);
|
||||
}
|
||||
}
|
||||
|
||||
profiler.checkPoint(app, type, pattern.regex);
|
||||
});
|
||||
|
||||
break;
|
||||
case 'meta':
|
||||
if ( typeof data.html !== 'string' || !data.html ) {
|
||||
break;
|
||||
}
|
||||
|
||||
regexMeta = /<meta[^>]+>/ig;
|
||||
|
||||
while ( match = regexMeta.exec(data.html) ) {
|
||||
for ( meta in w.apps[app][type] ) {
|
||||
profiler.checkPoint(app, type, regexMeta);
|
||||
|
||||
if ( new RegExp('name=["\']' + meta + '["\']', 'i').test(match) ) {
|
||||
content = match.toString().match(/content=("|')([^"']+)("|')/i);
|
||||
|
||||
parse(w.apps[app].meta[meta]).forEach(function(pattern) {
|
||||
if ( content && content.length === 4 && pattern.regex.test(content[2]) ) {
|
||||
apps[app].setDetected(pattern, type, content[2], meta);
|
||||
}
|
||||
|
||||
profiler.checkPoint(app, type, pattern.regex);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case 'headers':
|
||||
if ( typeof data[type] !== 'object' || !data[type] ) {
|
||||
break;
|
||||
}
|
||||
|
||||
for ( header in w.apps[app].headers ) {
|
||||
parse(w.apps[app][type][header]).forEach(function(pattern) {
|
||||
if ( typeof data[type][header.toLowerCase()] === 'string' && pattern.regex.test(data[type][header.toLowerCase()]) ) {
|
||||
apps[app].setDetected(pattern, type, data[type][header.toLowerCase()], header);
|
||||
}
|
||||
|
||||
profiler.checkPoint(app, type, pattern.regex);
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
case 'env':
|
||||
if ( typeof data[type] !== 'object' || !data[type] ) {
|
||||
break;
|
||||
}
|
||||
|
||||
parse(w.apps[app][type]).forEach(function(pattern) {
|
||||
for ( i in data[type] ) {
|
||||
|
||||
if ( pattern.regex.test(data[type][i]) ) {
|
||||
apps[app].setDetected(pattern, type, data[type][i]);
|
||||
}
|
||||
}
|
||||
|
||||
profiler.checkPoint(app, type, pattern.regex);
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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];
|
||||
}
|
||||
}
|
||||
|
||||
// Exclude app in detected apps only
|
||||
for ( app in apps ) {
|
||||
if (w.apps[app].excludes ) {
|
||||
if ( typeof w.apps[app].excludes === 'string' ) {
|
||||
w.apps[app].excludes = [ w.apps[app].excludes ];
|
||||
}
|
||||
|
||||
w.apps[app].excludes.forEach(function(excluded) {
|
||||
excludes.push(excluded);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
while ( checkImplies ) {
|
||||
checkImplies = false;
|
||||
|
||||
for ( app in apps ) {
|
||||
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.forEach(function(implied) {
|
||||
implied = parse(implied)[0];
|
||||
|
||||
if ( !w.apps[implied.string] ) {
|
||||
w.log('Implied application ' + implied.string + ' does not exist', 'warn');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !apps.hasOwnProperty(implied.string) ) {
|
||||
apps[implied.string] = w.detected[url] && w.detected[url][implied.string] ? w.detected[url][implied.string] : new Application(implied.string, true);
|
||||
|
||||
checkImplies = true;
|
||||
}
|
||||
|
||||
// Apply app confidence to implied app
|
||||
for ( id in confidence ) {
|
||||
apps[implied.string].confidence[id + ' implied by ' + app] = confidence[id] * ( implied.confidence ? implied.confidence / 100 : 1 );
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
w.log(Object.keys(apps).length + ' apps detected: ' + Object.keys(apps).join(', ') + ' on ' + url);
|
||||
|
||||
// Keep history of detected apps
|
||||
for ( app in apps ) {
|
||||
confidence = apps[app].confidence;
|
||||
version = apps[app].version;
|
||||
|
||||
// Per URL
|
||||
w.detected[url][app] = apps[app];
|
||||
|
||||
for ( id in confidence ) {
|
||||
w.detected[url][app].confidence[id] = confidence[id];
|
||||
}
|
||||
|
||||
if ( w.detected[url][app].getConfidence() >= 500 ) {
|
||||
// Per hostname
|
||||
if ( /(www.)?((.+?)\.(([a-z]{2,3}\.)?[a-z]{2,6}))$/.test(hostname) && !/((local|dev(elopment)?|stag(e|ing)?|test(ing)?|demo(shop)?|admin|google|cache)\.|\/admin|\.local)/.test(url) ) {
|
||||
if ( !w.ping.hostnames.hasOwnProperty(hostname) ) {
|
||||
w.ping.hostnames[hostname] = { applications: {}, meta: {} };
|
||||
}
|
||||
|
||||
if ( !w.ping.hostnames[hostname].applications.hasOwnProperty(app) ) {
|
||||
w.ping.hostnames[hostname].applications[app] = { hits: 0 };
|
||||
}
|
||||
|
||||
w.ping.hostnames[hostname].applications[app].hits ++;
|
||||
|
||||
if ( version ) {
|
||||
w.ping.hostnames[hostname].applications[app].version = version;
|
||||
}
|
||||
} else {
|
||||
w.log('Ignoring hostname "' + hostname + '"');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Additional information
|
||||
if ( w.ping.hostnames.hasOwnProperty(hostname) ) {
|
||||
if ( typeof data.html === 'string' && data.html ) {
|
||||
match = data.html.match(/<html[^>]*[: ]lang="([a-z]{2}((-|_)[A-Z]{2})?)"/i);
|
||||
|
||||
if ( match && match.length ) {
|
||||
w.ping.hostnames[hostname].meta['language'] = match[1];
|
||||
}
|
||||
|
||||
regexMeta = /<meta[^>]+>/ig;
|
||||
|
||||
while ( match = regexMeta.exec(data.html) ) {
|
||||
if ( !match.length ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
match = match[0].match(/name="(author|copyright|country|description|keywords)"[^>]*content="([^"]+)"/i);
|
||||
|
||||
if ( match && match.length === 3 ) {
|
||||
w.ping.hostnames[hostname].meta[match[1]] = match[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( Object.keys(w.ping.hostnames).length >= 20 || w.adCache.length >= 40) {
|
||||
driver('ping');
|
||||
}
|
||||
|
||||
apps = null;
|
||||
data = null;
|
||||
|
||||
driver('displayApps');
|
||||
}
|
||||
};
|
||||
|
||||
return w;
|
||||
})();
|
||||
|
||||
// CommonJS package
|
||||
// See http://wiki.commonjs.org/wiki/CommonJS
|
||||
if ( typeof exports === 'object' ) {
|
||||
exports.wappalyzer = wappalyzer;
|
||||
}
|
Before Width: | Height: | Size: 9.5 KiB |
@ -1,30 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Wappalyzer</title>
|
||||
|
||||
<link rel="icon" type="image/png" href="images/icon.png"/>
|
||||
|
||||
<script type="text/javascript" src="js/wappalyzer.js"></script>
|
||||
<script type="text/javascript" src="js/driver.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: Verdana, Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#apps {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
#apps img {
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="apps"></div>
|
||||
</body>
|
||||
</html>
|
@ -1,67 +0,0 @@
|
||||
(function() {
|
||||
if ( wappalyzer == null ) { return };
|
||||
|
||||
var w = wappalyzer;
|
||||
|
||||
w.driver = {
|
||||
/**
|
||||
* Log messages to console
|
||||
*/
|
||||
log: function(args) {
|
||||
if ( console != null ) { console[args.type](args.message) };
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize
|
||||
*/
|
||||
init: function() {
|
||||
// Load apps.json
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
||||
xhr.open('GET', 'apps.json', true);
|
||||
|
||||
xhr.overrideMimeType('application/json');
|
||||
|
||||
xhr.onload = function() {
|
||||
var json = JSON.parse(xhr.responseText);
|
||||
|
||||
w.categories = json.categories;
|
||||
w.apps = json.apps;
|
||||
|
||||
window.document.addEventListener('DOMContentLoaded', function() {
|
||||
w.analyze('google.com', 'http://google.com', {
|
||||
html: '<script src="jquery.js"><meta name="generator" content="WordPress"/>',
|
||||
headers: { 'Server': 'Apache' },
|
||||
env: [ 'Mootools' ]
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
xhr.send(null);
|
||||
},
|
||||
|
||||
/**
|
||||
* Display apps
|
||||
*/
|
||||
displayApps: function() {
|
||||
var
|
||||
app,
|
||||
url = Object.keys(w.detected)[0];
|
||||
|
||||
document.getElementById('apps').innerHTML = '';
|
||||
|
||||
for ( app in w.detected[url] ) {
|
||||
document.getElementById('apps').innerHTML += '<img src="images/icons/' + w.apps[app].icon + '" width="16" height="16"/> ' + app + '<br/>';
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Go to URL
|
||||
*/
|
||||
goToURL: function(args) {
|
||||
window.open(args.url);
|
||||
}
|
||||
};
|
||||
|
||||
w.init();
|
||||
})();
|
@ -1,14 +0,0 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{js,py}]
|
||||
charset = utf-8
|
||||
|
||||
[*.py]
|
||||
indent_style = space
|
||||
indent_size = 4
|
@ -1,3 +0,0 @@
|
||||
wappalyzer.js
|
||||
apps.json
|
||||
node_modules/
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"node" : true,
|
||||
"browser" : "false",
|
||||
"predef": []
|
||||
}
|