stealthhttp 0.3.0__tar.gz → 0.3.1__tar.gz
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.
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/CHANGELOG.md +20 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/PKG-INFO +1 -1
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/pyproject.toml +1 -1
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/__init__.py +1 -1
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/async_session.py +1 -2
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/backends/native_backend.py +3 -2
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/cdp_solver.py +2 -1
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/clienthints.py +1 -1
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/collectors/__init__.py +5 -1
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/detection.py +3 -2
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/device_db.py +3 -3
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/js_sandbox.py +3 -1
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/jsenv.py +6 -5
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/middleware.py +10 -9
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/pow.py +6 -4
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/proxy.py +0 -2
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/session_coord.py +2 -2
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/session_ext.py +1 -1
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/tests/test_features_v3.py +1 -1
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/tests/test_v030_features.py +1 -1
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/websocket.py +2 -1
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/.cargo/config.toml +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/.github/workflows/release.yml +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/.gitignore +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/Cargo.lock +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/Cargo.toml +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/LICENSE +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/README.md +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/benchmarks/bench.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/benchmarks/bench_native.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/examples/basic.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/_fallback.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/_loader.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/_rotation.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/ambient.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/antidetect.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/auto_bypass.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/auto_profile.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/backends/__init__.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/backends/base.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/backends/curl_backend.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/backends/wreq_backend.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/behavior.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/browser_cookies.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/browser_pool.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/browsing.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/bypasses/__init__.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/bypasses/akamai.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/bypasses/captcha.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/bypasses/cloudflare.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/bypasses/datadome.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/bypasses/flow.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/bypasses/imperva.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/bypasses/kasada.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/bypasses/perimeterx.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/bypasses/shape.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/bypasses/solver.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/capabilities.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/captcha.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/captcha_farm.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/challenge.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/collectors/akamai.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/collectors/datadome.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/collectors/imperva.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/collectors/kasada.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/collectors/perimeterx.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/collectors/shape.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/consistency.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/cookies.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/dns_intel.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/doh.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/error_analysis.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/exceptions.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/fingerprint_diff.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/forms.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/geo.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/graphql.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/h2_frames.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/har.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/header_canon.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/health_monitor.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/hooks.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/hsts.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/httpcache.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/humanize.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/identity.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/jsdb.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/lifecycle.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/lint.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/multipart.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/parsing.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/prepare.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/proxy_scoring.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/record_replay.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/redirect_intel.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/request_graph.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/response.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/response_decoder.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/response_intel.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/retry.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/rotation.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/selfcheck.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/sensors.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/session.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/site_recipes.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/smart_proxy.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/solving/__init__.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/solving/audio.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/solving/base.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/solving/browser.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/solving/local.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/solving/orchestrator.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/solving/providers.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/solving/vision.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/stealth_audit.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/strategy.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/tcp_tuning.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/tests/test_cdp_solver.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/tests/test_features_v3_live.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/tls_ext.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/tls_intel.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/tls_session.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/python/stealthhttp/traffic.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/src/fingerprint/headers.rs +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/src/fingerprint/ja3.rs +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/src/fingerprint/ja4.rs +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/src/fingerprint/mod.rs +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/src/fingerprint/profile.rs +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/src/lib.rs +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/src/proxypool.rs +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/src/rotation.rs +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/src/transport/decode.rs +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/src/transport/engine.rs +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/src/transport/mod.rs +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/src/transport/tls.rs +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/conftest.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_audio.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_bypass.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_bypasses.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_bypasses_live.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_emulation.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_features_v2.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_features_v2_live.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_fingerprint.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_humanize.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_jsemu.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_jsemu_live.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_live_bypass.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_live_detection.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_new_features.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_policies.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_routing.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_session.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_solving.py +0 -0
- {stealthhttp-0.3.0 → stealthhttp-0.3.1}/tests/test_vision.py +0 -0
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.1] - 2026-08-10
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- **proxy**: remove false-positive 403 ban detection (bare 403 is routine for APIs)
|
|
8
|
+
- **async_session**: remove semaphore from `each()._do` preventing deadlock
|
|
9
|
+
- **js_sandbox**: `return None` moved outside for-loop (was unreachable)
|
|
10
|
+
- **session_ext**: use `urlsplit().hostname` instead of `netloc.split(':')[0]` for credential URLs
|
|
11
|
+
- **native_backend**: add `time.monotonic()` for elapsed measurement
|
|
12
|
+
- **detection**: priority header check now accepts Firefox
|
|
13
|
+
- **device_db**: Android platform string corrected to 'Linux armv81'
|
|
14
|
+
- **clienthints**: thread-safe iteration with `list(policy.accepted)`
|
|
15
|
+
- **jsenv**: timing values chained sequentially
|
|
16
|
+
- **websocket**: CLOSE frame sent under lock
|
|
17
|
+
- **session_coord**: adaptive cutoff `now - max(1.0, 1/rps)` instead of hardcoded
|
|
18
|
+
- **middleware**: DedupeMiddleware wrapped in `threading.Lock()`
|
|
19
|
+
- **cdp_solver**: handle proxy URL without port
|
|
20
|
+
- **pow**: validate `nonce_size < 8`
|
|
21
|
+
- **collectors**: add KasadaCollector and ShapeCollector exports
|
|
22
|
+
|
|
3
23
|
## [0.3.0] - 2026-08-05
|
|
4
24
|
|
|
5
25
|
### Added — Killer Features
|
|
@@ -118,7 +118,7 @@ from .browser_pool import BrowserPool
|
|
|
118
118
|
from .record_replay import HttpRecorder, SessionReplayer, RecordedEntry, record_session
|
|
119
119
|
from .captcha_farm import CaptchaFarm, SolveResult
|
|
120
120
|
|
|
121
|
-
__version__ = "0.3.
|
|
121
|
+
__version__ = "0.3.1"
|
|
122
122
|
|
|
123
123
|
__all__ = [
|
|
124
124
|
"Session",
|
|
@@ -116,8 +116,7 @@ class AsyncSession:
|
|
|
116
116
|
) -> list[Any]:
|
|
117
117
|
"""Apply an async function to each item with concurrency limiting."""
|
|
118
118
|
async def _do(item: Any) -> Any:
|
|
119
|
-
|
|
120
|
-
return await fn(item, self)
|
|
119
|
+
return await fn(item, self)
|
|
121
120
|
return list(await asyncio.gather(*[_do(it) for it in items]))
|
|
122
121
|
|
|
123
122
|
# -- stats -------------------------------------------------------------
|
|
@@ -23,6 +23,7 @@ to see each hop.
|
|
|
23
23
|
|
|
24
24
|
from __future__ import annotations
|
|
25
25
|
|
|
26
|
+
import time
|
|
26
27
|
from typing import Any
|
|
27
28
|
from urllib.parse import urljoin, urlsplit
|
|
28
29
|
|
|
@@ -131,10 +132,12 @@ class NativeBackend:
|
|
|
131
132
|
url = f"{url}{sep}{urlencode(dict(req.params))}"
|
|
132
133
|
|
|
133
134
|
elapsed = 0.0
|
|
135
|
+
t0 = time.monotonic()
|
|
134
136
|
for hop in range(max_redirects + 1):
|
|
135
137
|
raw = self._engine.fetch_one(self._payload(
|
|
136
138
|
method, url, headers, body, req, verify, resolve
|
|
137
139
|
))
|
|
140
|
+
elapsed = (time.monotonic() - t0) * 1000
|
|
138
141
|
err = raw["error"]
|
|
139
142
|
if err:
|
|
140
143
|
raise _translate(err, method, url)
|
|
@@ -149,8 +152,6 @@ class NativeBackend:
|
|
|
149
152
|
method, body = "GET", None
|
|
150
153
|
headers.pop("content-type", None)
|
|
151
154
|
headers.pop("content-length", None)
|
|
152
|
-
# A redirect to another origin must not carry the first one's
|
|
153
|
-
# cookies or Host-specific headers.
|
|
154
155
|
continue
|
|
155
156
|
if req.allow_redirects and location and 300 <= status < 400:
|
|
156
157
|
raise TooManyRedirects(
|
|
@@ -290,7 +290,8 @@ class StealthBrowser:
|
|
|
290
290
|
args.append(f"--user-agent={ua}")
|
|
291
291
|
if self._proxy:
|
|
292
292
|
p = urlparse(self._proxy)
|
|
293
|
-
|
|
293
|
+
port_part = f":{p.port}" if p.port else ""
|
|
294
|
+
args.append(f"--proxy-server={p.scheme}://{p.hostname}{port_part}")
|
|
294
295
|
args.append("--host-resolver-rules=MAP * ~NOTFOUND , EXCLUDE 127.0.0.1")
|
|
295
296
|
if p.username:
|
|
296
297
|
self._proxy_creds = (p.username, p.password or "")
|
|
@@ -19,11 +19,15 @@ Supported collectors:
|
|
|
19
19
|
from .akamai import AkamaiSensor
|
|
20
20
|
from .datadome import DataDomeCollector
|
|
21
21
|
from .imperva import ImpervaCollector
|
|
22
|
+
from .kasada import KasadaCollector
|
|
22
23
|
from .perimeterx import PerimeterXCollector
|
|
24
|
+
from .shape import ShapeCollector
|
|
23
25
|
|
|
24
26
|
__all__ = [
|
|
25
27
|
"AkamaiSensor",
|
|
26
|
-
"PerimeterXCollector",
|
|
27
28
|
"DataDomeCollector",
|
|
28
29
|
"ImpervaCollector",
|
|
30
|
+
"KasadaCollector",
|
|
31
|
+
"PerimeterXCollector",
|
|
32
|
+
"ShapeCollector",
|
|
29
33
|
]
|
|
@@ -461,10 +461,11 @@ def audit(browser: str = "chrome136", *, timeout: float = 25.0,
|
|
|
461
461
|
prof = predict(browser)
|
|
462
462
|
is_chromium = any(x in prof.user_agent for x in ("Chrome/", "Edg/", "OPR/"))
|
|
463
463
|
has_priority = "priority" in regular
|
|
464
|
+
priority_ok = has_priority or not is_chromium
|
|
464
465
|
a.add("missing-headers",
|
|
465
|
-
|
|
466
|
+
priority_ok,
|
|
466
467
|
f"priority header {'present' if has_priority else 'absent'}, "
|
|
467
|
-
f"{'expected' if is_chromium else '
|
|
468
|
+
f"{'expected' if is_chromium else 'optional'} for this engine")
|
|
468
469
|
|
|
469
470
|
enc = values.get("accept-encoding", "")
|
|
470
471
|
decoded_ok = resp.status_code == 200 and bool(resp.content)
|
|
@@ -109,15 +109,15 @@ DEVICES: Dict[str, DeviceSpec] = {
|
|
|
109
109
|
),
|
|
110
110
|
"samsung_s24": DeviceSpec(
|
|
111
111
|
"Samsung Galaxy S24", 1080, 2340, 2.625, 412, 892,
|
|
112
|
-
"Adreno 740", 8, 8.0, "Linux
|
|
112
|
+
"Adreno 740", 8, 8.0, "Linux armv81", True,
|
|
113
113
|
),
|
|
114
114
|
"pixel_8": DeviceSpec(
|
|
115
115
|
"Google Pixel 8", 1080, 2400, 2.625, 412, 915,
|
|
116
|
-
"Mali-G715", 8, 8.0, "Linux
|
|
116
|
+
"Mali-G715", 8, 8.0, "Linux armv81", True,
|
|
117
117
|
),
|
|
118
118
|
"samsung_s23": DeviceSpec(
|
|
119
119
|
"Samsung Galaxy S23", 1080, 2340, 2.625, 412, 892,
|
|
120
|
-
"Adreno 730", 8, 8.0, "Linux
|
|
120
|
+
"Adreno 730", 8, 8.0, "Linux armv81", True,
|
|
121
121
|
),
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -265,7 +265,9 @@ class JSSandbox:
|
|
|
265
265
|
if isinstance(nd, _Call): return self._call(nd, sc)
|
|
266
266
|
if isinstance(nd, _Tern): return self._ev(nd.y, sc) if self._ev(nd.c, sc) else self._ev(nd.n, sc)
|
|
267
267
|
if isinstance(nd, _If):
|
|
268
|
-
for s in (nd.b if self._ev(nd.c, sc) else (nd.e or [])):
|
|
268
|
+
for s in (nd.b if self._ev(nd.c, sc) else (nd.e or [])):
|
|
269
|
+
self._ev(s, sc)
|
|
270
|
+
return None
|
|
269
271
|
if isinstance(nd, (_For, _Whl)): return self._loop(nd, sc)
|
|
270
272
|
if isinstance(nd, _Ret): raise _RetSig(self._ev(nd.v, sc) if nd.v else None)
|
|
271
273
|
if isinstance(nd, _Brk): raise _BrkSig()
|
|
@@ -369,9 +369,10 @@ def _normalize_platform(p: str) -> str:
|
|
|
369
369
|
|
|
370
370
|
def _generate_timing(rng: random.Random) -> PerformanceTiming:
|
|
371
371
|
connect = rng.randint(20, 80)
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
372
|
+
req_start = connect + rng.randint(1, 5)
|
|
373
|
+
ttfb = req_start + rng.randint(15, 200)
|
|
374
|
+
resp_end = ttfb + rng.randint(30, 150)
|
|
375
|
+
dom_int = resp_end + rng.randint(30, 300)
|
|
375
376
|
dcl = dom_int + rng.randint(30, 150)
|
|
376
377
|
dom_comp = dcl + rng.randint(400, 1500)
|
|
377
378
|
load_s = dom_comp + rng.randint(2, 20)
|
|
@@ -380,9 +381,9 @@ def _generate_timing(rng: random.Random) -> PerformanceTiming:
|
|
|
380
381
|
navigation_start=0,
|
|
381
382
|
connect_start=1,
|
|
382
383
|
connect_end=connect,
|
|
383
|
-
request_start=
|
|
384
|
+
request_start=req_start,
|
|
384
385
|
response_start=ttfb,
|
|
385
|
-
response_end=
|
|
386
|
+
response_end=resp_end,
|
|
386
387
|
dom_interactive=dom_int,
|
|
387
388
|
dom_content_loaded=dcl,
|
|
388
389
|
dom_complete=dom_comp,
|
|
@@ -88,11 +88,12 @@ class RateLimitMiddleware(Middleware):
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
class DedupeMiddleware(Middleware):
|
|
91
|
-
__slots__ = ("_window", "_seen")
|
|
91
|
+
__slots__ = ("_window", "_seen", "_lock")
|
|
92
92
|
|
|
93
93
|
def __init__(self, window_seconds: float = 60.0) -> None:
|
|
94
94
|
self._window = window_seconds
|
|
95
95
|
self._seen: dict[str, float] = {}
|
|
96
|
+
self._lock = threading.Lock()
|
|
96
97
|
|
|
97
98
|
@staticmethod
|
|
98
99
|
def _hash_request(request: dict) -> str:
|
|
@@ -108,14 +109,14 @@ class DedupeMiddleware(Middleware):
|
|
|
108
109
|
|
|
109
110
|
def process_request(self, request: dict) -> dict | None:
|
|
110
111
|
now = time.monotonic()
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
112
|
+
with self._lock:
|
|
113
|
+
expired = [k for k, ts in self._seen.items() if now - ts > self._window]
|
|
114
|
+
for k in expired:
|
|
115
|
+
del self._seen[k]
|
|
116
|
+
h = self._hash_request(request)
|
|
117
|
+
if h in self._seen:
|
|
118
|
+
return None
|
|
119
|
+
self._seen[h] = now
|
|
119
120
|
return request
|
|
120
121
|
|
|
121
122
|
|
|
@@ -50,9 +50,10 @@ def solve_sha256(challenge: bytes, difficulty: int, *,
|
|
|
50
50
|
remaining_bits = difficulty % 8
|
|
51
51
|
target_prefix = b"\x00" * prefix_bytes
|
|
52
52
|
|
|
53
|
-
rand_suffix = os.urandom(nonce_size - 8)
|
|
53
|
+
rand_suffix = os.urandom(max(0, nonce_size - 8))
|
|
54
54
|
for i in range(max_iterations):
|
|
55
|
-
|
|
55
|
+
counter = struct.pack(">Q", i)
|
|
56
|
+
nonce = (counter + rand_suffix)[:nonce_size] if nonce_size < 8 else counter + rand_suffix
|
|
56
57
|
h = hashlib.sha256(challenge + nonce).digest()
|
|
57
58
|
|
|
58
59
|
if h[:prefix_bytes] != target_prefix:
|
|
@@ -85,9 +86,10 @@ def solve_hmac_sha256(challenge: bytes, key: bytes, difficulty: int, *,
|
|
|
85
86
|
remaining_bits = difficulty % 8
|
|
86
87
|
target_prefix = b"\x00" * prefix_bytes
|
|
87
88
|
|
|
88
|
-
rand_suffix = os.urandom(nonce_size - 8)
|
|
89
|
+
rand_suffix = os.urandom(max(0, nonce_size - 8))
|
|
89
90
|
for i in range(max_iterations):
|
|
90
|
-
|
|
91
|
+
counter = struct.pack(">Q", i)
|
|
92
|
+
nonce = (counter + rand_suffix)[:nonce_size] if nonce_size < 8 else counter + rand_suffix
|
|
91
93
|
h = hmac.new(key, challenge + nonce, hashlib.sha256).digest()
|
|
92
94
|
|
|
93
95
|
if h[:prefix_bytes] != target_prefix:
|
|
@@ -270,8 +270,6 @@ def detect_ban(status: int, headers: dict, body: bytes) -> str | None:
|
|
|
270
270
|
if marker in sample:
|
|
271
271
|
return marker.decode(errors="replace").strip("/_ ")
|
|
272
272
|
|
|
273
|
-
if status in _BAN_STATUSES and status == 403:
|
|
274
|
-
return "forbidden"
|
|
275
273
|
return None
|
|
276
274
|
|
|
277
275
|
|
|
@@ -48,8 +48,8 @@ class SharedRateLimiter:
|
|
|
48
48
|
window = 1.0 / rps
|
|
49
49
|
stamps = self._timestamps.setdefault(domain, [])
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
cutoff = now -
|
|
51
|
+
purge_window = max(1.0, 1.0 / rps)
|
|
52
|
+
cutoff = now - purge_window
|
|
53
53
|
while stamps and stamps[0] < cutoff:
|
|
54
54
|
stamps.pop(0)
|
|
55
55
|
|
|
@@ -487,7 +487,7 @@ def test_exports_cdp_solver():
|
|
|
487
487
|
|
|
488
488
|
def test_exports_version():
|
|
489
489
|
import stealthhttp
|
|
490
|
-
assert stealthhttp.__version__ == "0.3.
|
|
490
|
+
assert stealthhttp.__version__ == "0.3.1"
|
|
491
491
|
|
|
492
492
|
|
|
493
493
|
# -----------------------------------------------------------------------
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|