@anonympins/fingerprint 0.5.5 → 0.6.1
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 +21 -0
- package/README.md +7 -6
- package/package.json +1 -1
- package/public/fp.js +1 -1
- package/public/fp.wasm +0 -0
- package/src/js/build-client.js +1 -1
- package/src/js/fingerprint.client.js +19 -5
- package/src/js/fingerprint.client.obfuscated.js +1 -1
- package/src/js/fingerprint.js +430 -74
- package/src/js/problem-manager.js +22 -0
- package/src/js/tests/cross_parity.test.js +17 -11
- package/src/js/tests/fingerprint.client.test.js +130 -128
- package/src/js/tests/fingerprint.test.js +17 -2
- package/src/js/ttl-optimization.worker.js +51 -0
- package/src/php/Challenge/ChallengeUtils.php +120 -8
- package/src/php/FingerprintBuilder.php +193 -185
- package/src/php/FingerprintEngine.php +245 -3
- package/src/php/ProblemManager.php +20 -0
- package/src/php/RequestContext.php +2 -0
- package/src/php/Tests/ChallengeUtilsTest.php +446 -285
- package/src/php/Utils/RequestUtils.php +26 -1
|
@@ -827,6 +827,25 @@ class RequestUtils
|
|
|
827
827
|
$deviceData['ips'][] = $clientIp;
|
|
828
828
|
}
|
|
829
829
|
|
|
830
|
+
// Pruning par fenêtre glissante temporelle
|
|
831
|
+
if (!isset($deviceData['ipTimes'])) {
|
|
832
|
+
$deviceData['ipTimes'] = [];
|
|
833
|
+
}
|
|
834
|
+
$deviceData['ipTimes'][$clientIp] = $now;
|
|
835
|
+
|
|
836
|
+
$slidingWindow = 2 * 3600 * 1000; // 2 heures
|
|
837
|
+
$cutOff = $now - $slidingWindow;
|
|
838
|
+
foreach ($deviceData['ipTimes'] as $ip => $lastSeen) {
|
|
839
|
+
if ($lastSeen < $cutOff) {
|
|
840
|
+
$ipKey = array_search($ip, $deviceData['ips'], true);
|
|
841
|
+
if ($ipKey !== false) {
|
|
842
|
+
unset($deviceData['ips'][$ipKey]);
|
|
843
|
+
}
|
|
844
|
+
unset($deviceData['ipTimes'][$ip]);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
$deviceData['ips'] = array_values($deviceData['ips']);
|
|
848
|
+
|
|
830
849
|
// Score d'historique basé sur le nombre d'IPs utilisées (rotation de proxy)
|
|
831
850
|
$maxIpsPerDevice = 15;
|
|
832
851
|
$freeIpChanges = 3;
|
|
@@ -1006,7 +1025,13 @@ class RequestUtils
|
|
|
1006
1025
|
|
|
1007
1026
|
public static function getThreatIntelScore(RequestContext $context, array $threatIntelConfig): array
|
|
1008
1027
|
{
|
|
1009
|
-
|
|
1028
|
+
$zkpY = $context->zkpY;
|
|
1029
|
+
if (empty($zkpY)) {
|
|
1030
|
+
return ['threatIntelScore' => 0.0];
|
|
1031
|
+
}
|
|
1032
|
+
$store = StoreManager::getStore();
|
|
1033
|
+
$isBanned = $store->has("banned-zkp-y:{$zkpY}");
|
|
1034
|
+
return ['threatIntelScore' => $isBanned ? 100.0 : 0.0];
|
|
1010
1035
|
}
|
|
1011
1036
|
|
|
1012
1037
|
/**
|