@ -1,19 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
cd "$(dirname $0)"
|
|
||||||
|
|
||||||
if [[ -z "$(which docker)" ]]; then
|
|
||||||
echo "Please install Docker from https://www.docker.com"
|
|
||||||
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cmd="docker run --rm -v "$(pwd):/opt/wappalyzer" -it wappalyzer/dev"
|
|
||||||
|
|
||||||
$cmd sh -c "\
|
|
||||||
yarn install; \
|
|
||||||
cd ../npm; \
|
|
||||||
yarn install"
|
|
||||||
|
|
||||||
$cmd ./bin/run links
|
|
||||||
$cmd ./bin/run $@
|
|
@ -1,169 +0,0 @@
|
|||||||
/* eslint-env browser */
|
|
||||||
/* globals wappalyzer */
|
|
||||||
|
|
||||||
;(function() {
|
|
||||||
wappalyzer.driver.document = document
|
|
||||||
|
|
||||||
const container = document.getElementById('wappalyzer-container')
|
|
||||||
const url = wappalyzer.parseUrl(window.top.location.href)
|
|
||||||
const hasOwn = Object.prototype.hasOwnProperty
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Log messages to console
|
|
||||||
*/
|
|
||||||
wappalyzer.driver.log = (message, source, type) => {
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(`[wappalyzer ${type}]`, `[${source}]`, message)
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPageContent() {
|
|
||||||
wappalyzer.log('func: getPageContent', 'driver')
|
|
||||||
|
|
||||||
const scripts = Array.prototype.slice
|
|
||||||
.apply(document.scripts)
|
|
||||||
.filter((s) => s.src)
|
|
||||||
.map((s) => s.src)
|
|
||||||
|
|
||||||
let html = new window.XMLSerializer()
|
|
||||||
.serializeToString(document)
|
|
||||||
.split('\n')
|
|
||||||
|
|
||||||
html = html
|
|
||||||
.slice(0, 1000)
|
|
||||||
.concat(html.slice(html.length - 1000))
|
|
||||||
.map((line) => line.substring(0, 1000))
|
|
||||||
.join('\n')
|
|
||||||
|
|
||||||
wappalyzer.analyze(url, {
|
|
||||||
html,
|
|
||||||
scripts
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function getResponseHeaders() {
|
|
||||||
wappalyzer.log('func: getResponseHeaders', 'driver')
|
|
||||||
|
|
||||||
const xhr = new XMLHttpRequest()
|
|
||||||
|
|
||||||
xhr.open('GET', url, true)
|
|
||||||
|
|
||||||
xhr.onreadystatechange = () => {
|
|
||||||
if (xhr.readyState === 4 && xhr.status) {
|
|
||||||
const headers = xhr.getAllResponseHeaders().split('\n')
|
|
||||||
|
|
||||||
if (headers.length > 0 && headers[0] !== '') {
|
|
||||||
wappalyzer.log(
|
|
||||||
`responseHeaders: ${xhr.getAllResponseHeaders()}`,
|
|
||||||
'driver'
|
|
||||||
)
|
|
||||||
|
|
||||||
const responseHeaders = {}
|
|
||||||
|
|
||||||
headers.forEach((line) => {
|
|
||||||
let name, value
|
|
||||||
|
|
||||||
if (line) {
|
|
||||||
name = line.substring(0, line.indexOf(': '))
|
|
||||||
value = line.substring(line.indexOf(': ') + 2, line.length - 1)
|
|
||||||
|
|
||||||
if (!responseHeaders[name.toLowerCase()]) {
|
|
||||||
responseHeaders[name.toLowerCase()] = []
|
|
||||||
}
|
|
||||||
responseHeaders[name.toLowerCase()].push(value)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
wappalyzer.analyze(url, {
|
|
||||||
headers: responseHeaders
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
xhr.send()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Display apps
|
|
||||||
*/
|
|
||||||
wappalyzer.driver.displayApps = (detected) => {
|
|
||||||
wappalyzer.log('func: displayApps', 'driver')
|
|
||||||
|
|
||||||
let first = true
|
|
||||||
let app
|
|
||||||
let category
|
|
||||||
let html
|
|
||||||
|
|
||||||
html =
|
|
||||||
'<a id="wappalyzer-close" href="javascript: document.body.removeChild(document.getElementById(\'wappalyzer-container\')); void(0);">' +
|
|
||||||
'Close' +
|
|
||||||
'</a>' +
|
|
||||||
'<div id="wappalyzer-apps">'
|
|
||||||
|
|
||||||
if (detected != null && Object.keys(detected).length) {
|
|
||||||
for (app in detected) {
|
|
||||||
if (!hasOwn.call(detected, app)) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
const version = detected[app].version
|
|
||||||
const confidence = detected[app].confidence
|
|
||||||
|
|
||||||
html +=
|
|
||||||
`<div class="wappalyzer-app${first ? ' wappalyzer-first' : ''}">` +
|
|
||||||
`<a target="_blank" class="wappalyzer-application" href="${
|
|
||||||
wappalyzer.config.websiteURL
|
|
||||||
}applications/${app
|
|
||||||
.toLowerCase()
|
|
||||||
.replace(/ /g, '-')
|
|
||||||
.replace(/[^a-z0-9-]/g, '')}">` +
|
|
||||||
'<strong>' +
|
|
||||||
`<img src="${wappalyzer.config.websiteURL}images/icons/${wappalyzer
|
|
||||||
.apps[app].icon ||
|
|
||||||
'default.svg'}" width="16" height="16"/> ${app}</strong>${
|
|
||||||
version ? ` ${version}` : ''
|
|
||||||
}${confidence < 100 ? ` (${confidence}% sure)` : ''}</a>`
|
|
||||||
|
|
||||||
for (const i in wappalyzer.apps[app].cats) {
|
|
||||||
if (!hasOwn.call(wappalyzer.apps[app].cats, i)) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
category = wappalyzer.categories[wappalyzer.apps[app].cats[i]].name
|
|
||||||
|
|
||||||
html += `<a target="_blank" class="wappalyzer-category" href="${
|
|
||||||
wappalyzer.config.websiteURL
|
|
||||||
}categories/${slugify(category)}">${category}</a>`
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '</div>'
|
|
||||||
|
|
||||||
first = false
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
html += '<div id="wappalyzer-empty">No applications detected</div>'
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '</div>'
|
|
||||||
|
|
||||||
container.innerHTML = html
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Open a tab
|
|
||||||
*/
|
|
||||||
// function openTab(args) {
|
|
||||||
// open(args.url)
|
|
||||||
// }
|
|
||||||
|
|
||||||
function slugify(string) {
|
|
||||||
return string
|
|
||||||
.toLowerCase()
|
|
||||||
.replace(/[^a-z0-9-]/g, '-')
|
|
||||||
.replace(/--+/g, '-')
|
|
||||||
.replace(/(?:^-|-$)/, '')
|
|
||||||
}
|
|
||||||
|
|
||||||
getPageContent()
|
|
||||||
getResponseHeaders()
|
|
||||||
})()
|
|
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 755 B |
After Width: | Height: | Size: 558 B |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 722 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 582 B |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 680 B |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 943 B |
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 602 B After Width: | Height: | Size: 440 B |
Before Width: | Height: | Size: 660 B After Width: | Height: | Size: 899 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 393 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 544 B |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 688 B |
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 594 B |
After Width: | Height: | Size: 615 B |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 647 B |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 722 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 995 B |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 1008 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 399 B |
After Width: | Height: | Size: 261 B |
After Width: | Height: | Size: 1.0 KiB |