Merge branch 'master' of github.com:ElbertF/Wappalyzer

main
Elbert Alias 11 years ago
commit 10991bb9f3

@ -125,7 +125,7 @@
; ;
if ( w.detected[url] != null && w.detected[url].length ) { if ( w.detected[url] != null && w.detected[url].length ) {
w.detected[url].map(function(app, i) { w.detected[url].forEach(function(app, i) {
html += html +=
'<div class="wappalyzer-app' + ( !i ? ' wappalyzer-first' : '' ) + '">' + '<div class="wappalyzer-app' + ( !i ? ' wappalyzer-first' : '' ) + '">' +
'<a target="_blank" class="wappalyzer-application" href="' + w.config.websiteURL + 'applications/' + app.toLowerCase().replace(/ /g, '-').replace(/[^a-z0-9-]/g, '') + '">' + '<a target="_blank" class="wappalyzer-application" href="' + w.config.websiteURL + 'applications/' + app.toLowerCase().replace(/ /g, '-').replace(/[^a-z0-9-]/g, '') + '">' +

@ -102,7 +102,7 @@
}); });
chrome.tabs.query({}, function(tabs) { chrome.tabs.query({}, function(tabs) {
tabs.map(function(tab) { tabs.forEach(function(tab) {
if ( tab.url.match(/^https?:\/\//) ) { if ( tab.url.match(/^https?:\/\//) ) {
chrome.tabs.executeScript(tab.id, { file: 'js/content.js' }); chrome.tabs.executeScript(tab.id, { file: 'js/content.js' });
} }
@ -152,9 +152,9 @@
// Find the main application to display // Find the main application to display
var i, appName, found = false; var i, appName, found = false;
w.driver.categoryOrder.map(function(match) { w.driver.categoryOrder.forEach(function(match) {
for ( appName in w.detected[tab.url] ) { for ( appName in w.detected[tab.url] ) {
w.apps[appName].cats.map(function(cat) { w.apps[appName].cats.forEach(function(cat) {
if ( cat == match && !found ) { if ( cat == match && !found ) {
chrome.browserAction.setIcon({ tabId: tab.id, path: 'images/icons/' + appName + '.png' }); chrome.browserAction.setIcon({ tabId: tab.id, path: 'images/icons/' + appName + '.png' });

@ -26,7 +26,7 @@
headers.forEach(function(line) { headers.forEach(function(line) {
if ( line ) { if ( line ) {
name = line.substring(0, line.indexOf(': ')); name = line.substring(0, line.indexOf(': ')).toLowerCase();
value = line.substring(line.indexOf(': ') + 2, line.length - 1); value = line.substring(line.indexOf(': ') + 2, line.length - 1);
responseHeaders[name] = value; responseHeaders[name] = value;

@ -68,7 +68,7 @@ document.addEventListener('DOMContentLoaded', function() {
'<span class="label">' + appName + ( version ? ' ' + version : '' ) + ( confidence < 100 ? ' (' + confidence + '% sure)' : '' ) + '</span>' + '<span class="label">' + appName + ( version ? ' ' + version : '' ) + ( confidence < 100 ? ' (' + confidence + '% sure)' : '' ) + '</span>' +
'</a>'; '</a>';
response.apps[appName].cats.map(function(cat) { response.apps[appName].cats.forEach(function(cat) {
html += html +=
'<a target="_blank" href="http://wappalyzer.com/categories/' + response.categories[cat] + '?utm_source=chrome&utm_medium=popup&utm_campaign=extensions">' + '<a target="_blank" href="http://wappalyzer.com/categories/' + response.categories[cat] + '?utm_source=chrome&utm_medium=popup&utm_campaign=extensions">' +
'<span class="category">' + chrome.i18n.getMessage('categoryName' + cat) + '</span>' + '<span class="category">' + chrome.i18n.getMessage('categoryName' + cat) + '</span>' +

@ -100,7 +100,7 @@
var headers = {}; var headers = {};
request.nsIHttpChannel.visitResponseHeaders(function(header, value) { request.nsIHttpChannel.visitResponseHeaders(function(header, value) {
headers[header] = value; headers[header.toLowerCase()] = value;
}); });
w.analyze(progress.currentURI.host, progress.currentURI.spec, { headers: headers }); w.analyze(progress.currentURI.host, progress.currentURI.spec, { headers: headers });

@ -46,7 +46,7 @@
displayApps: function() { displayApps: function() {
document.getElementById('apps').innerHTML = ''; document.getElementById('apps').innerHTML = '';
w.detected['http://google.com'].map(function(app) { w.detected['http://google.com'].forEach(function(app) {
document.getElementById('apps').innerHTML += '<img src="images/icons/' + app + '.png" width="16" height="16"/> ' + app + '<br/>'; document.getElementById('apps').innerHTML += '<img src="images/icons/' + app + '.png" width="16" height="16"/> ' + app + '<br/>';
}); });
}, },

@ -136,7 +136,7 @@ class Wappalyzer
if ( strpos(trim($line), ': ') !== false ) { if ( strpos(trim($line), ': ') !== false ) {
list($key, $value) = explode(': ', $line); list($key, $value) = explode(': ', $line);
$result->headers[$key] = $value; $result->headers[strtolower($key)] = $value;
} }
} }

@ -30,7 +30,7 @@ w.driver = {
version: w.detected[w.driver.data.url][app].version version: w.detected[w.driver.data.url][app].version
}; };
w.apps[app].cats.map(function(cat) { w.apps[app].cats.forEach(function(cat) {
apps[app].categories.push(w.categories[cat]); apps[app].categories.push(w.categories[cat]);
}); });
}; };

@ -18,7 +18,7 @@ class Wappalyzer
uri, body, headers = URI(url), nil, {} uri, body, headers = URI(url), nil, {}
Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https', :open_timeout => 5) do |http| Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https', :open_timeout => 5) do |http|
resp = http.get(uri.request_uri) resp = http.get(uri.request_uri)
resp.canonical_each{|k,v| headers[k] = v} resp.each_header{|k,v| headers[k.downcase] = v}
body = resp.body.encode('UTF-8', :invalid => :replace, :undef => :replace) body = resp.body.encode('UTF-8', :invalid => :replace, :undef => :replace)
end end

@ -102,8 +102,8 @@
"Adobe CQ5": { "Adobe CQ5": {
"website": "adobe.com/products/cq.html", "website": "adobe.com/products/cq.html",
"cats": [ 1 ], "cats": [ 1 ],
"url": "/etc/designs/", "url": "",
"html": "<div class=\"[^\"]*parbase", "html": ["<div class=\"[^\"]*parbase","_jcr_content","/etc/designs/","/etc/clientlibs/"],
"implies": "Java" "implies": "Java"
}, },
"Adobe GoLive": { "Adobe GoLive": {
@ -725,6 +725,12 @@
"headers": { "Set-Cookie": "DokuWiki=" }, "headers": { "Set-Cookie": "DokuWiki=" },
"implies": "PHP" "implies": "PHP"
}, },
"Dotclear": {
"website": "dotclear.org",
"cats": [ 1 ],
"meta": { "dc.title": ".*" },
"implies": "PHP"
},
"DotNetNuke": { "DotNetNuke": {
"website": "dotnetnuke.com", "website": "dotnetnuke.com",
"cats": [ 1 ], "cats": [ 1 ],
@ -737,6 +743,7 @@
"Doxygen": { "Doxygen": {
"website": "stack.nl/~dimitri/doxygen", "website": "stack.nl/~dimitri/doxygen",
"cats": [ 4 ], "cats": [ 4 ],
"meta": { "generator": "Doxygen ([\\d.]+)\\;version:\\1" },
"html": "(?:<!-- Generated by Doxygen ([\\d.]+)|<link[^>]+doxygen.css)\\;version:\\1" "html": "(?:<!-- Generated by Doxygen ([\\d.]+)|<link[^>]+doxygen.css)\\;version:\\1"
}, },
"DreamWeaver": { "DreamWeaver": {
@ -1317,7 +1324,7 @@
"jQuery": { "jQuery": {
"website": "jquery.com", "website": "jquery.com",
"cats": [ 12 ], "cats": [ 12 ],
"script": [ "jquery(?:\\-|\\.)([\\d.]*\\d)[^/]*\\.js\\;version:\\1", "([\\d.]+)/jquery(\\.min)?\\.js\\;version:\\1", "jquery.*\\.js" ], "script": [ "jquery(?:\\-|\\.)([\\d.]*\\d)[^/]*\\.js\\;version:\\1", "/([\\d.]+)/jquery(\\.min)?\\.js\\;version:\\1", "jquery.*\\.js" ],
"env": "^jQuery$" "env": "^jQuery$"
}, },
"jQuery Mobile": { "jQuery Mobile": {
@ -2987,6 +2994,11 @@
"website": "ophal.org", "website": "ophal.org",
"cats": [ 1, 11, 18 ], "cats": [ 1, 11, 18 ],
"headers": { "X-Powered-By": "^Ophal/" } "headers": { "X-Powered-By": "^Ophal/" }
},
"UIKit": {
"website": "getuikit.com",
"cats": [ 18 ],
"script": "uikit.*\\.js"
} }
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 783 B

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

@ -78,7 +78,7 @@ var wappalyzer = (function() {
w.log({ matches: matches, version: version }); w.log({ matches: matches, version: version });
if ( matches ) { if ( matches ) {
matches.map(function(match, i) { matches.forEach(function(match, i) {
// Parse ternary operator // Parse ternary operator
var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version); var ternary = new RegExp('\\\\' + i + '\\?([^:]+):(.+)$').exec(version);
@ -158,10 +158,10 @@ var wappalyzer = (function() {
patterns = [ patterns ]; patterns = [ patterns ];
} }
patterns.map(function(pattern) { patterns.forEach(function(pattern) {
attrs = {}; attrs = {};
pattern.split('\\;').map(function(attr, i) { pattern.split('\\;').forEach(function(attr, i) {
if ( i ) { if ( i ) {
// Key value pairs // Key value pairs
attr = attr.split(':'); attr = attr.split(':');
@ -276,7 +276,7 @@ var wappalyzer = (function() {
for ( type in w.apps[app] ) { for ( type in w.apps[app] ) {
switch ( type ) { switch ( type ) {
case 'url': case 'url':
parse(w.apps[app][type]).map(function(pattern) { parse(w.apps[app][type]).forEach(function(pattern) {
if ( pattern.regex.test(url) ) { if ( pattern.regex.test(url) ) {
apps[app].setDetected(pattern, type, url); apps[app].setDetected(pattern, type, url);
@ -290,7 +290,7 @@ var wappalyzer = (function() {
break; break;
} }
parse(w.apps[app][type]).map(function(pattern) { parse(w.apps[app][type]).forEach(function(pattern) {
if ( pattern.regex.test(data[type]) ) { if ( pattern.regex.test(data[type]) ) {
apps[app].setDetected(pattern, type, data[type]); apps[app].setDetected(pattern, type, data[type]);
@ -306,7 +306,7 @@ var wappalyzer = (function() {
regexScript = new RegExp('<script[^>]+src=("|\')([^"\']+)', 'ig'); regexScript = new RegExp('<script[^>]+src=("|\')([^"\']+)', 'ig');
parse(w.apps[app][type]).map(function(pattern) { parse(w.apps[app][type]).forEach(function(pattern) {
while ( match = regexScript.exec(data.html) ) { while ( match = regexScript.exec(data.html) ) {
if ( pattern.regex.test(match[2]) ) { if ( pattern.regex.test(match[2]) ) {
@ -331,7 +331,7 @@ var wappalyzer = (function() {
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);
parse(w.apps[app].meta[meta]).map(function(pattern) { parse(w.apps[app].meta[meta]).forEach(function(pattern) {
if ( content && content.length === 4 && pattern.regex.test(content[2]) ) { if ( content && content.length === 4 && pattern.regex.test(content[2]) ) {
apps[app].setDetected(pattern, type, content[2], meta); apps[app].setDetected(pattern, type, content[2], meta);
@ -349,10 +349,10 @@ var wappalyzer = (function() {
} }
for ( header in w.apps[app].headers ) { for ( header in w.apps[app].headers ) {
parse(w.apps[app][type][header]).map(function(pattern) { parse(w.apps[app][type][header]).forEach(function(pattern) {
if ( typeof data[type][header] === 'string' && pattern.regex.test(data[type][header]) ) { if ( typeof data[type][header.toLowerCase()] === 'string' && pattern.regex.test(data[type][header.toLowerCase()]) ) {
apps[app].setDetected(pattern, type, data[type][header], header); apps[app].setDetected(pattern, type, data[type][header.toLowerCase()], header);
} }
profiler.checkPoint(app, type, pattern.regex); profiler.checkPoint(app, type, pattern.regex);
}); });
@ -364,7 +364,7 @@ var wappalyzer = (function() {
break; break;
} }
parse(w.apps[app][type]).map(function(pattern) { parse(w.apps[app][type]).forEach(function(pattern) {
for ( i in data[type] ) { for ( i in data[type] ) {
if ( pattern.regex.test(data[type][i]) ) { if ( pattern.regex.test(data[type][i]) ) {
@ -402,7 +402,7 @@ var wappalyzer = (function() {
w.apps[app].implies = [ w.apps[app].implies ]; w.apps[app].implies = [ w.apps[app].implies ];
} }
w.apps[app].implies.map(function(implied) { w.apps[app].implies.forEach(function(implied) {
implied = parse(implied)[0]; implied = parse(implied)[0];
if ( !w.apps[implied.string] ) { if ( !w.apps[implied.string] ) {