Coder Social home page Coder Social logo

express-fingerprint's Introduction

Fingerprint express middleware

https://w3c.github.io/fingerprinting-guidance/#bib-NDSS-FINGERPRINTING

Passive fingerprinting is browser fingerprinting based on characteristics observable in the contents of Web requests, without the use of any code executing on the client side.

Passive fingerprinting would trivially include cookies (often unique identifiers sent in HTTP requests) and the set of HTTP request headers and the IP address and other network-level information. The User-Agent string, for example, is an HTTP request header that typically identifies the browser, renderer, version and operating system. For some populations, the user agent string and IP address will commonly uniquely identify a particular user's browser.

Default implementation is Never trust clients, So collect only server-side information. But you can push additional parameter with initialization config.

TODO

Implement this: http://research.microsoft.com/pubs/156901/ndss2012.pdf

Installation

npm install express-fingerprint

Usage

As a Express middleware

var Fingerprint = require('express-fingerprint')

app.use(Fingerprint({
	parameters:[
		// Defaults
		Fingerprint.useragent,
		Fingerprint.acceptHeaders,
		Fingerprint.geoip,

		// Additional parameters
		function(next) {
			// ...do something...
			next(null,{
			'param1':'value1'
			})
		},
		function(next) {
			// ...do something...
			next(null,{
			'param2':'value2'
			})
		},
	]
}))

app.get('*',function(req,res,next) {
	// Fingerprint object
	console.log(req.fingerprint)
})

req.fingerprint object is like below.

{
	"hash": "bd767932c289b92b4de510f4c4d48246",
	"components": {
		"useragent": {
			"browser": {
				"family": "Chrome",
				"version": "50"
			},
			"device": {
				"family": "Other",
				"version": "0"
			},
			"os": {
				"family": "Mac OS",
				"major": "10",
				"minor":"11"
		},
		"acceptHeaders": {
			"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
			"encoding": "gzip, deflate, sdch",
			"language": "en-US,en;q=0.8"
		},
		"geoip": {
			"country": "US",
			"resion": "CA",
			"city": "San Francisco"
		},
		"param1": "value1",
		"param2": "value2"
	}
}

List of fingerprinting sources

  • User Agent
  • HTTP_ACCEPT Headers
  • GEO-ip

License

MIT

express-fingerprint's People

Contributors

yusukeshib avatar shanmmukha1589 avatar stonerdev avatar hornswaggler avatar

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.