@anonympins/fingerprint 0.4.2 → 0.4.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 +38 -0
- package/README.md +70 -60
- package/package.json +1 -1
- package/src/js/fingerprint.client.js +831 -635
- package/src/js/fingerprint.js +249 -31
- package/src/js/pow.solver.js +531 -497
- package/src/js/problem-manager.js +24 -0
- package/src/js/tests/fingerprint.client.init.test.js +140 -119
- package/src/js/tests/fingerprint.test.js +2451 -2319
- package/src/js/tests/pow.solver.test.js +233 -197
- package/src/js/tests/problem-manager.test.js +358 -322
- package/src/php/Challenge/ChallengeUtils.php +415 -361
- package/src/php/Config/SecurityProfiles.php +276 -271
- package/src/php/FingerprintClient.php +131 -131
- package/src/php/FingerprintEngine.php +36 -2
- package/src/php/Optimization/FunctionRegistry.php +63 -62
- package/src/php/Optimization/OptimizationOperators.php +401 -304
- package/src/php/ProblemManager.php +29 -0
- package/src/php/RequestContext.php +90 -90
- package/src/php/Store/IStore.php +41 -41
- package/src/php/Store/RedisStore.php +53 -53
- package/src/php/Tests/FingerprintEngineTest.php +330 -299
- package/src/php/Tests/ProblemManagerTest.php +376 -296
- package/src/php/Tests/RequestUtilsTest.php +386 -253
- package/src/php/Tests/problems.config.json +3 -3
- package/src/php/Utils/RequestUtils.php +201 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
+
## Version 0.4.4
|
|
2
|
+
|
|
3
|
+
### 🧮 Pattern Score Ratios & Weighted Subscores
|
|
4
|
+
- **Linear Weighted Pattern Scores**: Introduced configurable ratios (`regularityRatio`, `benfordRatio`, `enumerationRatio`) to dynamically adjust the influence of timing regularity, Benford's law deviation, and sequential path enumeration on the final `requestPatternScore`.
|
|
5
|
+
|
|
6
|
+
### 🕸️ Advanced Client Tracking & Touch Analysis
|
|
7
|
+
- **Mobile Client Touch Analysis**: Implemented detailed analysis of mobile touch events, extracting advanced behavioral metrics such as average pressure, touch radius size, coordinate variance, and multi-touch count to effectively detect automated touch emulation.
|
|
8
|
+
- **WASM Client Caching with IndexedDB**: Added client-side persistent storage of compiled WebAssembly modules in IndexedDB (`wasm-cache-db`) to drastically reduce initialization times, skipping compilation overhead on subsequent visits.
|
|
9
|
+
- **Phantom Interactive Traps**: Added invisible phantom interactive link traps to hook headlessly automated clients via hover/focus events.
|
|
10
|
+
|
|
11
|
+
### 🛡️ Enhanced Honeypot Protections & Extensibility
|
|
12
|
+
- **External Analyzers Support**: Extended the honeypot subsystem to allow plugging in external analyzers (e.g., custom regex matching or WAF frameworks like ModSecurity) to evaluate request payloads.
|
|
13
|
+
- **Optimized Injection Filters**: Refined input inspection to recursively search deeply nested NoSQL/SQL structures using centralized security algorithms.
|
|
14
|
+
|
|
15
|
+
### 📶 Stable Subnet Reputation & Rate Limiting
|
|
16
|
+
- **Hardware-Anchored Subnet Metrics**: Refactored subnet score aggregations to anchor suspicious activities to hardware-based device hashes (`deviceHash`) rather than easily cleared tracking cookies, preventing proxy rotation masking.
|
|
17
|
+
- **Subnet Challenge Rate Limiting**: Integrated a Token Bucket rate limiter (`checkChallengeRateLimit`) that throttles challenge requests per IPv4/IPv6 subnet to prevent denial of service (DoS) attacks on verification systems.
|
|
18
|
+
|
|
19
|
+
### 🤖 Botnet Clustering & Similarity Scores
|
|
20
|
+
- **Botnet Cluster Score**: Implemented network-wide botnet detection (`botnetClusterScore`) using exponential mathematical decay. It groups volatile client requests that share identical stable hardware profiles across distinct IP addresses within a rolling 10-minute window.
|
|
21
|
+
|
|
22
|
+
## Version 0.4.3
|
|
23
|
+
|
|
24
|
+
### 🔒 Rotation Score Hardening (Anti-Spoofing & No-JS Parity)
|
|
25
|
+
- **Server-Only Rotation Analysis**: Completely removed all client-side telemetry (`X-Device-Fingerprint`, canvas, gpu, hardware concurrency) from the `rotationScore` computation across all engines (Node.js, PHP, Python).
|
|
26
|
+
- **Zero-Trust Client Inputs**: Fixed a vulnerability where client-side fingerprint spoofing or the absence of JS headers on static/API requests could trick the engines into triggering false-positive rotation alerts. The stable part analysis now relies exclusively on server-side signatures (`ua`, `ja3`, `ja4`, `h2`, `tcp`).
|
|
27
|
+
|
|
28
|
+
### 🐍 Python Engine Parity & uPoW
|
|
29
|
+
- **Useful Proof-of-Work (uPoW) in Python**: Fully implemented uPoW support in Python, bringing complete parity to task dispatching and solution integration with the Node.js and PHP versions.
|
|
30
|
+
- **Dry Run & Score Matching**: Added robust Dry Run mode and suspicion score calculations in the Python engine, allowing passive security evaluation without request interruption.
|
|
31
|
+
|
|
32
|
+
### 🐘 PHP Engine Enhancements
|
|
33
|
+
- **PHP uPoW Coverage**: Greatly expanded test coverage for the PHP `ProblemManager` and useful work integrations, ensuring reliability under heavy workloads.
|
|
34
|
+
|
|
35
|
+
### 🛡️ Challenge Routing & Better Re-challenge
|
|
36
|
+
- **Refined Challenge Router**: Restructured challenge routing and solution validation pipelines for direct, consistent handling of cryptographic results.
|
|
37
|
+
- **Smarter Re-challenging**: Improved re-challenge behavior across all engines. If an already cleared device's score spikes above the high threshold again, the existing clearance ticket is bypassed, instantly prompting a fresh security challenge.
|
|
38
|
+
|
|
1
39
|
## Version 0.4.2 (Hotfix)
|
|
2
40
|
|
|
3
41
|
### 🧬 Auto-Tuner Rework & Sanity Guardrails
|
package/README.md
CHANGED
|
@@ -1,61 +1,71 @@
|
|
|
1
|
-
# Fingerprint anti-bot protection
|
|
2
|
-
|
|
3
|
-
NodeJS tests : [](https://github.com/anonympins/fingerprint/actions/workflows/ci.yml) / PHP tests : [](https://github.com/anonympins/fingerprint/actions/workflows/ci-php.yml) / Python tests : [](https://github.com/anonympins/fingerprint/actions/workflows/ci-python.yml)
|
|
4
|
-
|
|
5
|
-
[](https://github.com/anonympins/fingerprint/releases)
|
|
6
|
-
[](https://github.com/anonympins/fingerprint/blob/main/LICENSE)
|
|
7
|
-

|
|
8
|
-
|
|
9
|
-
A multi-layered behavioral, cryptographic, and network analysis engine designed to identify and mitigate malicious requests (bots, scrapers, session hijacking) in real-time. Supports
|
|
10
|
-
|
|
11
|
-

|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
1
|
+
# Fingerprint anti-bot protection
|
|
2
|
+
|
|
3
|
+
NodeJS tests : [](https://github.com/anonympins/fingerprint/actions/workflows/ci.yml) / PHP tests : [](https://github.com/anonympins/fingerprint/actions/workflows/ci-php.yml) / Python tests : [](https://github.com/anonympins/fingerprint/actions/workflows/ci-python.yml)
|
|
4
|
+
|
|
5
|
+
[](https://github.com/anonympins/fingerprint/releases)
|
|
6
|
+
[](https://github.com/anonympins/fingerprint/blob/main/LICENSE)
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
A multi-layered behavioral, cryptographic, and network analysis engine designed to identify and mitigate malicious requests (bots, scrapers, session hijacking) in real-time. Supports **Node.js**, **Python** and **PHP** environments.
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
### Presentation video
|
|
14
|
+
|
|
15
|
+
[](https://www.youtube.com/watch?v=Ujeznl0JAl4)
|
|
16
|
+
|
|
17
|
+
## Key Features
|
|
18
|
+
|
|
19
|
+
- **Multi-Layered Detection**: Combines TLS/JA3/JA4 analysis, HTTP header consistency checks, IP reputation, and behavioral tracking (mouse movements, keystrokes).
|
|
20
|
+
- **Adaptive Mitigation**: Imposes progressive cryptographic Proof-of-Work (PoW) challenges to block automated clients without impacting legitimate human users.
|
|
21
|
+
- **Predefined Profiles**: Ready-to-use security profiles (`balanced`, `strict`, `api`, `blog`, `ecommerce`) tailored to your specific use case.
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
### Node.js
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @anonympins/fingerprint
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### PHP
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
composer require anonympins/fingerprint
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Python
|
|
38
|
+
```bash
|
|
39
|
+
pip install fingerprint-engine
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Documentation
|
|
43
|
+
|
|
44
|
+
To prevent documentation drift, all detailed guides and reference materials are maintained in the `doc/` directory. Please refer to [these resources](https://github.com/anonympins/fingerprint/wiki/home) to configure and integrate the engine:
|
|
45
|
+
|
|
46
|
+
1. **[Key Concepts & Suspicion Vectors](https://github.com/anonympins/fingerprint/wiki/concepts)**: Learn how the engine calculates suspicion scores across the 15 distinct vectors and manages the Proof-of-Work mitigation layers.
|
|
47
|
+
2. **[Node.js Integration Guide](https://github.com/anonympins/fingerprint/wiki/nodejs_integration)**: Step-by-step instructions for Express.js middleware and raw HTTP server integrations.
|
|
48
|
+
3. **[PHP Integration Guide](https://github.com/anonympins/fingerprint/wiki/php_integration)**: Configuration details for direct PHP integration, TLS fingerprinting forwarding via Nginx/Apache, and securing Prometheus metrics.
|
|
49
|
+
3. **[Python Integration Guide](https://github.com/anonympins/fingerprint/wiki/python_integration)**: Python middleware for ASGI and WSGI integration.
|
|
50
|
+
4. **[Full Configuration Options](https://github.com/anonympins/fingerprint/wiki/full_options)**: Complete parameter list for fine-tuning weights, custom honeypots, and security profile overrides.
|
|
51
|
+
5. **[API Reference](https://github.com/anonympins/fingerprint/wiki/api_reference)**: Public API signatures and guides on substituting the in-memory datastore with Redis or MongoDB.
|
|
52
|
+
|
|
53
|
+
Start with the **[Documentation Portal](https://github.com/anonympins/fingerprint/wiki/home)** for a complete index.
|
|
54
|
+
|
|
55
|
+
## Contributing
|
|
56
|
+
|
|
57
|
+
We welcome community contributions! Please read our **[Contributing Guidelines](https://github.com/anonympins/fingerprint/blob/main/CONTRIBUTING.md)** for information on:
|
|
58
|
+
- Setting up your local environment (Node.js and PHP).
|
|
59
|
+
- Running the test suites (`Vitest` and `PHPUnit`).
|
|
60
|
+
- Coding and pull request standards.
|
|
61
|
+
|
|
62
|
+
Thanks to our contributors :
|
|
63
|
+
- [anonympins](https://github.com/anonympins)
|
|
64
|
+
|
|
65
|
+
## Used actively on
|
|
66
|
+
|
|
67
|
+
- https://primals.net and sub-sites
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
61
71
|
This project is licensed under the MIT License.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anonympins/fingerprint",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
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
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|