HUB
Sign inSign up
darkweb-telebot logo

credkellar/darkweb-telebot

By credkellar

โ€ขUpdated 3 days ago

DarkWeb-TeleBot by Darion Kellar: Tor OSINT and threat-intel monitoring with Telegram alerts, dedup.

Image
Networking
Security
Monitoring & observability
1

212

credkellar/darkweb-telebot repository overview

โ DarkWeb-TeleBot ๐Ÿ•ต๏ธ๐Ÿ“ก

Automated Threat Intel & OSINT Monitoring, delivered to Telegram.

DarkWeb-TeleBot polls configured threat-intelligence and OSINT sources through a Tor proxy sidecar, removes duplicate findings, and dispatches alerts to an authorized Telegram admin chat. It also reports its own health, so you know when the pipeline is down and when it recovers.

Python Docker Tests


โ โœจ Features

  • ๐Ÿง… Tor proxy sidecar โ€” all source traffic routed through an isolated Tor container (dperson/torproxy) on an internal-only Docker network; only the proxy has egress
  • ๐Ÿ“ก Feed monitoring โ€” pluggable source modules (sources/feed_monitor.py) for collecting new items from public feeds and optional Tor-routed sources for custom brand, domain, or keyword mentions
  • ๐Ÿ—„๏ธ Deduplication engine โ€” PostgreSQL 15-backed dedup (dedup.py) so the same finding is never alerted twice, with Redis 7 alongside for worker state
  • ๐Ÿ” Resilient poller โ€” configurable poll interval (default 300s) with exponential backoff (base 5s, cap 60s) on repeated failures (poller.py)
  • ๐Ÿ›‘ Graceful shutdown โ€” handles SIGINT and SIGTERM and stops cleanly
  • ๐Ÿ” Admin-only access โ€” the bot answers only authorized admin users; everyone else gets Access denied. Unauthorized entity.
  • ๐Ÿ’“ Self-health reporting โ€” failure alerts, recovery notices, and periodic status summaries (status.py)
  • ๐Ÿงช CI โ€” GitHub Actions runs the test suite on every push

โ ๐Ÿ—๏ธ Architecture

            +---------------------------+
            |        Telegram Bot       |  <- /start, /status (admin only)
            |   bot.py / bot/main.py    |
            +-------------+-------------+
                          ^
                          | alerts + status
+-------------------------+--------------------------+
|                    Worker pipeline                 |
|  poller.py -> worker.py -> dedup.py -> status.py   |
+------------+--------------------+------------------+
             |                    |
             v                    v
   +------------------+   +------------------+
   |  tor-proxy       |   |  db (Postgres 15)|
   |  (sidecar)       |   |  dedup storage   |
   +------------------+   +------------------+
NetworkTypePurpose
tor_internalinternalIsolated link between services and Tor proxy
egress_netbridgeOutbound access for the Tor proxy only

Persistent volumes: postgres_data, tor_data. Services: tor-proxy, db (Postgres 15-alpine), redis (7-alpine), crawler-worker, telebot-core.

โ ๐Ÿš€ Quick start

git clone https://github.com/kimanicollier44-cmyk/DarkWeb-TeleBot.git
cd DarkWeb-TeleBot

cp env.example .env
# edit .env with your values

docker compose up -d --build
docker compose logs -f

Stop: docker compose down

Run locally (without Docker) โ€” still needs a reachable Tor proxy and PostgreSQL:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python bot.py

โ โš™๏ธ Configuration

Copy env.example to .env โ€” treat env.example as the source of truth. Typical settings:

VariableDescription
BOT_TOKENTelegram bot token from @BotFather
ADMIN_IDSAuthorized Telegram user ID(s)
CHAT_IDChat that receives alerts and status updates
DATABASE_URLPostgreSQL connection string
TOR_PROXYTor SOCKS proxy address
POLL_INTERVAL_SECSeconds between polling cycles (default 300)

In Compose, secrets are kept out of the image as files: ./secrets/db_password.txt, ./secrets/bot_token.txt, ./secrets/admin_ids.txt.

โ ๐Ÿค– Bot commands

CommandAccessDescription
/startAdminConfirms the bot is active: "Security Core Active. Use /status for pipeline health."
/statusAdminPipeline health: Tor proxy sidecar, DB deduplication engine, scraper workers

โ ๐Ÿ’“ Monitoring & status alerts

status.py sends three kinds of Telegram messages to the configured chat:

  • Failure alert โ€” when polling cycles fail consecutively
  • Recovered โ€” when the pipeline recovers, with prior failed attempts and the last error
  • Status Summary โ€” periodic report with uptime, poll cycles, alerts dispatched, and current failures

โ ๐Ÿณ Docker image

Multi-stage build on python:3.12-slim: dependencies are built in a builder stage, then copied into a lean runtime. The container runs non-root (10001:10001), read_only, with cap_drop: ALL in Compose.

โ ๐Ÿงช Testing

python -m unittest discover tests

Tests cover the dedup engine, the polling/backoff loop, and status reporting, and run automatically in CI.

โ ๐Ÿ”’ Security notes

  • The Tor proxy runs on an internal Docker network; only the proxy has egress
  • Never commit your .env file, secrets files, or bot token
  • Restrict ADMIN_IDS to people you trust
  • Use this tool only for lawful security research, threat-intelligence, and defensive monitoring, and respect the terms and laws that apply to the sources you monitor

DarkWeb-TeleBot by Darion Kellar โ€” modular Python Telegram bot for automated OSINT and threat-intelligence monitoring.

Tag summary
Recent tags
Content type
Image
Digest
sha256:fdf57541fโ€ฆ
Size
66.7 MB
Last updated
3 days ago
docker pull credkellar/darkweb-telebot:latest