-
Notifications
You must be signed in to change notification settings - Fork 0
ADR 002 ghost mode
grave0x edited this page Jul 19, 2026
·
1 revision
Accepted
2026-07-19
API scanners are easily detected and blocked by WAFs, rate limiters, and bot detection services. rapiscm needed a stealth mode that:
- Avoids fingerprinting by rotating User-Agent across real browser strings
- Randomizes request timing to avoid pattern detection
- Randomizes Accept/Accept-Language/Accept-Encoding headers
- Supports proxy rotation to distribute requests across IPs
- Maintains a cookie jar for session consistency
- Can be enabled with a single
--ghostflag
Create a dedicated ghost.rs module with GhostConfig and GhostState structs.
GhostConfig holds static configuration (enabled, jitter percentage, UA mode, proxy list).
GhostState holds runtime state (RNG, rotation counters).
Ghost state is threaded through the scan pipeline:
-
build_client()applies ghost proxy + UA to the reqwest Client -
ghost_headers()generates randomized Accept/Accept-Language/Encoding headers per request -
ScanRunnerapplies jitter (±jitter_pct%) to rate delay - Proxy rotation uses round-robin through
--proxy-rotatelist
UA rotation supports modes: desktop (6 UAs), mobile (2 UAs), random (any from pool).
- Pros: Simpler implementation
- Cons: Can't round-robin proxies; harder to debug
- Rejected: GhostState adds minimal complexity for significant debugging benefit
- Pros: Zero code
- Cons: Not portable, adds deploy dependency, can't rotate per-request
- Rejected: Native rotation is more reliable and cross-platform
- Pros: Strong anonymity
- Cons: Requires TOR daemon, slow, overkill for API scanning
- Rejected: Proxy rotation is sufficient for WAF evasion
- No new dependencies (uses existing
randcrate) - Ghost mode adds ~0.5-2ms overhead per request (RNG call)
- Proxy rotation works with HTTP, HTTPS, and SOCKS5 proxies
- Jitter applied on top of rate limit (target rate is approximate with jitter)
Powered by rapiscm