Git Product home page Git Product logo

fingerprintjs / fingerprintjs Goto Github PK

View Code? Open in Web Editor NEW
20.9K 418.0 2.2K 2.93 MB

Browser fingerprinting library. Accuracy of this version is 40-60%, accuracy of the commercial Fingerprint Identification is 99.5%. V4 of this library is BSL licensed.

Home Page: https://fingerprint.com/github/

License: Other

HTML 1.45% TypeScript 98.55%
javascript detection identification fingerprint fraud-detection fraud audio-fingerprinting browser fingerprinting browser-fingerprint

fingerprintjs's Introduction

FingerprintJS logo

Build status Current NPM version Monthly downloads from NPM Monthly downloads from jsDelivr

Discord server

FingerprintJS is a source-available, client-side, browser fingerprinting library that queries browser attributes and computes a hashed visitor identifier from them. Unlike cookies and local storage, a fingerprint stays the same in incognito/private mode and even when browser data is purged.

License

Starting version 4.0.0, FingerprintJS is licensed under Business Source License 1.1. The BSL allows use only for non-production purposes. You can learn more details in our announcement.

Use Case Is a commercial license required?
Exploring FingerprintJS for your own research, hobbies, and testing purposes No
Using FingerprintJS to build a proof-of-concept application No
Using FingerprintJS to build revenue-generating applications Yes
Using FingerprintJS to build software that is provided as a service (SaaS) Yes
Forking FingerprintJS for any production purposes Yes

To purchase a license for uses not authorized by BSL, please contact us at [email protected].

Demo

Visit https://fingerprintjs.github.io/fingerprintjs to know your visitor identifier.

Now, try visiting the same page in private / incognito mode and notice how the visitor identifier remains the same!

Getting Started

<script>
  // Initialize the agent at application startup.
  // If you're using an ad blocker or Brave/Firefox, this import will not work.
  // Please use the NPM package instead: https://t.ly/ORyXk
  const fpPromise = import('https://openfpcdn.io/fingerprintjs/v4')
    .then(FingerprintJS => FingerprintJS.load())

  // Get the visitor identifier when you need it.
  fpPromise
    .then(fp => fp.get())
    .then(result => {
      // This is the visitor identifier:
      const visitorId = result.visitorId
      console.log(visitorId)
    })
</script>

Run this code

Resources

📕 API Reference

⚛️ Sample usage with React on the StackBlitz platform

Limitations

Accuracy

Since FingerprintJS processes and generates the fingerprints from within the browser itself, the accuracy is limited (40% - 60%). For example, when 2 different users send requests using identical (i.e. same version, same vendor, same platform), browsers, FingerprintJS will not be able to tell these two browsers apart, primarily because the attribitutes from these browsers will be identical.

Security

Because of how the fingerprints are processed and generated from within the browser itself, they are vulnerable to spoofing and reverse engineering.

Get 99.5% accuracy

Fingerprint Identification is a closed-source, commercial device identification product designed for fraud detection, device identification, marketing attribution, and analytics. This product is an enhanced version of FingerprintJS and has been fully re-designed to solve the most challenging identification use cases. Its source is not available in this or any other public repository.

Fingerprint Identification is able to achieve 99.5% accuracy, because it processes the browser attributes on the server and also analyzes vast amounts of auxiliary data (e.g. IP addresses, time of visit patterns, URL changes, etc.). Because of these advanced matching techniques, Fingerprint Identification is able to reliably deduplicate different users that have identical devices. For a comprehensive list of advantages over FingerprintJS, please visit Fingerprint Identification vs. FingerprintJS.

Fingerprint Identification is available for Web, Android, iOS, and other platforms. Our plans start at $99 per month and include with them 20K API calls. You can easily get started by signing up for a free, no-obligation 14-day trial.

Resources

🍿 Fingerprint Identification live demo

▶️ Video: Use Fingerprint Identification to prevent multiple signups by same user

🗂️ Sample responses for the different Fingerprint Identification plans

⏱️ How to upgrade from FingerprintJS to Fingerprint Identification in 30 seconds

📕 Fingerprint Identification documentation

Migrating to v4

Migrating from Migration Guide Documentation
v3 Migrating from v3 to v4 v3 documentation
v2 Migrating from v2 to v4 v2 documentation
v1 Migrating from v1 to v4 v1 documentation

Version policy

See the compatibility policy for the API and visitor identifiers in the version policy guide.

Supported browsers

The library supports all popular browsers. See more details and learn how to run the library in old browsers in the browser support guide.

Where to get support

Using Issues and Discussions publicly will help the open-source community and other users with similar issues. However, if you require private support, please email us at [email protected].

Contributing

See the contribution guidelines to learn how to start a playground, test, and build.

fingerprintjs's People

Contributors

antoinevastel avatar bayotop avatar chandra158 avatar connormiha avatar dependabot[bot] avatar dj-stormtrooper avatar finesse avatar fpkamp avatar grossacasac avatar guzzter avatar hiuny avatar hmaesta avatar jonashaag avatar jurouhlar avatar makma avatar msp avatar nuschk avatar otanim avatar sanasol avatar schinkentanz avatar skapoor avatar skcopland avatar sleepprogger avatar stavares843 avatar szepeviktor avatar tcyrus avatar timgates42 avatar triptec avatar undemian avatar valve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fingerprintjs's Issues

Use html&css for font detection.

Like this: https://github.com/gabriel/font-detect-js

You readme suggests:
14. Full list of installed fonts (maintaining their order, which increases the entropy), implemented with Flash.

But this sucks, cause some browsers (firefox at least) use "click-to-play" behavior for flash of older versions and you can`t get font list from flash reliably, because of this.
Tested this stuff on at least 1m DAU site, produces 1-3 % errors rates (font list not being collected for "same"(with same cookie) user, thus different fingerprints)

jsFontsKey has some problem when browser zoom in or zoom out

my test result:
time1:zoom to 100%
Serif"[100 … 141]
136: "Vijaya"137: "Vrinda"138: "Webdings"139: "Wingdings"140: "Wingdings 2"141: "Wingdings 3"

time2:zoom to 110%
Serif"[100 … 140]
136: "Vrinda"137: "Webdings"138: "Wingdings"139: "Wingdings 2"140: "Wingdings 3"

Improving

Considered you already have some good features here! And more can be added according to this stackoveflow discussion. I could have listed but not doing it as it is huge reading. & it also given some good solution!

Probe plugins by name to avoid cloaking & randomization

Currently various browser vendors are trying to mitigate browser fingerprinting.
Firefox does so called "plugin cloaking" - https://wiki.mozilla.org/Fingerprinting#Plugins, i.e. only allows to enumerate the most popular plugins (like Flash and QuickTime), while others are hidden from enumeration. It's still possible to get the availability of the plugin by trying to get it by name:

navigator.plugins["Unity Player"].name // get cloaked plugin by name
"Unity Player"

Some other browsers, like Pale Moon, do plugin randomization to always return plugins in a different order:
https://forum.palemoon.org/viewtopic.php?f=26&t=4406

One way to find randomization is to sort the list of plugins. But this will not solve the issue of cloaking.

So I suggest we need to expand the plugin detection code to:

  1. Get a list of available plugins calling navigator.plugins and then sort this list.
  2. Probe additional plugins having a predefined list of plugins. This list should be compiled in this issue.
  3. Combine two lists.

For now, I'm including the starting list of plugins to work with:

          "AcroPDF.PDF", // Adobe PDF reader 7+
          "Adodb.Stream",
          "AgControl.AgControl", // Silverlight
          "DevalVRXCtrl.DevalVRXCtrl.1",
          "MacromediaFlashPaper.MacromediaFlashPaper",
          "Msxml2.DOMDocument",
          "Msxml2.XMLHTTP",
          "PDF.PdfCtrl", // Adobe PDF reader 6 and earlier, brrr
          "QuickTime.QuickTime", // QuickTime
          "QuickTimeCheckObject.QuickTimeCheck.1",
          "RealPlayer",
          "RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)",
          "RealVideo.RealVideo(tm) ActiveX Control (32-bit)",
          "Scripting.Dictionary",
          "SWCtl.SWCtl", // ShockWave player
          "Shell.UIHelper",
          "ShockwaveFlash.ShockwaveFlash", //flash plugin
          "Skype.Detection",
          "TDCCtl.TDCCtl",
          "WMPlayer.OCX", // Windows media player
          "rmocx.RealPlayer G2 Control",
          "rmocx.RealPlayer G2 Control.1"

Return Promise

If native ES6 promise available.
Open questions:

  1. What should happen if any polyfill is available.
  2. If the fingerprint returning method will be ok to implement as promise-returning, callback-accepting to handle both presence and absence of the promise impl.

Problem when try to get two fingerprint in chrome

I try to get two fingerprint with different options, but only "fp2" has value in chrome(IE 9 is same).
And It's run well in Firefox.
I debug the code, following code at line:688 is not run in first time calling.

      window[hiddenCallback] = function(fonts) {
        done(fonts);
      };

Html

<script src="js/fingerprint2.js" ></script>
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject_src.js"></script>
... ...
<td id='fp1'></td><td>excludeUserAgent, excludeDoNotTrack</td>
... ...
<td id='fp2'></td><td>excludeUserAgent, excludeDoNotTrack, excludeWebGL</td>
... ...
<script type="text/javascript">
var options = { excludeUserAgent: true, excludeDoNotTrack:true};
var fp = new Fingerprint2(options);
  fp.get(function(result) {
    console.log("result:"+result);//zzz
      document.getElementById('fp1').innerHTML = result;
  });

    options = { excludeUserAgent: true, excludeDoNotTrack:true, excludeWebGL:true};
    fp = new Fingerprint2(options);
  fp.get(function(result) {
      console.log("result:"+result);//zzz
        document.getElementById('fp2').innerHTML = result;
  });

</script>

Use something like ua-parser.js

Cause using navigator.userAgent is a bad idea - every browser restart can cause it to change (modern browsers(firefox/chrome/mobile) use auto-update). Thanks for your work =)

how is fingerprintjs2 working now

From http://valve.github.io/blog/2013/07/14/anonymous-browser-fingerprinting/, it notes:
browser fingerprinting is not good with mobile browsers, unless you want to distinguish Android users from iPhone ones.

From https://gitter.im/Valve/fingerprintjs2/archives/2015/03/09, it notes:
This library will try to make every effort to work well on mobile.

What is the accurate in mobile inlucde android and ios now?
I'm not sure whether to use fingerprintjs2 on mobile or not, thanks.

Design a better demo page

It needs to be responsive (use some micro responsive CSS framework).
It should also start the FP process when button is clicked, not on page load.

Adopt Semver Versioning

Adopt semver versioning.

Currently almost every release breaks backwards compatibility by changing the resulting fingerprint.
The version change should reflect that. Instead of going from 0.1.3 to 0.1.4, we should go to 0.2.0, if output FP changes.

flashFontsKey can't get anything when Chrome in incognito mode

the chrome version is : 41.0.2272.101 m
http://browserleaks.com/fonts has the same problem.

but maybe it is a way to detect whether user in incognito mode or not.

maybe we can do it like that:
NoFlashFontskey = "f8e9592befd6dcb2337f6ac5d0beca77"
FlashFontskey = "2a4d643f" or "00000000"
Key = NoFlashFontskey+FlashFontskey

if we had key1 and key2:

if (key1===key2){
then user1 is user2 (strongly)
}else{
if (key1.substr(32,8)==="00000000" || key2.substr(32,8)==="00000000"){
if(key1.substr(0,32)===key2.substr(0,32)){
then user1 is user2 (not strongly) and user maybe in incognito mode
}else{
then user1 is not user2 (strongly)
}
}else{
if (key1.substr(32,8)!=="00000000" && key2.substr(32,8)!=="00000000")
&& key1 !== key2
then user1 is not user2 (strongly)
}
}

HSTS supercookie for IOS

a new technique named "HSTS supercookie" seems to be able to fingerprint iOS devices pretty well

Too many collisions

I am in the middle of rolling out fingerprinting via this lib to about a million odd users. During testing we have been seeing a lot of collisions (upwards of 15%). Interestingly these collisions are across geographies - which means that the underlying values are different (at least the language and timezone will be different). Any ideas?

Safari 3 fingerprints

I'm running Safari (Version 8.0.7 (10600.7.12)) without Flash it seems to alternate between 3 different fingerprints for the same browser in the same session.

I'm using the example code from the README.md:

(function () {
  new Fingerprint2().get(function(result){
      console.log(result);
  });
})();

Webgl for fingerprint instead of canvas (or with canvas).

Didn`t have time to test if stuff like this
https://github.com/kmowery/canvas-fingerprinting.git
(https://github.com/kmowery/canvas-fingerprinting/tree/master/static/experiments/webgl-teapot)
correlates with canvas fingerprint.

Both fingerprints (canvas/webgl) produce hash for [graphic_card, current_driver_version, browser_wrapper_code] vector. So there should be some sort of correlation, so maybe a separate option for "webgl" fingerprint should exist.

Text in canvas affected by CSS(font "no-real-font-123", character"\ud83d\ude03")

When set the font as "no-real-font-123", the canvas will paint the text as default font, is that right?
But I found the default font could be changed by CSS, and also "\ud83d\ude03" will become □□ sometimes.

Then I got different fingerprint on two page with same browser, because CSS of two page are different they got different font in canvas.

I'm not good at CSS, so I'm not find out the reason.

Is there have a remind list like "Don't do it in your CSS"?

And here is one thing that I found can't do.
If set style of span like:

span  {
 //some thing
}

That will make jsFontsKey get nothing, because it use span to detect fonts.
Following way is OK.

<style>
.style-of-span {
  //something
}
</style>
<span class='style-of-span'> Bili</span>

jsFontsKey performance improvement

The jsFontsKey should store its' result in a cookie and check and return the value stored in that cookie if it exists, before doing the Font detection again. The jsFontsKey is performing a lot of Layout and rendering operation that takes for IOS UIWebview about 5 sec to perform, the following makes the page load very sluggish and effect battery life.

Can you explain detectScreenOrientation? Add detectScreenOrientation

Hi!
Can you explain, why you do this and how to detect screen orientation, if you sort available resolutions?

       if(this.options.detectScreenOrientation) {
          available = (screen.availHeight > screen.availWidth) ? [screen.availHeight, screen.availWidth] : [screen.availWidth, screen.availHeight];
        } else {
          available = [screen.availHeight, screen.availWidth];
        }

And maybe you can add separate method to detect device orientation availability? (but i dunno how to detect it, maybe you know :-))

excludePlugins options key missing

Sometimes different fingerprints appear when plugins are taken into account. Currently almost every option can be disabled, except plugin. I could solve it by adding an "expludePlugins" option and changing pluginsKey() to the following, could you maybe merge it?
//-----
pluginsKey: function(keys) {
if (!this.options.excludePlugins) { // only when not excluded
if(this.isIE()){
keys.push(this.getIEPluginsString());
} else {
keys.push(this.getRegularPluginsString());
}
}
return keys;
},
//---
Thanks,
wfR ChrisA

implement robust canvas blending detection

Current code was broken, (see #62), so I removed it. Need to develop more robust detection code + a way to enumerate supported blending modes (including non-standard). Watch out for false positives and inconsistencies in Chrome 27 and Safari 8.

Learn to avoid being blocked by FP blocking tools

There are tools out there, that replace Canvas#toDataURL and thus make FPing useless.
Example of these tools: https://chrome.google.com/webstore/detail/canvasfingerprintblock/ipmjngkmngdcdpmgmiebdmfbkcecdndc/related

We need to learn how to avoid being blocked by them. For example, create a canvas in an iframe might help.

<iframe id="iframe" sandbox="allow-same-origin" style="display:none"></iframe>;
<script>
var canvas = document.getElementById("iframe").contentDocument.createElement('canvas');
...
</script>

console.log(keys) returns error

When trying to log the results of the fingerprint (Fingerprintjs2 0.7.4), I see an error in both Chrome 44.0.2 and Firefox 40.0.3:

"Uncaught ReferenceError: keys is not defined(anonymous function) @ index.html:83(anonymous function) @ fingerprint2.js:108(anonymous function) @ fingerprint2.js:389"

Changing the hash-function

Hi and thx for this beautiful piece of software :-)
I'm playing around with fingerprinting libs quite some time know and really like your approach.
Apart from adding more fingerprinting methods the only thing that I would like like to improve is the consistency of fingerprints during a device lifecycle.

For example there are some params that won't change over time, some that will but in a given direction (plugin versions) and some that are highly fluctuating.
With the current hash method we always end up with a new fingerprint and need to "fuzzy match" them server-side.

Maybe we could introduce a more intelligent way of building our fingerprint by things like: https://github.com/ethanlim/ccmf#locality-sensitive-hashing-lsh
and therefore reduce the server-side effort?

Default Fingerprint2() result different in two tabs in the same browser

Hi, I am trying to determine why a fingerprint generated by two different tabs in the same browser would be different.

I have a javascript heavy web app and a basic HTML page both generating a fingerprint in the same browser but different tabs. I cannot for the life of me have the tabs create the same fingerprint.

What in the current tab would dictate a different fingerprint being generated? I did not see anything that was dependent on what was currently rendered.

Any insights are appreciated. I have played with disabling various options in both to no avail.

Canvas bug in Safari

I got two different fingerprints in my Safari 8. When I loaded fingerprintjs2 the first time the fingerprint was 4a6fd73681de95e22d6021eddb0ea2a3, if I clicked btn again i got 66a9c3707479d6f532dc5959f8da0f72.

This is diff of these two cases https://www.diffchecker.com/rw0vf5cy.

  result.push("canvas fp:" + canvas.toDataURL());

If I comment canvas.toDataURL() fingerprints are identical.

Best way to uniquely identify!

Well, I just scrolled in your project & yes it's a cool project dude.

Need some more identification options for unique identification.

  1. IMEI detection,
  2. WLAN MAC address detection,
  3. Serial number detection,
  4. SIM detection

The best way to unique identification!

Hardware based Key and Server Side JS

Well, there is another great option could be added. Well, as you read in title "Hardware based Key". Like detecting Security keys which is also available in Google Security Solution.

Though there is security risks. As JS file runs on client side so anyone can bypass it with simple browser based developer extensions.

There is a good reading here.

where to discuss?

Is there somewhere we can discuss the status of v2 and ideas related to it?

"§" sometimes become "§".

For now, I don't find out why.
That happens in different pages with one browser.
I compare all values, all of them is same, except "§" -> "§".


Could I ask why not use some normal character?
Is there has special reason? Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.