PoW anti-crawler middle-proxy https://meso.zoai.re/
Find a file
2025-03-31 22:29:43 +02:00
src Challenge 2025-03-31 22:29:43 +02:00
.gitignore Initial commit 2025-03-29 22:15:07 +01:00
Cargo.lock Challenge 2025-03-31 22:29:43 +02:00
Cargo.toml Challenge 2025-03-31 22:29:43 +02:00
README.md Challenge 2025-03-31 22:29:43 +02:00
rustfmt.toml Initial commit 2025-03-29 22:15:07 +01:00

Mesozoa

Why not Anubis? Because it provides no build instructions and only supports Docker.

Why not using Realm completely? Because the hook system is useless and only allows filtering.

Install

Must be used behind a reverse proxy providing X-Forwarded-For.

Challenge protocol

Challenge generation

Sent by the server as a cookie.

secret <- chosen randomly, long term

salt <- chosen randomly, not stored

timestamp <- UNIX time in seconds, 64 bits, big endian

ua <- User-Agent from request header

ip <- X-Forwarded-For from request header (client's IP)

set-cookie: mesozoa-challenge=BASE64(salt || timestamp || SHA3-256(secret || salt || timestamp || ip || "/" || ua))

Where BASE64 is unpadded.

Challenge verification

Request must contain both cookies mesozoa-challenge and mesozoa-proof.

Security

Network handling and HTTP parsing

This implementation uses cheap tricks and regexes, is probably not fully compliant to HTTP specs, etc. You should probably not expose it directly to an open network. Please use it behind a safer reverse proxy like Apache or Nginx.

Length-extension attack

SHA3 (used as a MAC in the challenge cookie) is not vulnerable. Values in the hash are either fixed-length, safe, or delimited.