A modern Python 3 successor to ADHDproject/spidertrap — traps web crawlers and spiders in an infinite maze of dynamically generated pages.
| ADHDproject/spidertrap | This project | |
|---|---|---|
| Runtime | Python 2 | Python 3 |
| Logging | None | Integrated — stdout + file |
| Docker | No | Multi-arch (amd64, arm64, arm/v7, arm/v6, 386, ppc64le, s390x) |
| Maintenance | Archived | Active |
| Distribution | Source only | Docker Hub + GHCR |
Every request is seeded by the URL path, so links are infinite but deterministic — the same URL always returns the same page. Crawlers follow links forever, consuming bandwidth and CPU while getting nowhere.
docker run --rm --name spidertrap -v .:/log -p 80:80 justsky/spidertrapdocker run --rm --name spidertrap -v .:/log -p 80:80 ghcr.io/just5ky/spidertrap:latestservices:
spidertrap:
image: justsky/spidertrap
restart: unless-stopped
ports:
- "80:80"
volumes:
- .:/logBrowse to http://127.0.0.1 — each page renders randomly generated links that lead to more pages without end.
Mount a host directory to /log and access logs are written to spidertrap.log in Apache Combined Log Format:
1.2.3.4 - - [21/May/2022 09:59:55] "GET /yf/XhuQwxZqdZwFG_6_U HTTP/1.1" 200 - "https://example.com/" "Mozilla/5.0 (compatible; Googlebot/2.1)"
1.2.3.4 - - [21/May/2022 09:59:56] "GET /favicon.ico HTTP/1.1" 200 - "-" "wget/1.21.3"
Logs also stream to stdout (visible via docker logs spidertrap).
Pass a file of URLs (one per line) to serve real-looking links instead of random strings:
# bare Python
python3 spidertrap.py urls.txt
# Docker
docker run --rm --name spidertrap \
-v .:/log \
-v ./urls.txt:/spidertrap/urls.txt \
-p 80:80 \
justsky/spidertrap urls.txtsudo wget -m http://127.0.0.1Wget runs indefinitely until killed.
git clone https://github.com/just5ky/spidertrap
cd spidertrap
docker build -t spidertrap .linux/amd64 · linux/arm64 · linux/arm/v7 · linux/arm/v6 · linux/386 · linux/ppc64le · linux/s390x
- ENV var configuration (
PORT,DELAY,LINKS_PER_PAGE) — no source edits needed in Docker - CLI flags (
--port,--delay,--file) replacing hardcoded constants -
robots.txthoneypot — serveAllow: /to actively invite crawlers -
sitemap.xmlwith infinite entries — amplify trap surface - Realistic HTML — fake titles, meta tags, body text to evade trap-detection heuristics
-
/metricsPrometheus endpoint — request counts and unique IPs - Dockerfile
HEALTHCHECK
See CONTRIBUTING.md.
See SECURITY.md.