wafsolver
Solve AWS WAF JavaScript challenges without a browser.
Note: intended for accessing sites you are allowed to access programmatically.
Install
pip install wafsolver
Use
import requests
import wafsolver
DOMAIN = "example.com"
URL = f"https://{DOMAIN}/"
session = requests.Session()
res = session.get(URL)
if wafsolver.is_challenged(res.headers):
token = wafsolver.solve_challenge(DOMAIN, res.text)
session.cookies.set(wafsolver.TOKEN_COOKIE, token, domain=DOMAIN)
res = session.get(URL)
print(res.status_code, len(res.text))
Reuse one solver when you need several tokens, or want to refresh one:
from wafsolver import WafSolver
solver = WafSolver("example.com")
token = solver.solve(challenge_html)
refreshed = solver.solve(challenge_html, existing_token=token)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wafsolver-0.0.1.tar.gz
(12.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
wafsolver-0.0.1-py3-none-any.whl
(12.6 kB
view details)
File details
Details for the file wafsolver-0.0.1.tar.gz.
File metadata
- Download URL: wafsolver-0.0.1.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34c7892af5b0a23a0144cade049d502857bbbfc06ec8c9cd2dd0cf103631c494
|
|
| MD5 |
287673d345644ceb7538d0fd7a745abb
|
|
| BLAKE2b-256 |
39be2a9f5a2acb474d22bf5e8523cad4ca0c935a932afaf336de7028ca70d3b8
|
File details
Details for the file wafsolver-0.0.1-py3-none-any.whl.
File metadata
- Download URL: wafsolver-0.0.1-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ce921636d40254633cfedb81a6e77373944b219e90d319e197828923df4a812
|
|
| MD5 |
d54f5b1de1715a87e31e83711a4c1b9d
|
|
| BLAKE2b-256 |
1e64560b9a8f180dd4a680be471f4e8a9942de6d4043e399f170a2c274e3c259
|