Added Dockerfile to PhantomJS driver, exit PhantomJS on error

main
Elbert Alias 10 years ago
parent d2e798b3ca
commit ea4d887a12

@ -2513,6 +2513,17 @@
"implies": "Windows Server", "implies": "Windows Server",
"website": "www.iis.net" "website": "www.iis.net"
}, },
"INFOnline": {
"cats": [
10
],
"env": [
"^szmvars$",
"^iam_data$"
],
"script": "^https?://(?:[^/]+\\.)?i(?:oam|v)wbox\\.de/",
"website": "infonline.de"
},
"IPB": { "IPB": {
"cats": [ "cats": [
2 2
@ -2547,17 +2558,6 @@
}, },
"website": "impresspages.org" "website": "impresspages.org"
}, },
"INFOnline": {
"cats": [
10
],
"env": [
"^szmvars$",
"^iam_data$"
],
"script": "^https?://(?:[^/]+\\.)?i(?:oam|v)wbox\\.de/",
"website": "infonline.de"
},
"InProces": { "InProces": {
"cats": [ "cats": [
1 1
@ -7238,4 +7238,4 @@
"49": "feed-readers", "49": "feed-readers",
"50": "document-management-systems" "50": "document-management-systems"
} }
} }

@ -0,0 +1,29 @@
FROM phusion/baseimage
MAINTAINER Elbert Alias <elbert@alias.io>
ENV DEBIAN_FRONTEND noninteractive
RUN \
apt-get update && apt-get install -y \
libfreetype6 \
libfontconfig \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
WORKDIR /usr/local
# PhantomJS
RUN \
mkdir phantomjs && \
curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 | tar xvjC phantomjs --strip 1
# Wappalyzer
RUN \
mkdir wappalyzer && \
curl -sSL https://github.com/AliasIO/Wappalyzer/archive/master.tar.gz | tar xzC wappalyzer --strip 1
RUN wappalyzer/bin/wappalyzer-links wappalyzer
WORKDIR wappalyzer/src/drivers/phantomjs
ENTRYPOINT ["/usr/local/phantomjs/bin/phantomjs", "--load-images=false", "--ignore-ssl-errors=yes", "driver.js"]

@ -105,7 +105,7 @@
return; return;
} }
if ( response.stage === 'end' && response.contentType.indexOf('text/html') !== -1 ) { if ( response.stage === 'end' && response.status === 200 && response.contentType.indexOf('text/html') !== -1 ) {
response.headers.forEach(function(header) { response.headers.forEach(function(header) {
headers[header.name.toLowerCase()] = header.value; headers[header.name.toLowerCase()] = header.value;
}); });
@ -116,36 +116,36 @@
page.open(url, function(status) { page.open(url, function(status) {
var html, environmentVars; var html, environmentVars;
if ( status === 'fail' ) { wappalyzer.log('page.open: ' + status);
return;
}
html = page.content; if ( status === 'success' ) {
html = page.content;
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);
} }
// Collect environment variables // Collect environment variables
environmentVars = page.evaluate(function() { environmentVars = page.evaluate(function() {
var i, environmentVars; var i, environmentVars;
for ( i in window ) { for ( i in window ) {
environmentVars += i + ' '; environmentVars += i + ' ';
} }
return environmentVars; return environmentVars;
}); });
wappalyzer.log({ message: 'environmentVars: ' + environmentVars }); wappalyzer.log({ message: 'environmentVars: ' + environmentVars });
environmentVars = environmentVars.split(' ').slice(0, 500); environmentVars = environmentVars.split(' ').slice(0, 500);
wappalyzer.analyze(hostname, url, { wappalyzer.analyze(hostname, url, {
html: html, html: html,
headers: headers, headers: headers,
env: environmentVars env: environmentVars
}); });
}
phantom.exit(); phantom.exit();
}); });

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB