CreepJS

repository·master·Indexed 25 days ago

https://github.com/abrahamjuliot/creepjs

A research project designed to expose weaknesses and privacy leaks in modern anti-fingerprinting browsers and extensions. CreepJS focuses on detecting JavaScript tampering, fingerprinting lie patterns, and identifying high-entropy APIs. It includes specialized fingerprinting modules for Audio (via getOfflineAudioContext), Canvas 2D (via getCanvas2d), CSS (via getCSS and getCSSMedia), and DOM elements (via getClientRects and getHTMLElementVersion).

Tokens
21.6K
Snippets
6
Records
86
Agent score
82%

What's inside creepjs

  1. Understand the CreepJS Trademark Policy

    master

    The CreepJS trademark policy distinguishes between the software code and the brand identity. While the code is licensed under the MIT License (allowing free use, modification, and distribution), the name "CreepJS" and its logos are protected marks.

    Key Distinctions

    • The Code: Free to use under MIT.
    • The Marks: Restricted to prevent confusion regarding the official source of the project.

    If you are creating a derivative project for public use, you are required to rename it to avoid impersonating the official CreepJS™.

  2. Identify the official CreepJS deployment

    master

    SECURITY ALERT: EXTERNAL DOMAINS ARE UNSAFE

    The only official live deployment of CreepJS is hosted on GitHub Pages. Any other domains (such as .org, .com, or custom domains) claiming to be CreepJS are unauthorized mirrors and may be malicious honeypots designed to steal fingerprint data.

    • Official: https://abrahamjuliot.github.io/creepjs
    • Unsafe: All other URLs.
  3. Set up a development environment for CreepJS

    master

    To contribute to or develop CreepJS locally, use the following pnpm commands:

    • Install dependencies: pnpm install
    • Build for development: pnpm build:dev
    • Run in watch mode: pnpm watch:dev
    • Build for GitHub Pages release: pnpm build
    pnpm install
    pnpm build:dev
    pnpm watch:dev
    pnpm build
  4. Prohibited uses of the CreepJS brand

    master

    The following uses of the "CreepJS" marks are strictly prohibited to prevent impersonation:

    • Domain Names: Registering or using any domain containing "CreepJS" (e.g., creepjs.org, creepjs.net).
    • Product Identity: Using "CreepJS" as the primary name for a commercial product, hosted service, or public website.
    • Endorsement/Succession: Implying a fork is an "Official", "2.0", "Next Gen", or "successor" version of the original work.
  5. Permitted use of the CreepJS name

    master

    You are allowed to retain the name "CreepJS" in your fork only under specific circumstances:

    1. Contributing: When forking specifically to submit Pull Requests or contribute to the official repository.
    2. Personal Use: For private study, testing, or internal research.
    3. Attribution: When using the name solely to truthfully describe the origin of the code (e.g., "This project is based on CreepJS").
  6. Detect fingerprinting lies and tampering

    master

    CreepJS provides a suite of tools to detect if browser APIs have been tampered with or are returning 'lies' (fake values used to evade fingerprinting).

    Key capabilities include:

    • Prototype Analysis: Detecting if native functions (like Date, Navigator, or Canvas) have been modified, proxied, or have incorrect descriptors.
    • Plugin/MimeType Validation: Verifying the integrity of navigator.plugins and navigator.mimeTypes to ensure they haven't been spoofed.
    • Phantom Environments: Using hidden iframes (PHANTOM_DARKNESS) to run tests in isolated contexts to avoid interference from the main window's environment.

    Developers can use getPluginLies to validate plugin arrays and getLies to retrieve the accumulated records of detected tampering.

  7. Understand Navigator fingerprinting detection logic

    master

    CreepJS detects browser spoofing (lies) in the navigator object using several strategies:

    1. Cross-Reference Checks: Compares navigator.platform against the OS parsed from the userAgent. If they mismatch, lied is set to true.
    2. Worker Scope Validation: Compares reported values (like language, deviceMemory, hardwareConcurrency) against a provided workerScope. If they differ, it indicates the client is attempting to spoof values in the main thread.
    3. Value Sanity Checks:
      • deviceMemory: Validates that the value is one of the trusted increments (0.25, 0.5, 1, 2, 4, 8, 16, 32) and ensures it is not greater than the actual jsHeapSizeLimit reported by performance.memory.
      • userAgent/appVersion: Checks for extra spaces, gibberish, or mismatches between appVersion and userAgent.
      • plugins: Uses getPluginLies to check for inconsistencies in the PluginArray and validates plugin names/descriptions for gibberish.
    4. Consistency Checks: Ensures navigator.language and navigator.languages are logically consistent.
  8. Structure of the WebGL fingerprint object

    master

    When calling getCanvasWebgl(), the returned object follows this structure:

    {
      "extensions": ["string"],
      "pixels": [number],
      "pixels2": [number],
      "dataURI": "data:image/png;base64,...",
      "dataURI2": "data:image/png;base64,...",
      "parameters": {
        "UNMASKED_VENDOR_WEBGL": "string",
        "UNMASKED_RENDERER_WEBGL": "string",
        "MAX_TEXTURE_SIZE": number,
        "VERTEX_SHADER.LOW_FLOAT.precision": number,
        // ... other WebGL parameters
      },
      "parameterOrExtensionLie": boolean,
      "lied": boolean,
      "gpu": {
        "confidence": "string",
        "grade": "string",
        "parts": "string",
        "gibbers": "string",
        "warnings": ["string"],
        "compressedGPU": "string"
      }
    }
  9. Identify the worker scope type

    master

    The Scope enum and exported variables WORKER_TYPE and WORKER_NAME allow you to identify which type of worker was successfully spawned and used for fingerprinting.

    • Scope.WORKER: Indicates the fingerprinting was performed within a worker scope.
    • Scope.WINDOW: Indicates the fingerprinting was performed in the main window scope (fallback).

    WORKER_TYPE indicates the technical implementation: service (ServiceWorker), shared (SharedWorker), or dedicated (DedicatedWorker).

  10. Understand the Headless detection categories

    master

    CreepJS categorizes headless detection into three distinct mental models:

    1. Like Headless: Indicators that the environment lacks common features of a full desktop browser, even if it doesn't explicitly claim to be headless. Examples include noPlugins, noMimeTypes, noTaskbar, and noWebShare.
    2. Headless: Direct evidence of a headless environment. Examples include webDriverIsOn (detecting navigator.webdriver), presence of HeadlessChrome in the User Agent, or headless User Agents in Web Workers.
    3. Stealth: Indicators that the browser is actively trying to lie about its identity. Examples include hasIframeProxy (detecting iframe manipulation), hasToStringProxy (detecting overridden toString methods), and hasBadWebGL (detecting a mismatch between the main thread WebGL renderer and the Web Worker WebGL renderer).
  11. Extract a simplified analysis from a fingerprint with getRawFingerprint()

    master

    The getRawFingerprint(fp) function transforms a complex CreepJS fingerprint object (fp) into a flattened, human-readable Analysis object. This is useful for displaying device characteristics, engine information, and security ratings without the full complexity of the raw data.

    Key properties in the returned object include:

    • device: Array containing GPU info, memory, hardware concurrency, platform version, screen dimensions, and touch capabilities.
    • headless: Ratings (headlessRating, headlessLikeRating, headlessStealthRating) and platform estimates.
    • engine: The detected engine (e.g., from resistance.engine).
    • resistance: A truncated hash of the resistance metric.
    • canvas, webgl, audio: Truncated hashes of these specific fingerprinting vectors.
    • features: The version of the features detected.
    • fonts: Truncated hash and list of loaded fonts.
    • userAgent: The detected User Agent string.
    • userAgentData: Array containing platform, version, bitness, architecture, model, and mobile status.
    • lies: Truncated hash and keys of detected browser lies.
    • timezone: Array containing location, zone, epoch, offset, and locale information.
    • screen: Array containing dimensions, color depth, and touch info.
    • gpu: Array containing [vendor, renderer] and a gpuBrand string.