|
|
@ -10,10 +10,6 @@ const Wappalyzer = require('./wappalyzer')
|
|
|
|
const { setTechnologies, setCategories, analyze, analyzeManyToMany, resolve } =
|
|
|
|
const { setTechnologies, setCategories, analyze, analyzeManyToMany, resolve } =
|
|
|
|
Wappalyzer
|
|
|
|
Wappalyzer
|
|
|
|
|
|
|
|
|
|
|
|
function next() {
|
|
|
|
|
|
|
|
return new Promise((resolve) => setImmediate(resolve))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { CHROMIUM_BIN, CHROMIUM_DATA_DIR, CHROMIUM_WEBSOCKET } = process.env
|
|
|
|
const { CHROMIUM_BIN, CHROMIUM_DATA_DIR, CHROMIUM_WEBSOCKET } = process.env
|
|
|
|
|
|
|
|
|
|
|
|
const chromiumArgs = [
|
|
|
|
const chromiumArgs = [
|
|
|
@ -98,21 +94,16 @@ function getJs(page, technologies = Wappalyzer.technologies) {
|
|
|
|
}, technologies)
|
|
|
|
}, technologies)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function analyzeJs(js, technologies = Wappalyzer.technologies) {
|
|
|
|
function analyzeJs(js, technologies = Wappalyzer.technologies) {
|
|
|
|
return Array.prototype.concat.apply(
|
|
|
|
return js
|
|
|
|
[],
|
|
|
|
.map(({ name, chain, value }) => {
|
|
|
|
await Promise.all(
|
|
|
|
return analyzeManyToMany(
|
|
|
|
js.map(async ({ name, chain, value }) => {
|
|
|
|
technologies.find(({ name: _name }) => name === _name),
|
|
|
|
await next()
|
|
|
|
'js',
|
|
|
|
|
|
|
|
{ [chain]: [value] }
|
|
|
|
return analyzeManyToMany(
|
|
|
|
)
|
|
|
|
technologies.find(({ name: _name }) => name === _name),
|
|
|
|
})
|
|
|
|
'js',
|
|
|
|
.flat()
|
|
|
|
{ [chain]: [value] }
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getDom(page, technologies = Wappalyzer.technologies) {
|
|
|
|
function getDom(page, technologies = Wappalyzer.technologies) {
|
|
|
@ -200,59 +191,36 @@ function getDom(page, technologies = Wappalyzer.technologies) {
|
|
|
|
}, technologies)
|
|
|
|
}, technologies)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function analyzeDom(dom, technologies = Wappalyzer.technologies) {
|
|
|
|
function analyzeDom(dom, technologies = Wappalyzer.technologies) {
|
|
|
|
return Array.prototype.concat.apply(
|
|
|
|
return dom
|
|
|
|
[],
|
|
|
|
.map(({ name, selector, exists, text, property, attribute, value }) => {
|
|
|
|
await Promise.all(
|
|
|
|
const technology = technologies.find(({ name: _name }) => name === _name)
|
|
|
|
dom.map(
|
|
|
|
|
|
|
|
async ({
|
|
|
|
|
|
|
|
name,
|
|
|
|
|
|
|
|
selector,
|
|
|
|
|
|
|
|
exists,
|
|
|
|
|
|
|
|
text,
|
|
|
|
|
|
|
|
property,
|
|
|
|
|
|
|
|
attribute,
|
|
|
|
|
|
|
|
value,
|
|
|
|
|
|
|
|
}) => {
|
|
|
|
|
|
|
|
await next()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const technology = technologies.find(
|
|
|
|
|
|
|
|
({ name: _name }) => name === _name
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (typeof exists !== 'undefined') {
|
|
|
|
if (typeof exists !== 'undefined') {
|
|
|
|
return analyzeManyToMany(technology, 'dom.exists', {
|
|
|
|
return analyzeManyToMany(technology, 'dom.exists', {
|
|
|
|
[selector]: [''],
|
|
|
|
[selector]: [''],
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (typeof text !== 'undefined') {
|
|
|
|
|
|
|
|
return analyzeManyToMany(technology, 'dom.text', {
|
|
|
|
|
|
|
|
[selector]: [text],
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (typeof property !== 'undefined') {
|
|
|
|
if (typeof text !== 'undefined') {
|
|
|
|
return analyzeManyToMany(technology, `dom.properties.${property}`, {
|
|
|
|
return analyzeManyToMany(technology, 'dom.text', {
|
|
|
|
[selector]: [value],
|
|
|
|
[selector]: [text],
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (typeof attribute !== 'undefined') {
|
|
|
|
if (typeof property !== 'undefined') {
|
|
|
|
return analyzeManyToMany(
|
|
|
|
return analyzeManyToMany(technology, `dom.properties.${property}`, {
|
|
|
|
technology,
|
|
|
|
[selector]: [value],
|
|
|
|
`dom.attributes.${attribute}`,
|
|
|
|
})
|
|
|
|
{
|
|
|
|
}
|
|
|
|
[selector]: [value],
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return []
|
|
|
|
if (typeof attribute !== 'undefined') {
|
|
|
|
}
|
|
|
|
return analyzeManyToMany(technology, `dom.attributes.${attribute}`, {
|
|
|
|
)
|
|
|
|
[selector]: [value],
|
|
|
|
)
|
|
|
|
})
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.flat()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function get(url, options = {}) {
|
|
|
|
function get(url, options = {}) {
|
|
|
@ -860,22 +828,20 @@ class Site {
|
|
|
|
|
|
|
|
|
|
|
|
await this.onDetect(
|
|
|
|
await this.onDetect(
|
|
|
|
url,
|
|
|
|
url,
|
|
|
|
(
|
|
|
|
[
|
|
|
|
await Promise.all([
|
|
|
|
analyzeDom(dom),
|
|
|
|
analyzeDom(dom),
|
|
|
|
analyzeJs(js),
|
|
|
|
analyzeJs(js),
|
|
|
|
analyze({
|
|
|
|
analyze({
|
|
|
|
url,
|
|
|
|
url,
|
|
|
|
cookies,
|
|
|
|
cookies,
|
|
|
|
html,
|
|
|
|
html,
|
|
|
|
text,
|
|
|
|
text,
|
|
|
|
css,
|
|
|
|
css,
|
|
|
|
scripts,
|
|
|
|
scripts,
|
|
|
|
scriptSrc,
|
|
|
|
scriptSrc,
|
|
|
|
meta,
|
|
|
|
meta,
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
].flat()
|
|
|
|
])
|
|
|
|
|
|
|
|
).flat()
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const reducedLinks = Array.prototype.reduce.call(
|
|
|
|
const reducedLinks = Array.prototype.reduce.call(
|
|
|
@ -1189,25 +1155,23 @@ class Site {
|
|
|
|
|
|
|
|
|
|
|
|
await this.onDetect(
|
|
|
|
await this.onDetect(
|
|
|
|
url,
|
|
|
|
url,
|
|
|
|
(
|
|
|
|
[
|
|
|
|
await Promise.all([
|
|
|
|
analyzeDom(dom, technologies),
|
|
|
|
analyzeDom(dom, technologies),
|
|
|
|
analyzeJs(js, technologies),
|
|
|
|
analyzeJs(js, technologies),
|
|
|
|
await analyze(
|
|
|
|
analyze(
|
|
|
|
{
|
|
|
|
{
|
|
|
|
url,
|
|
|
|
url,
|
|
|
|
cookies,
|
|
|
|
cookies,
|
|
|
|
html,
|
|
|
|
html,
|
|
|
|
text,
|
|
|
|
text,
|
|
|
|
css,
|
|
|
|
css,
|
|
|
|
scripts,
|
|
|
|
scripts,
|
|
|
|
scriptSrc,
|
|
|
|
scriptSrc,
|
|
|
|
meta,
|
|
|
|
meta,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
technologies
|
|
|
|
technologies
|
|
|
|
),
|
|
|
|
),
|
|
|
|
].flat()
|
|
|
|
])
|
|
|
|
|
|
|
|
).flat()
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|