diff --git a/creep.js b/creep.js index 0d8d6cb9..96a5339b 100644 --- a/creep.js +++ b/creep.js @@ -244,6 +244,20 @@ return trusted ? val : sendToTrash(name, val) } + // ip address + const getIP = async () => { + const promiseUndefined = new Promise(resolve => resolve(undefined)) + const api = 'https://api6.ipify.org/?format=json' + try { + const res = await fetch(api) + return res.json() + } + catch (error) { + captureError(error) + return promiseUndefined + } + } + // navigator const nav = () => { const navigatorPrototype = attempt(() => Navigator.prototype) @@ -1271,12 +1285,14 @@ // await const asyncValues = timer('') const [ + ipAddress, voices, mediaDevices, highEntropy, offlineAudio, fonts ] = await Promise.all([ + getIP(), getVoices(), getMediaDevices(), highEntropyValues(), @@ -1287,6 +1303,7 @@ }) asyncValues('Async computation complete') + const ipAddressComputed = !ipAddress ? undefined : ipAddress.ip const voicesComputed = !voices ? undefined : voices.map(({ name, lang }) => ({ name, lang })) const mediaDevicesComputed = !mediaDevices ? undefined : mediaDevices.map(({ kind }) => ({ kind })) // chrome randomizes groupId @@ -1361,6 +1378,7 @@ } const fingerprint = { + ipAddress: [ipAddressComputed], nav: [navComputed, navHash], highEntropy: [highEntropy, highEntropyHash], window: [windowVersionComputed, windowVersionHash], @@ -1455,7 +1473,7 @@
First Visit: ${toLocaleStr(firstVisit)}
Latest Visit: ${toLocaleStr(latestVisit)}
${subIdsLen ? `
${subIdsLen} Loose fingerprint${plural}
` : ''} -
Visits: ${visits}${subIdsLen > 3 ? ` (Bot)`: ''}
+
Visits: ${visits}${subIdsLen > 20 ? ` (Bot)`: ''}
` fetchVisitoDataTimer('Visitor data received') @@ -1510,6 +1528,20 @@ const data = `
+ + ${ + !fp.ipAddress[0] ? '': (() => { + const plural = pluralify(trashBin.length) + const [ ip ] = fp.ipAddress + return ` +
+ IP address +
${ip}
+
+ ` + })() + } +
Fingerprint
Trusted Id: ${creepHash}