@anonympins/fingerprint 0.7.2 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -9
- package/README.md +1 -1
- package/package.json +109 -107
- package/public/fingerprint-anti-bot.zip +0 -0
- package/src/js/fingerprint.client.js +252 -45
- package/src/js/fingerprint.client.obfuscated.js +1 -1
- package/src/js/fingerprint.js +265 -185
- package/src/js/fingerprint.utils.js +32 -5
- package/src/js/fingerprint.worker.js +81 -0
- package/src/js/library.js +6 -2
- package/src/js/pow.solver.js +2 -3
- package/src/js/problem-manager.js +113 -113
- package/src/js/tests/fingerprint.client.init.test.js +30 -0
- package/src/js/tests/fingerprint.test.js +136 -4
- package/src/js/tests/threatIntel.test.js +76 -0
- package/src/php/AutoTuner.php +36 -18
- package/src/php/Challenge/ChallengeUtils.php +121 -240
- package/src/php/DirectFingerprint.php +16 -4
- package/src/php/FingerprintClient.php +17 -19
- package/src/php/FingerprintEngine.php +77 -39
- package/src/php/Ja3AnomalyDetector.php +20 -12
- package/src/php/Optimization/Optimization.php +5 -1
- package/src/php/Optimization/OptimizationOperators.php +5 -1
- package/src/php/Optimization/ProblemInitializers.php +16 -4
- package/src/php/ProblemManager.php +20 -14
- package/src/php/Tests/ChallengeUtilsTest.php +469 -453
- package/src/php/Tests/FingerprintEngineTest.php +6 -1
- package/src/php/Tests/RequestUtilsTest.php +1 -1
- package/src/php/Tests/ThreatIntelTest.php +64 -0
- package/src/php/Utils/Env.php +51 -49
- package/src/php/Utils/MaliciousPatterns.php +74 -74
- package/src/php/Utils/RequestUtils.php +231 -132
- package/src/php/WordPress/WpDbStore.php +4 -0
- package/src/php/WordPress/{fingerprint-wordpress.php → fingerprint-anti-bot.php} +131 -126
- package/src/php/WordPress/languages/fingerprint-wordpress-de_DE.mo +0 -0
- package/src/php/WordPress/languages/fingerprint-wordpress-de_DE.po +1 -1
- package/src/php/WordPress/languages/fingerprint-wordpress-fr_FR.mo +0 -0
- package/src/php/WordPress/languages/fingerprint-wordpress-fr_FR.po +1 -1
- package/src/php/WordPress/package.php +6 -3
- package/src/php/WordPress/readme.txt +36 -0
- package/public/fingerprint-wordpress.zip +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,48 @@
|
|
|
1
|
+
## Version 0.7.4
|
|
2
|
+
|
|
3
|
+
- 🛡️ **Security & Rate Limiting**:
|
|
4
|
+
- **Domain-Aware Challenge Rate Limiter**: Implemented a new rate-limiting mechanism that operates on a per-domain basis. This enhances stability in multi-tenant architectures and mitigates challenge-based DoS attacks by isolating traffic per host.
|
|
5
|
+
- **Transparent Service Worker Interception (`fingerprint.worker.js`)**: Introduced a dedicated Service Worker and client integration (`initServiceWorker`, `syncServiceWorkerCredentials`) for transparent network request decoration (`X-Device-Fingerprint`, `X-Behavior-Metrics`). This avoids monkey-patching `window.fetch` directly, keeping native prototypes intact to prevent prototype tampering triggers while supporting domain-scoped protection.
|
|
6
|
+
- ⚖️ **Scoring Parity & Enhancements**:
|
|
7
|
+
- **`behaviorScore` Overhaul**: Reworked the behavioral scoring logic across all supported languages (Node.js, PHP, Java, Python) for more accurate detection of human-like interactions versus automated patterns.
|
|
8
|
+
- **`x-behavior-metrics` Direct Score & Binary Flag Support**: Added support for direct evaluation of client-side binary flags (`1` for verified human yielding a score of `0`, `0` for detected bot yielding a score of `100`) as well as raw numeric suspicion scores passed in the `x-behavior-metrics` header. (Contributed by @anonympins)
|
|
9
|
+
- **Cross-Language Weight Parity**: Harmonized the weights within all security profiles to ensure identical scoring and behavior across every runtime environment.
|
|
10
|
+
- **HTTP/2 Pseudo-Header Validation**: Hardened `protocolAnomalyScore` to detect and penalize invalid pseudo-headers in HTTP/2 fingerprints, improving detection of non-standard and bot-like clients.
|
|
11
|
+
- **Java Engine Parity**: The Java engine's auto-tuner and configuration management have been brought to full parity with the other language implementations.
|
|
12
|
+
- 🔧 **Fixes & Maintenance**:
|
|
13
|
+
- Corrected library import paths and expanded test coverage for the updated `behaviorScore` logic.
|
|
14
|
+
|
|
15
|
+
## Version 0.7.3
|
|
16
|
+
|
|
17
|
+
- 🛡️ **Scoring Corrections & Anti-Spoofing Fixes**:
|
|
18
|
+
- **TLS Spoofing Score Fix**: Resolved false positive detections where legitimate Chrome browsers were erroneously flagged as spoofed (`tlsSpoofingScore`), improving GREASE cipher/extension inspection and ALPN protocol validation.
|
|
19
|
+
- **Threat Intelligence Rework (`threatIntelScore`)**: Overhauled the threat intelligence scoring mechanism, refining the correlation between low-level TCP RTT and application-layer transit discrepancies while streamlining federated ZKP blacklist checks.
|
|
20
|
+
- 🌐 **Cross-Language Score Parity**:
|
|
21
|
+
- Resolved calculation discrepancies and harmonized scoring formulas across Node.js, PHP, and Java implementations to guarantee deterministic and identical results across all runtimes.
|
|
22
|
+
- Fixed all known scoring edge cases primarily affecting the Node.js module.
|
|
23
|
+
- 🔌 **WordPress Plugin Hardening & Compliance**:
|
|
24
|
+
- **Full WordPress Plugin Check Compliance**: Resolved all errors, warnings, and notices reported by the official WordPress Plugin Check tool, ensuring strict adherence to WordPress coding and security standards.
|
|
25
|
+
- 👥 **Contributors**:
|
|
26
|
+
- Contributed by @anonympins.
|
|
27
|
+
|
|
1
28
|
## Version 0.7.2
|
|
2
29
|
|
|
3
30
|
- 🔌 **WordPress Plugin Enhancements**:
|
|
4
|
-
-
|
|
5
|
-
-
|
|
31
|
+
- 🌐 **Full Internationalization (i18n)**: The WordPress plugin is now fully translated into French (fr_FR) and German (de_DE), providing a native experience for administrators in those languages.
|
|
32
|
+
- 🐛 **HTTP Fallback Fix**: Resolved a critical issue where challenges would fail on non-HTTPS (HTTP) sites. The system now transparently falls back to a secure server-side validation mechanism when the browser's `crypto.subtle` API is unavailable, ensuring functionality in all environments.
|
|
6
33
|
- 🛡️ **Security & Bot Detection Hardening**:
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
34
|
+
- 🔐 **Obfuscated Client Script (`fingerprint.client.obfuscated.js`)**: Introduced a new build step that generates a heavily obfuscated version of the client-side library. This makes reverse-engineering of the fingerprinting and behavioral analysis logic significantly more difficult for attackers.
|
|
35
|
+
- 🤖 **Default Bot Whitelist**: The engine now applies a comprehensive default whitelist for major search engine crawlers (Googlebot, Bingbot, Yandex, etc.) out-of-the-box. This ensures zero-configuration SEO compatibility and prevents legitimate bots from being challenged.
|
|
36
|
+
- 📡 **Updated Googlebot IPs**: The list of official Googlebot IP ranges has been updated to ensure the latest crawlers are correctly identified and allowed.
|
|
10
37
|
- 🔧 **Developer Experience & Debugging**:
|
|
11
|
-
-
|
|
38
|
+
- 📝 **Reverse DNS Logging**: Added detailed logging to the bot verification workflow. This provides clear insights into the reverse and forward DNS lookup process, making it easier to debug whitelisting and identify spoofing attempts.
|
|
12
39
|
|
|
13
40
|
## Version 0.7.1
|
|
14
41
|
|
|
15
|
-
- 🔌 **Native WordPress Plugin Integration (`fingerprint-
|
|
16
|
-
- Full official WordPress plugin integration (`fingerprint-
|
|
42
|
+
- 🔌 **Native WordPress Plugin Integration (`fingerprint-anti-bot`)**:
|
|
43
|
+
- Full official WordPress plugin integration (`fingerprint-anti-bot.php`) without external runtime dependencies, leveraging `$wpdb` through a dedicated `WpDbStore` adapter.
|
|
17
44
|
- Automatic SQL cache table provisioning and periodic cleanup of expired tickets via WP-Cron (`fingerprint_prune_expired_entries`).
|
|
18
|
-
- Automated packaging script (`package.php`) generating a ready-to-deploy ZIP archive (`fingerprint-
|
|
45
|
+
- Automated packaging script (`package.php`) generating a ready-to-deploy ZIP archive (`fingerprint-anti-bot.zip`).
|
|
19
46
|
- Cross-environment honeypot tripwires: immediately detects and drops automated scanners probing for non-WordPress entrypoints (Laravel, Symfony, Django, Spring Boot `/actuator`, phpMyAdmin, `.env`, `.git`).
|
|
20
47
|
- Admin dashboard security notice if running over unencrypted HTTP (warning about modern browsers disabling native `crypto.subtle` APIs in insecure contexts).
|
|
21
48
|
- 🔬 **JavaScript Prototype Tampering Detection (`detectTamperedPrototypes`)**:
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,107 +1,109 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@anonympins/fingerprint",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "Advanced anti-bot library for Node.js using multi-layer fingerprinting (JA3, client-side, headers), behavioral analysis, and adaptive Proof-of-Work (PoW) challenges to mitigate scraping, scalping, and automated threats.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"engines": {
|
|
8
|
-
"node": ">=20.0.0"
|
|
9
|
-
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"test": "vitest run --reporter=verbose",
|
|
12
|
-
"pub": "npm run build && npm login && npm publish --access public",
|
|
13
|
-
"build": "node src/js/build-client.js"
|
|
14
|
-
},
|
|
15
|
-
"exports": {
|
|
16
|
-
".": "./index.js",
|
|
17
|
-
"./client": {
|
|
18
|
-
"import": "./src/js/fingerprint.client.obfuscated.js",
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"./
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@anonympins/fingerprint",
|
|
3
|
+
"version": "0.7.4",
|
|
4
|
+
"description": "Advanced anti-bot library for Node.js using multi-layer fingerprinting (JA3, client-side, headers), behavioral analysis, and adaptive Proof-of-Work (PoW) challenges to mitigate scraping, scalping, and automated threats.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=20.0.0"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "vitest run --reporter=verbose",
|
|
12
|
+
"pub": "npm run build && npm login && npm publish --access public",
|
|
13
|
+
"build": "node src/js/build-client.js"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./index.js",
|
|
17
|
+
"./client": {
|
|
18
|
+
"import": "./src/js/fingerprint.client.obfuscated.js",
|
|
19
|
+
"browser": "./src/js/fingerprint.client.obfuscated.js"
|
|
20
|
+
},
|
|
21
|
+
"./worker": {
|
|
22
|
+
"import": "./src/js/fingerprint.worker.js",
|
|
23
|
+
"default": "./src/js/fingerprint.worker.js"
|
|
24
|
+
},
|
|
25
|
+
"./fp.wasm": "./public/fp.wasm",
|
|
26
|
+
"./fp.js": "./public/fp.js",
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"index.js",
|
|
31
|
+
"src/js/",
|
|
32
|
+
"public/",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE",
|
|
35
|
+
"CHANGELOG.md",
|
|
36
|
+
"src/php/",
|
|
37
|
+
"composer.json",
|
|
38
|
+
"phpunit.xml"
|
|
39
|
+
],
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/anonympins/fingerprint.git"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"anti-bot",
|
|
46
|
+
"bot-detection",
|
|
47
|
+
"security",
|
|
48
|
+
"middleware",
|
|
49
|
+
"express",
|
|
50
|
+
"nodejs",
|
|
51
|
+
"fingerprint",
|
|
52
|
+
"device-fingerprinting",
|
|
53
|
+
"ja3",
|
|
54
|
+
"tls-fingerprinting",
|
|
55
|
+
"proof-of-work",
|
|
56
|
+
"pow",
|
|
57
|
+
"useful-proof-of-work",
|
|
58
|
+
"upow",
|
|
59
|
+
"waf",
|
|
60
|
+
"scraping",
|
|
61
|
+
"scalping",
|
|
62
|
+
"mitigation",
|
|
63
|
+
"rate-limiting",
|
|
64
|
+
"honeypot",
|
|
65
|
+
"behavioral-analysis"
|
|
66
|
+
],
|
|
67
|
+
"author": "anonympins",
|
|
68
|
+
"license": "MIT",
|
|
69
|
+
"bugs": {
|
|
70
|
+
"url": "https://github.com/anonympins/fingerprint/issues"
|
|
71
|
+
},
|
|
72
|
+
"homepage": "https://github.com/anonympins/fingerprint#readme",
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"cookie-parser": "^1.4.6",
|
|
75
|
+
"express": "^4.22.2",
|
|
76
|
+
"javascript-obfuscator": "^4.1.0",
|
|
77
|
+
"jsdom": "^24.0.0",
|
|
78
|
+
"prom-client": "^15.1.2",
|
|
79
|
+
"terser": "^5.30.3",
|
|
80
|
+
"vitest": "^4.1.11"
|
|
81
|
+
},
|
|
82
|
+
"overrides": {
|
|
83
|
+
"body-parser": "2.3.0",
|
|
84
|
+
"qs": "6.16.0"
|
|
85
|
+
},
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"ioredis": "^5.3.2",
|
|
88
|
+
"knex": ">=3.0.0",
|
|
89
|
+
"mongodb": "^6.3.0",
|
|
90
|
+
"sqlite3": "^5.1.7"
|
|
91
|
+
},
|
|
92
|
+
"peerDependenciesMeta": {
|
|
93
|
+
"ioredis": {
|
|
94
|
+
"optional": true
|
|
95
|
+
},
|
|
96
|
+
"mongodb": {
|
|
97
|
+
"optional": true
|
|
98
|
+
},
|
|
99
|
+
"knex": {
|
|
100
|
+
"optional": true
|
|
101
|
+
},
|
|
102
|
+
"sqlite3": {
|
|
103
|
+
"optional": true
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"dependencies": {
|
|
107
|
+
"@tensorflow/tfjs": "^4.22.0"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
Binary file
|