Skip to main content

wafsolver

PyPI version CI

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)

Metadata

Release files for wafsolver 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wafsolver 0.0.1
File Size Uploaded
wafsolver-0.0.1.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wafsolver 0.0.1
File Interpreter ABI Platform
wafsolver-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.6 kB

Release files / wafsolver-0.0.1.tar.gz

Download URL wafsolver-0.0.1.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
34c7892af5b0a23a0144cade049d502857bbbfc06ec8c9cd2dd0cf103631c494
BLAKE2b-256 checksum
How to use checksums
39be2a9f5a2acb474d22bf5e8523cad4ca0c935a932afaf336de7028ca70d3b8
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / wafsolver-0.0.1-py3-none-any.whl

Download URL wafsolver-0.0.1-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ce921636d40254633cfedb81a6e77373944b219e90d319e197828923df4a812
BLAKE2b-256 checksum
How to use checksums
1e64560b9a8f180dd4a680be471f4e8a9942de6d4043e399f170a2c274e3c259
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page