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",
"website": "www.iis.net"
},
"INFOnline": {
"cats": [
10
],
"env": [
"^szmvars$",
"^iam_data$"
],
"script": "^https?://(?:[^/]+\\.)?i(?:oam|v)wbox\\.de/",
"website": "infonline.de"
},
"IPB": {
"cats": [
2
@ -2547,17 +2558,6 @@
},
"website": "impresspages.org"
},
"INFOnline": {
"cats": [
10
],
"env": [
"^szmvars$",
"^iam_data$"
],
"script": "^https?://(?:[^/]+\\.)?i(?:oam|v)wbox\\.de/",
"website": "infonline.de"
},
"InProces": {
"cats": [
1
@ -7238,4 +7238,4 @@
"49": "feed-readers",
"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;
}
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) {
headers[header.name.toLowerCase()] = header.value;
});
@ -116,36 +116,36 @@
page.open(url, function(status) {
var html, environmentVars;
if ( status === 'fail' ) {
return;
}
wappalyzer.log('page.open: ' + status);
html = page.content;
if ( status === 'success' ) {
html = page.content;
if ( html.length > 50000 ) {
html = html.substring(0, 25000) + html.substring(html.length - 25000, html.length);
}
if ( html.length > 50000 ) {
html = html.substring(0, 25000) + html.substring(html.length - 25000, html.length);
}
// Collect environment variables
environmentVars = page.evaluate(function() {
var i, environmentVars;
// Collect environment variables
environmentVars = page.evaluate(function() {
var i, environmentVars;
for ( i in window ) {
environmentVars += i + ' ';
}
for ( i in window ) {
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, {
html: html,
headers: headers,
env: environmentVars
});
wappalyzer.analyze(hostname, url, {
html: html,
headers: headers,
env: environmentVars
});
}
phantom.exit();
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Loading…
Cancel
Save