From 83bce62ef444af2cc4862794dfa9e73453bfa95a Mon Sep 17 00:00:00 2001 From: Elbert Alias <77259+AliasIO@users.noreply.github.com> Date: Sun, 14 Jun 2020 09:04:29 +1000 Subject: [PATCH] Fix JavaScript detection --- .travis.yml | 2 +- src/drivers/webextension/js/inject.js | 4 ++++ src/wappalyzer.js | 8 +++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 139acd339..dffda7867 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ after_success: script: - >- - version=$(grep '"version":' src/drivers/webextension/manifest.json | sed 's/^.*"version": "\(.*\)".*$/\1/') && + version=$(grep '"version":' src/package.json | sed 's/^.*"version": "\(.*\)".*$/\1/') && echo Version is $version && yarn run build $version && docker build -t wappalyzer/cli:latest -t wappalyzer/cli:$version src/drivers/npm diff --git a/src/drivers/webextension/js/inject.js b/src/drivers/webextension/js/inject.js index 8ae4bd77e..db3c78c37 100644 --- a/src/drivers/webextension/js/inject.js +++ b/src/drivers/webextension/js/inject.js @@ -25,6 +25,10 @@ window ) + if (name === 'Intercom') { + console.log(name, chains, value) + } + if (value !== undefined) { technologies.push({ name, diff --git a/src/wappalyzer.js b/src/wappalyzer.js index 55b61454c..61191e7fb 100644 --- a/src/wappalyzer.js +++ b/src/wappalyzer.js @@ -236,7 +236,7 @@ const Wappalyzer = { html: transform(html), meta: transform(meta), scripts: transform(script), - js: transform(js), + js: transform(js, true), implies: transform(implies).map(({ value, confidence }) => ({ name: value, confidence @@ -276,7 +276,7 @@ const Wappalyzer = { * Extract information from regex pattern. * @param {string|array} patterns */ - transformPatterns(patterns) { + transformPatterns(patterns, caseSensitive = false) { if (!patterns) { return [] } @@ -288,7 +288,9 @@ const Wappalyzer = { } const parsed = Object.keys(patterns).reduce((parsed, key) => { - parsed[key.toLowerCase()] = toArray(patterns[key]).map((pattern) => { + parsed[caseSensitive ? key : key.toLowerCase()] = toArray( + patterns[key] + ).map((pattern) => { const { value, regex, confidence, version } = pattern .split('\\;') .reduce((attrs, attr, i) => {