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)

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.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wafsolver-0.0.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file wafsolver-0.0.0.tar.gz.

File metadata

  • Download URL: wafsolver-0.0.0.tar.gz
  • Upload date:
  • Size: 11.8 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

Hashes for wafsolver-0.0.0.tar.gz
Algorithm Hash digest
SHA256 e3e05ac0d0b4c449a1b42e5f00c7f25ccd27ff75269fb8ddcf196d21125ebbf2
MD5 193f0a3ef71b446bad230facf5ac2add
BLAKE2b-256 2e42ddea4b2f3ea3b95aa75db74d00eec3ed33897a4925a246a8805a3349357f

See more details on using hashes here.

File details

Details for the file wafsolver-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: wafsolver-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 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

Hashes for wafsolver-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68cbafb0c482b7a891d2b1494bd547b1c46caf1b2ee9e43d5458d0a0ef150559
MD5 fc00bff0db18d386af1f473f21a47891
BLAKE2b-256 c24f16490827a85622655ec906731303864e4122835c1ac6fc4ee8531e1dbb78

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page