Skip to content

kOaDT/cyber-bot

Repository files navigation

Cyber Bot

Logo

GitHub stars GitHub forks

Version Node.js License: CC BY-NC 4.0 Telegram Mistral AI Claude AI

About

Cyber Bot is a Node.js project that helps users enhance their cybersecurity skills through automated Telegram messages. The bot runs on a VPS (OVH) and leverages AI (Mistral or Claude) to generate cybersecurity-related content.

Community

Features

Daily TryHackMe Reminders

npm run cron -- -c sendTHM

TryHackMe Challenges

npm run cron -- -c sendTHMCTF

AI-Enhanced Study Notes

Sends curated notes from a GitHub repository, enhanced by AI.

npm run cron -- -c sendGithubNotes

Cybersecurity News Digest

Aggregates and summarizes news from our curated RSS feed.

npm run cron -- -c sendNewsResume

CVE Updates

Fetches and analyzes the latest CVE (Common Vulnerabilities and Exposures) entries.

npm run cron -- -c sendCve

Using https://nvd.nist.gov/developers/vulnerabilities

Darknet Diaries Podcast Summaries

Provides summaries of the latest Darknet Diaries podcast episodes.

npm run cron -- -c sendDarknetDiariesResume

Snyk Podcast Summaries

Provides summaries of the latest Snyk podcast episodes.

npm run cron -- -c sendSnykResume

Security Now Podcast Summaries

Provides summaries of the latest Security Now podcast episodes.

npm run cron -- -c sendSecurityNowResume

The Cyber Show Podcast Summaries

Provides summaries of the latest The Cyber Show podcast episodes.

npm run cron -- -c sendCyberShowResume

Reddit Content

Fetches and summarizes posts from specified cybersecurity subreddit.

npm run cron -- -c sendRedditPost

YouTube Content

Summarizes the latest videos from specified channels.

npm run cron -- -c sendYoutubeResume -y https://www.youtube.com/[channel-name]

Curated Shorts

Shares relevant short-form videos based on customizable parameters (search period, queries, and blacklisted terms). Configure settings in the sendShort.js script.

npm run cron -- -c sendShort

Getting Started

Prerequisites

Installation

  1. Clone and Initialize
git clone git@github.com:kOaDT/cyber-bot.git
cd cyber-bot

# Create tracking files
mkdir -p assets
touch assets/processedNotes.json       # GithubNotes tracking
touch assets/processedArticles.json    # News tracking
touch assets/processedShorts.json      # Shorts tracking
touch assets/processedDD.json          # Darknet Diaries Podcast tracking
touch assets/processedSnyk.json        # Snyk Podcast tracking
touch assets/processedYt.json          # YouTube tracking
touch assets/processedReddit.json      # Reddit post tracking
touch assets/processedCTF.json         # CTF tracking
touch assets/processedSecurityNow.json # Security Now Podcast tracking
touch assets/processedCyberShow.json   # The Cyber Show Podcast tracking
  1. Install Dependencies
npm install
  1. Configure Environment

Create a .env file with the following variables:

# GitHub Settings
GITHUB_SECRET=
GITHUB_USERNAME=
GITHUB_REPO=
# Optional
EXCLUDED_GITHUB_FILES=

# Telegram Settings
TELEGRAM_BOT_TOKEN=
CHAT_ID=
# Optional Topic IDs for message organization
TELEGRAM_TOPIC_THM=
TELEGRAM_TOPIC_NEWS=
TELEGRAM_TOPIC_YOUTUBE=
TELEGRAM_TOPIC_PODCAST=
TELEGRAM_TOPIC_GITHUB=
TELEGRAM_TOPIC_REDDIT=
TELEGRAM_TOPIC_CVE=

# AI Provider Settings
AI_PROVIDER=mistral            # Choose: 'mistral' (default) or 'claude'

# Mistral AI Settings (required if AI_PROVIDER=mistral)
MISTRAL_API_KEY=
# Optional Mistral parameters
MISTRAL_MODEL=mistral-large-2411
MISTRAL_TEMPERATURE=0.1
MISTRAL_MAX_TOKENS=2000

# Claude AI Settings (required if AI_PROVIDER=claude)
CLAUDE_API_KEY=
# Optional Claude parameters
CLAUDE_MODEL=claude-opus-4-20250514
CLAUDE_TEMPERATURE=0.1
CLAUDE_MAX_TOKENS=2000

# Optional, comma-separated
AUTHORIZED_LANGUAGES=

# AssemblyAI - Text-to-Speech
ASSEMBLYAI_API_KEY=

# YouTube Settings
YOUTUBE_API_KEY=

# Reddit
REDDIT_SUBREDDITS=
REDDIT_DAYS_LOOKBACK=
REDDIT_CLIENT_ID=
REDDIT_CLIENT_SECRET=

# CVE
CVSS_SEVERITY_THRESHOLD=   # Default >= 7.0
HOURS_DELAY=               # Default 24 hours
ENABLE_CVE_STATS=false     # Enable historical stats (requires Cve table in DB)

# Optional Database Settings
MYSQL_HOST=
MYSQL_USER=
MYSQL_PASSWORD=
MYSQL_DATABASE=
I_WANT_TO_SAVE_MESSAGES_IN_DB=true # Enable message logging in database

# Optional Slack Logging
SLACK_LOGGING_ENABLED=false # Set to true to enable Slack log forwarding
SLACK_WEBHOOK_URL_INFO=     # Webhook URL for info level logs
SLACK_WEBHOOK_URL_WARN=     # Webhook URL for warn level logs
SLACK_WEBHOOK_URL_ERROR=    # Webhook URL for error level logs

Note: This project is designed to work without a database by default. However, you can enable message logging in a MySQL database by setting I_WANT_TO_SAVE_MESSAGES_IN_DB=true and configuring the database connection variables defined in /config/dbConfig.js. The database should contain a TelegramLogs table with at least two columns: message and dateAdd. This feature uses the mysql2 package.

Note: CVE statistics (historical trends, year-over-year comparisons) require a Cve table in your database with columns: cveId, cvss, published. Set ENABLE_CVE_STATS=true to enable this feature. Without it, the CVE report shows only the daily summary.

Note: Slack logging is optional and disabled by default. To enable it, set SLACK_LOGGING_ENABLED=true and provide the appropriate webhook URLs for each log level (info, warn, error). If a webhook URL is missing for a specific level, logs of that level will still be logged locally but won't be sent to Slack. Slack webhook failures are handled gracefully and won't affect the application's operation.

  1. Optional: Customize AI provider parameters
/crons/config/providers/mistral.js  # Mistral configuration
/crons/config/providers/claude.js   # Claude configuration
  1. Optional: Modify bot prompts
/crons/utils/prompts

Usage

Basic Command

npm run cron -- -c <CRON_NAME>

With Language Specification

npm run cron -- -c <CRON_NAME> -l <language>

Note: Content language is restricted by the AUTHORIZED_LANGUAGES environment variable to avoid prompt injection. Default is English.

Deployment

The project includes a versioned deployment script at scripts/deploy.sh. On push to main, the CI pipeline:

  1. Runs tests and checks coverage
  2. Copies scripts/deploy.sh to the VPS via SCP
  3. Executes the script remotely via SSH

The deploy script performs:

  • Branch validation (ensures main is checked out)
  • Fast-forward-only git pull origin main
  • Production dependency install (npm ci --omit=dev)

Required GitHub secrets: VPS_HOST, VPS_USERNAME, VPS_SSH_KEY.

Contributing

We welcome contributions! Feel free to:

  • Report issues
  • Submit pull requests
  • Suggest new features

License

This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).

This means you are free to share and adapt this work for non-commercial purposes, as long as you provide appropriate attribution. More information: LICENSE

License: CC BY-NC 4.0


Made by kOaDT

About

Cyber Bot is an Node.js project that helps users improve their cybersecurity skills through scheduled Telegram messages.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors