Before Width: | Height: | Size: 596 B After Width: | Height: | Size: 832 B |
After Width: | Height: | Size: 179 B |
After Width: | Height: | Size: 794 B |
After Width: | Height: | Size: 549 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 850 B |
After Width: | Height: | Size: 669 B |
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 596 B After Width: | Height: | Size: 832 B |
After Width: | Height: | Size: 179 B |
After Width: | Height: | Size: 794 B |
After Width: | Height: | Size: 549 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 850 B |
After Width: | Height: | Size: 669 B |
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 596 B After Width: | Height: | Size: 832 B |
After Width: | Height: | Size: 179 B |
After Width: | Height: | Size: 794 B |
After Width: | Height: | Size: 549 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 850 B |
After Width: | Height: | Size: 669 B |
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 260 B |
@ -1,72 +1,72 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var
|
var
|
||||||
data = {},
|
data = {},
|
||||||
lastEnv = [],
|
lastEnv = [],
|
||||||
prefs = sendSyncMessage('wappalyzer', { action: 'get prefs' })[0]
|
prefs = sendSyncMessage('wappalyzer', { action: 'get prefs' })[0]
|
||||||
;
|
;
|
||||||
|
|
||||||
addEventListener('DOMContentLoaded', function() {
|
addEventListener('DOMContentLoaded', function() {
|
||||||
removeEventListener('DOMContentLoaded', onLoad, false);
|
removeEventListener('DOMContentLoaded', onLoad, false);
|
||||||
|
|
||||||
onLoad();
|
onLoad();
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
function onLoad() {
|
function onLoad() {
|
||||||
if ( content.document.contentType != 'text/html' ) {
|
if ( content.document.contentType != 'text/html' ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( prefs.analyzeJavaScript && prefs.analyzeOnLoad ) {
|
if ( prefs.analyzeJavaScript && prefs.analyzeOnLoad ) {
|
||||||
content.document.documentElement.addEventListener('load', function() {
|
content.document.documentElement.addEventListener('load', function() {
|
||||||
var env = Object.keys(content.wrappedJSObject).slice(0, 500);
|
var env = Object.keys(content.wrappedJSObject).slice(0, 500);
|
||||||
|
|
||||||
lastEnv = env;
|
lastEnv = env;
|
||||||
|
|
||||||
// Only analyze new variables
|
// Only analyze new variables
|
||||||
env = { env: env.filter(function(i) { return lastEnv.indexOf(i) === -1; }) };
|
env = { env: env.filter(function(i) { return lastEnv.indexOf(i) === -1; }) };
|
||||||
|
|
||||||
if ( env.length ) {
|
if ( env.length ) {
|
||||||
sendAsyncMessage('wappalyzer', {
|
sendAsyncMessage('wappalyzer', {
|
||||||
action: 'analyze',
|
action: 'analyze',
|
||||||
analyze: { env: env }
|
analyze: { env: env }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
env = null;
|
env = null;
|
||||||
|
|
||||||
removeEventListener('load', onLoad, true);
|
removeEventListener('load', onLoad, true);
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTML
|
// HTML
|
||||||
var html = content.document.documentElement.outerHTML;
|
var html = content.document.documentElement.outerHTML;
|
||||||
|
|
||||||
// Comments outside HTML
|
// Comments outside HTML
|
||||||
//if ( content.document.lastChild.nodeType === 8 ) {
|
//if ( content.document.lastChild.nodeType === 8 ) {
|
||||||
//content.alert(content.document.lastChild.nodeValue);
|
//content.alert(content.document.lastChild.nodeValue);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if ( html.length > 50000 ) {
|
if ( html.length > 50000 ) {
|
||||||
html = html.substring(0, 25000) + html.substring(html.length - 25000, html.length);
|
html = html.substring(0, 25000) + html.substring(html.length - 25000, html.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
data = { html: html };
|
data = { html: html };
|
||||||
|
|
||||||
if ( prefs.analyzeJavaScript ) {
|
if ( prefs.analyzeJavaScript ) {
|
||||||
data.env = Object.keys(content.wrappedJSObject).slice(0, 500);
|
data.env = Object.keys(content.wrappedJSObject).slice(0, 500);
|
||||||
|
|
||||||
lastEnv = data.env;
|
lastEnv = data.env;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendAsyncMessage('wappalyzer', {
|
sendAsyncMessage('wappalyzer', {
|
||||||
action: 'analyze',
|
action: 'analyze',
|
||||||
hostname: content.location.hostname,
|
hostname: content.location.hostname,
|
||||||
url: content.location.href,
|
url: content.location.href,
|
||||||
analyze: data
|
analyze: data
|
||||||
});
|
});
|
||||||
|
|
||||||
data = null;
|
data = null;
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
Before Width: | Height: | Size: 596 B After Width: | Height: | Size: 832 B |
After Width: | Height: | Size: 179 B |
After Width: | Height: | Size: 794 B |
After Width: | Height: | Size: 549 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 850 B |
After Width: | Height: | Size: 669 B |
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 260 B |
Before Width: | Height: | Size: 596 B After Width: | Height: | Size: 832 B |
After Width: | Height: | Size: 179 B |
After Width: | Height: | Size: 794 B |
After Width: | Height: | Size: 549 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 850 B |
After Width: | Height: | Size: 669 B |
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 260 B |
@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
|
require 'net/http'
|
||||||
|
require 'v8'
|
||||||
|
require 'json'
|
||||||
|
|
||||||
|
class Wappalyzer
|
||||||
|
def initialize
|
||||||
|
@realdir = File.dirname(File.realpath(__FILE__))
|
||||||
|
file = File.join(@realdir, '..', '..', 'share', 'apps.json')
|
||||||
|
@json = JSON.parse(IO.read(file))
|
||||||
|
@categories, @apps = @json['categories'], @json['apps']
|
||||||
|
end
|
||||||
|
|
||||||
|
def analyze(url)
|
||||||
|
uri, body, headers = URI(url), nil, {}
|
||||||
|
Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https', :open_timeout => 5) do |http|
|
||||||
|
resp = http.get(uri.request_uri)
|
||||||
|
resp.canonical_each{|k,v| headers[k] = v}
|
||||||
|
body = resp.body.encode('UTF-8', :invalid => :replace, :undef => :replace)
|
||||||
|
end
|
||||||
|
|
||||||
|
cxt = V8::Context.new
|
||||||
|
cxt.load File.join(@realdir, '..', 'php', 'js', 'wappalyzer.js')
|
||||||
|
cxt.load File.join(@realdir, '..', 'php', 'js', 'driver.js')
|
||||||
|
data = {'host' => uri.hostname, 'url' => url, 'html' => body, 'headers' => headers}
|
||||||
|
output = cxt.eval("w.apps = #{@apps.to_json}; w.categories = #{@categories.to_json}; w.driver.data = #{data.to_json}; w.driver.init();")
|
||||||
|
JSON.load(output)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if $0 == __FILE__
|
||||||
|
url = ARGV[0]
|
||||||
|
if url
|
||||||
|
puts JSON.pretty_generate(Wappalyzer.new.analyze(ARGV[0]))
|
||||||
|
else
|
||||||
|
puts "Usage: #{__FILE__} http://example.com"
|
||||||
|
end
|
||||||
|
end
|
After Width: | Height: | Size: 179 B |
After Width: | Height: | Size: 794 B |
After Width: | Height: | Size: 549 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 850 B |
After Width: | Height: | Size: 669 B |