added wappalyzer npm module

main
Pasindu De Silva 10 years ago
parent 0e9dd927b9
commit 358fbcf9bb

2
.gitignore vendored

@ -9,3 +9,5 @@ drivers/**/icons/*.png
!.gitkeep !.gitkeep
node_modules/* node_modules/*
drivers/npm/node_modules/

@ -0,0 +1 @@
node_modules/

@ -0,0 +1,96 @@
# Wappalyzer
This is npm module for wappalyzer
npm install wappalyzer
var wappalyzer = require("wappalyzer");
var options={
url : "http://codelanka.github.io/Presentation-Engines",
hostname:"codelanka.github.io",
debug:false
}
wappalyzer.detectFromUrl(options,function (err,apps,appInfo) {
console.log(err,apps,appInfo);
})
####Output
null [ 'AngularJS',
'Font Awesome',
'Google Font API',
'jQuery',
'Twitter Bootstrap' ] { AngularJS:
{ app: 'AngularJS',
confidence:
{ 'script //([\\d.]+(\\-?rc[.\\d]*)*)/angular(\\.min)?\\.js/i': 100,
'script /angular.*\\.js/i': 100 },
confidenceTotal: 100,
detected: true,
excludes: [],
version: '1.3.5',
versions: [ '1.3.5' ] },
'Font Awesome':
{ app: 'Font Awesome',
confidence: { 'html /<link[^>]* href=[^>]+font-awesome(?:\\.min)?\\.css/i': 100 },
confidenceTotal: 100,
detected: true,
excludes: [],
version: '',
versions: [] },
'Google Font API':
{ app: 'Google Font API',
confidence: { 'html /<link[^>]* href=[^>]+fonts\\.(?:googleapis|google)\\.com/i': 100 },
confidenceTotal: 100,
detected: true,
excludes: [],
version: '',
versions: [] },
jQuery:
{ app: 'jQuery',
confidence: { 'script /jquery.*\\.js/i': 100 },
confidenceTotal: 100,
detected: true,
excludes: [],
version: '',
versions: [] },
'Twitter Bootstrap':
{ app: 'Twitter Bootstrap',
confidence:
{ 'script /(?:twitter\\.github\\.com/bootstrap|bootstrap(?:\\.js|\\.min\\.js))/i': 100,
'html /<link.+?href="[^"]+bootstrap(?:\\.min)?\\.css/i': 100 },
confidenceTotal: 100,
detected: true,
excludes: [],
version: '',
versions: [] } }
Wappalyzer Author - Elbert Alias
[Wappalyzer](https://wappalyzer.com/) is a
[cross-platform](https://github.com/ElbertF/Wappalyzer/wiki/Drivers) utility that uncovers the
technologies used on websites. It detects
[content management systems](https://wappalyzer.com/categories/cms),
[eCommerce platforms](https://wappalyzer.com/categories/ecommerce),
[web servers](https://wappalyzer.com/categories/web-servers),
[JavaScript frameworks](https://wappalyzer.com/categories/javascript-frameworks),
[analytics tools](https://wappalyzer.com/categories/analytics) and
[many more](https://wappalyzer.com/applications).
Refer to the [wiki](https://github.com/ElbertF/Wappalyzer/wiki) for
[screenshots](https://github.com/ElbertF/Wappalyzer/wiki/Screenshots), information on how to
[contribute](https://github.com/ElbertF/Wappalyzer/wiki/Contributing) and
[more](https://github.com/ElbertF/Wappalyzer/wiki/_pages).
*Licensed under the [GPL](https://github.com/ElbertF/Wappalyzer/blob/master/LICENSE).*
Donate Bitcoin: 16gb4uGDAjaeRJwKVmKr2EXa8x2fmvT8EQ - *Thanks!*
![QR Code](https://wappalyzer.com/sites/default/themes/wappalyzer/images/bitcoinqrcode.png)

@ -0,0 +1,11 @@
var wappalyzer = require("./index");
var options={
url : "http://codelanka.github.io/Presentation-Engines",
hostname:"codelanka.github.io",
debug:false
}
wappalyzer.detectFromUrl(options,function (err,apps,appInfo) {
console.log(err,apps,appInfo);
})

@ -0,0 +1,83 @@
var request = require('request');
var fs = require("fs");
var path =require("path");
//TODO
exports.detectFromHTML = function (options) {};
exports.detectFromUrl = function (options,cb) {
var url = options.url;
if (options.debug ) {
console.log("Fetching the page");
};
getHTMLFromUrl(url,function (err,data) {
if (err) {
cb(err,null)
}else{
runWrappalyer(options,data, function (err,detected,appInfo) {
cb(null,detected,appInfo)
});
}
})
}
function getHTMLFromUrl (url,cb) {
request(url, function(error, response, body) {
if (!error && response.statusCode == 200) {
var data = {
html: body,
url: url,
headers: response
};
cb(null,data);
}else{
cb(error,null)
}
});
}
function getAppsJson(cb) {
fs.readFile(path.resolve(__dirname, 'apps.json'), 'utf8', function(err, data) {
if (err) throw err;
return cb(null, JSON.parse(data))
});
}
function runWrappalyer(options,data,cb) {
var debug = options.debug || false;
var wappalyzer = require("./wappalyzer").wappalyzer;
getAppsJson(function(err, apps) {
var w = wappalyzer;
w.driver = {
log: function(args) {
if (debug) {
console.log(args.message);
};
},
init: function() {
w.categories = apps.categories;
w.apps = apps.apps;
},
displayApps: function() {
var app,url = Object.keys(w.detected)[0];
var detectedApps = [];
for (app in w.detected[url]) {
detectedApps.push(app);
if (debug) {
console.log(app);
};
};
cb(null,detectedApps,w.detected[url])
}
}
w.init();
w.analyze(options.hostname,options.url, data)
});
}

@ -0,0 +1,28 @@
{
"name": "wrappalyzer",
"version": "2.0.0",
"description": "NPM Module that uncovers the technologies used on websites",
"main": "index.js",
"scripts": {
"test": "mocha -t 15000"
},
"repository": {
"type": "git",
"url": "https://github.com/ElbertF/Wappalyze"
},
"keywords": [
"wappalyzer"
],
"author": "Pasindu De Silva",
"license": "GPLv3",
"bugs": {
"url": "https://github.com/ElbertF/Wappalyze/issues"
},
"homepage": "https://github.com/ElbertF/Wappalyze",
"directories": {
"test": "test"
},
"dependencies": {
"request": "^2.51.0"
}
}

@ -0,0 +1,27 @@
var assert = require("assert")
describe('wappalyzer', function(){
describe('detectFromUrl', function(){
it('should have the expected apps detected', function(done){
var wappalyzer = require("../index");
var expect = ['AngularJS','Font Awesome','Google Font API','jQuery','Twitter Bootstrap'];
var options={
url : "http://codelanka.github.io/Presentation-Engines",
hostname:"codelanka.github.io",
debug:false
}
wappalyzer.detectFromUrl(options,function (err,apps) {
assert.equal(expect[0], apps[0]);
assert.equal(expect[1], apps[1]);
assert.equal(expect[2], apps[2]);
assert.equal(expect[3], apps[3]);
done();
})
})
})
})

@ -109,3 +109,10 @@ mklink /h drivers\phantomjs\apps.json share\apps.json
if exist drivers\phantomjs\js\wappalyzer.js del drivers\phantomjs\js\wappalyzer.js if exist drivers\phantomjs\js\wappalyzer.js del drivers\phantomjs\js\wappalyzer.js
mklink /h drivers\phantomjs\js\wappalyzer.js share\js\wappalyzer.js mklink /h drivers\phantomjs\js\wappalyzer.js share\js\wappalyzer.js
:: NPM Module
if exist drivers\npm\apps.json del drivers\npm\apps.json
mklink /h drivers\npm\apps.json share\apps.json
if exist drivers\npm\wappalyzer.js del drivers\npm\wappalyzer.npm
mklink /h drivers\npm\wappalyzer.js share\wappalyzer.js

@ -26,3 +26,7 @@ ln -f share/apps.json drivers/python_raw
ln -f share/apps.json drivers/phantomjs ln -f share/apps.json drivers/phantomjs
ln -f share/js/wappalyzer.js drivers/phantomjs/js ln -f share/js/wappalyzer.js drivers/phantomjs/js
ln -f share/apps.json drivers/npm
ln -f share/js/wappalyzer.js drivers/npm