@anonympins/fingerprint 0.4.5 → 0.4.6
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 +18 -0
- package/package.json +1 -1
- package/src/js/dynamic-wasm.js +23 -1
- package/src/js/fingerprint.js +442 -59
- package/src/js/library.js +1740 -1729
- package/src/js/pow.solver.inline.js +381 -285
- package/src/js/pow.solver.js +97 -1
- package/src/js/tests/fingerprint.test.js +59 -0
- package/src/php/AutoTuner.php +1 -1
- package/src/php/Challenge/ChallengeUtils.php +97 -0
- package/src/php/FingerprintEngine.php +136 -8
- package/src/php/Optimization/Optimization.php +257 -255
- package/src/php/Optimization/OptimizationOperators.php +41 -35
- package/src/php/RequestContext.php +2 -0
- package/src/php/Tests/FingerprintEngineTest.php +105 -0
- package/src/php/Tests/RequestUtilsTest.php +13 -0
- package/src/php/Utils/RequestUtils.php +45 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## Version 0.4.6
|
|
2
|
+
|
|
3
|
+
### ✨ New Features
|
|
4
|
+
|
|
5
|
+
- **Polymorphic WASM Modules**: Further enhances client-side WebAssembly modules by introducing polymorphic generation, making it even harder for bots to fingerprint and reverse-engineer the client-side logic.
|
|
6
|
+
- **Proof-of-Space (PoSpace) Challenge**: Implemented a new Proof-of-Space challenge type. This challenge requires clients to allocate and prove access to a certain amount of storage space, adding another layer of bot detection.
|
|
7
|
+
- **Enhanced TLS Tracking (HTTPS)**: Introduced new capabilities for tracking and analyzing TLS-related information, improving the accuracy of client identification and anomaly detection over HTTPS connections.
|
|
8
|
+
|
|
9
|
+
### 🚀 Improvements
|
|
10
|
+
|
|
11
|
+
- **Analog Cross-Layer Inconsistency Score**: Refined the `crossLayerInconsistencyScore` calculation to provide a more nuanced and "analog" assessment of inconsistencies between different layers of client data, leading to more precise bot identification.
|
|
12
|
+
|
|
13
|
+
### 🐛 Bug Fixes
|
|
14
|
+
|
|
15
|
+
- **Auto-Tuner Fix**: Addressed several issues within the auto-tuner, improving its stability, learning accuracy, and resilience against edge cases.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
1
19
|
## Version 0.4.5
|
|
2
20
|
|
|
3
21
|
### ✨ New Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anonympins/fingerprint",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
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",
|
package/src/js/dynamic-wasm.js
CHANGED
|
@@ -27,6 +27,23 @@ function encodeSLEB128(val) {
|
|
|
27
27
|
return bytes;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
function generatePolymorphicInstructions() {
|
|
31
|
+
const ops = [0x6a, 0x6b, 0x6c, 0x73]; // add, sub, mul, xor
|
|
32
|
+
const insts = [];
|
|
33
|
+
const count = 3 + Math.floor(Math.random() * 5); // 3 to 7 instructions
|
|
34
|
+
|
|
35
|
+
// Initialize dummy local 4
|
|
36
|
+
const initVal = Math.floor(Math.random() * 1000) - 500;
|
|
37
|
+
insts.push(0x41, ...encodeSLEB128(initVal), 0x21, 0x04);
|
|
38
|
+
|
|
39
|
+
for (let i = 0; i < count; i++) {
|
|
40
|
+
const op = ops[Math.floor(Math.random() * ops.length)];
|
|
41
|
+
const randVal = Math.floor(Math.random() * 1000) - 500;
|
|
42
|
+
insts.push(0x20, 0x04, 0x41, ...encodeSLEB128(randVal), op, 0x21, 0x04);
|
|
43
|
+
}
|
|
44
|
+
return insts;
|
|
45
|
+
}
|
|
46
|
+
|
|
30
47
|
export class DynamicWasmGenerator {
|
|
31
48
|
/**
|
|
32
49
|
* Generates a unique polymorphic WebAssembly module containing a custom hash function
|
|
@@ -37,8 +54,12 @@ export class DynamicWasmGenerator {
|
|
|
37
54
|
static generate(constants) {
|
|
38
55
|
const { seed, multiplier, adder } = constants;
|
|
39
56
|
|
|
57
|
+
const preLoopPoly = generatePolymorphicInstructions();
|
|
58
|
+
const midLoopPoly = generatePolymorphicInstructions();
|
|
59
|
+
|
|
40
60
|
const inst = [
|
|
41
|
-
0x01,
|
|
61
|
+
0x01, 0x05, 0x7f, // Locals: 1 entry of 5 locals of type i32
|
|
62
|
+
...preLoopPoly,
|
|
42
63
|
// h = seed
|
|
43
64
|
0x41, ...encodeSLEB128(seed),
|
|
44
65
|
0x21, 0x03,
|
|
@@ -77,6 +98,7 @@ export class DynamicWasmGenerator {
|
|
|
77
98
|
|
|
78
99
|
// local.set 3
|
|
79
100
|
0x21, 0x03,
|
|
101
|
+
...midLoopPoly,
|
|
80
102
|
|
|
81
103
|
// i = i + 1
|
|
82
104
|
0x20, 0x02,
|