Skip to content

anand87794/Discord_Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– OffSecMentor - AI-Powered Security Learning Assistant

OffSec Community AI Challenge 2025 Submission
An intelligent Discord bot that combines Google Gemini AI, Groq AI, and PayloadsAllTheThings to create an interactive cybersecurity learning platform.

Discord Python AI PayloadsAllTheThings


🎯 What It Does

OffSecMentor is a Discord bot that helps cybersecurity learners, pentesters, and bug bounty hunters by:

  • πŸ“š Instant Payload Access - Fetches real-world payloads from PayloadsAllTheThings (50+ vulnerability categories)
  • πŸŽ“ AI Study Plans - Generates personalized learning roadmaps for any security topic
  • 🧠 Interactive Quizzes - Tests knowledge with MCQ-style security quizzes
  • πŸ“‹ Quick Cheatsheets - Provides copy-paste ready payload references
  • πŸ—ΊοΈ Pentest Methodologies - Step-by-step guides for web/network/API pentesting
  • πŸ’¬ Context-Aware Chat - Remembers conversation history for natural follow-ups
  • ⚑ Dual AI Fallback - Uses Gemini (primary) + Groq (backup) for 99.9% uptime

πŸ† Why This Helps the OffSec Community

Problem It Solves:

  1. Scattered Resources - Security payloads are spread across multiple repos/sites
  2. Learning Curve - Beginners don't know where to start or what to learn next
  3. No Interactive Practice - Most resources are static documentation
  4. Context Switching - Constantly switching between Discord, browser, notes

How OffSecMentor Helps:

  • βœ… All-in-One - Payloads, learning plans, quizzes in Discord (where community already is)
  • βœ… AI-Powered - Smart responses tailored to your question, not generic docs
  • βœ… Interactive - Quizzes, chat memory, and real-time payload generation
  • βœ…- Always Available - Dual AI ensures bot never goes down due to rate limits

πŸš€ Features

1. πŸ“š Payload Library (50+ Topics)

!payload SQL Injection
!payload XSS
!cheatsheet SSRF
  • Fetches from PayloadsAllTheThings in real-time (no local download)
  • AI-enhanced explanations with actual working payloads
  • Color-coded rich embeds for visual clarity

2. πŸŽ“ AI Study Planner

!studyplan web hacking 7
!studyplan bug bounty 14
  • Generates day-by-day learning roadmaps
  • Includes resources, tools, and practice tasks
  • Customizable duration (1-30 days)

3. 🧠 Interactive Security Quizzes

!quiz SQL Injection
!quiz OWASP Top 10
  • 5 MCQ questions per topic
  • React with emoji to answer (πŸ…°οΈ πŸ…±οΈ ©️ πŸ‡©)
  • Instant feedback with explanations

4. πŸ“‹ Quick Reference Cheatsheets

!cheatsheet XSS
!cheatsheet Command Injection
  • Compact, copy-paste ready payloads
  • No fluff, just code blocks
  • Perfect for quick reference during CTFs

5. πŸ—ΊοΈ Pentest Methodology Guides

!methodology web
!methodology network
  • Step-by-step pentest workflows
  • Recon β†’ Scanning β†’ Exploitation β†’ Post-Exploitation
  • Includes tools and techniques for each phase

6. 🎯 CTF Challenge Solver

!ctf "Found admin login, tried SQL injection but WAF blocking"
!ctf "File upload allows .php but executes as text"
  • AI analyzes your CTF challenge
  • Identifies vulnerability type automatically
  • Fetches relevant payloads from PayloadsAllTheThings
  • Provides step-by-step solving strategy
  • Recommends tools and bypass techniques

7. πŸ’¬ Context-Aware Conversations

User: What is SQL injection?
Bot: [explains SQL injection]
User: Show me bypass techniques
Bot: [knows you're asking about SQL injection bypasses]
  • Remembers last 10 messages per channel
  • 30-minute memory timeout
  • Natural follow-up questions

8. 🌐 Live CVE/Exploit Database

!cve CVE-2021-44228
!cve_search apache log4j
!latest_cves 5
!exploit log4j
!poc CVE-2021-44228
  • Real-time CVE data from NVD (National Vulnerability Database)
  • Color-coded severity embeds (πŸ”΄ Critical, 🟠 High, 🟑 Medium, 🟒 Low)
  • CVSS score with visual bar indicator
  • Exploit/PoC search via GitHub
  • Affected products, CWE, references
  • Smart rate limiting with 24hr cache
  • 50 requests/30s with API key

9. πŸ•΅οΈ Reconnaissance Tools

!whois google.com
!dnslookup google.com
!techstack google.com
!recon google.com
  • WHOIS: Domain ownership, registrar, dates, name servers
  • DNS Lookup: A, AAAA, MX, NS, TXT, CNAME, SOA records
  • Tech Stack: Server, CDN, CMS, frontend/backend, security headers, SSL info
  • Full Recon: All three combined with 3 rich embeds
  • No API keys needed β€” all free and direct

πŸ€– How AI is Used

Dual AI Architecture

User Query
    ↓
🟒 Try Gemini 2.0 Flash (Primary)
    ↓ Success β†’ Response
    ↓ Rate Limit/Error
🟑 Fallback to Groq Llama 3.3 70B
    ↓
βœ… Response Delivered

AI Enhancements:

  1. Payload Summarization - Converts raw markdown into structured, readable responses
  2. Study Plan Generation - Creates personalized learning roadmaps based on topic
  3. Quiz Creation - Generates contextual MCQ questions with explanations
  4. Methodology Synthesis - Transforms documentation into actionable step-by-step guides
  5. Context Understanding - Uses chat memory for follow-up questions

Why Dual AI?

  • Gemini - Best quality, but has rate limits (1500 req/day free tier)
  • Groq - Super fast, generous limits (14,400 req/day), good quality
  • Result - Bot never goes down, always responds

πŸ“¦ Installation & Setup

Prerequisites

Quick Start

  1. Clone the repository
git clone <your-repo-url>
cd bot
  1. Install dependencies
pip install -r requirements.txt
  1. Configure environment variables Create a .env file:
DISCORD_TOKEN=your_discord_bot_token
GEMINI_API_KEY=your_gemini_api_key
GROQ_API_KEY=your_groq_api_key
GITHUB_TOKEN=your_github_token  # Optional
  1. Run the bot
python bot.py
  1. Invite bot to your Discord server Use the OAuth2 URL from Discord Developer Portal with these permissions:
  • Send Messages
  • Embed Links
  • Add Reactions
  • Read Message History

πŸ“– Command Reference

Command Description Example
!payload <topic> Get payloads for a vulnerability !payload SQL Injection
!topics List all 50+ available topics !topics
!cheatsheet <topic> Quick payload reference !cheatsheet XSS
!cve <CVE-ID> Get detailed CVE information !cve CVE-2021-44228
!cve_search <keyword> Search CVEs by keyword !cve_search apache log4j
!latest_cves [count] Get latest published CVEs !latest_cves 5
!exploit <keyword> Search exploits/PoCs !exploit log4j
!poc <CVE-ID> Find PoC exploits for CVE !poc CVE-2021-44228
!whois <domain> WHOIS domain lookup !whois google.com
!dnslookup <domain> DNS records lookup !dnslookup google.com
!techstack <domain> Technology detection !techstack google.com
!recon <domain> Full recon (WHOIS+DNS+Tech) !recon google.com
!studyplan <topic> [days] Generate AI study plan !studyplan web hacking 7
!quiz <topic> Interactive security quiz !quiz OWASP Top 10
!methodology [type] Pentest methodology guide !methodology web
!ctf <challenge> CTF challenge solver !ctf Found admin panel, can't login
!ask <question> Ask anything (auto-includes payloads) !ask How does SSRF work?
@Bot <message> Chat with context memory @OffSecMentor explain XSS
!aihelp Show all commands !aihelp

🎨 Screenshots

Rich Embedded Responses

Payload Response Color-coded embeds with icons, source links, and AI model attribution

Study Plan Generation

Study Plan Personalized day-by-day learning roadmap

Interactive Quiz

Quiz MCQ questions with emoji reactions


πŸ—οΈ Technical Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Discord User                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Discord Bot (bot.py)                       β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚  Command Handler + Chat Memory + Embeds        β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
              β”‚                      β”‚
              β–Ό                      β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ cheatsheet_module.pyβ”‚   β”‚   Dual AI Engine         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ Unified Repos β”‚  β”‚   β”‚  β”‚ Gemini (Primary)   β”‚  β”‚
β”‚  β”‚ + Fallback    β”‚  β”‚   β”‚  β”‚ Groq (Fallback)    β”‚  β”‚
β”‚  β”‚ Search        β”‚  β”‚   β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Components:

  • bot.py - Main Discord bot logic, commands, embeds, chat memory
  • cheatsheet_module.py - Unified multi-repo payload fetcher (PayloadsAllTheThings + others)
  • fallback_search.py - Fallback engine using Google Dork scraping + GitHub Search API
  • Dual AI - Gemini + Groq with automatic fallback
  • Chat Memory - Per-channel conversation context (10 messages, 30min timeout)

πŸ”’ Security & Privacy

  • βœ… No Data Storage - Bot doesn't store user messages permanently
  • βœ… Read-Only GitHub Access - Only fetches public PayloadsAllTheThings content
  • βœ… API Key Security - All keys in .env (never committed to Git)
  • βœ… Educational Purpose - All payloads are for authorized security testing only

🀝 Contributing

This bot was created for the OffSec Community AI Challenge 2025. Contributions welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments


πŸ“ž Contact & Demo

  • GitHub
  • Discord
  • OffSec Account

πŸ† OffSec AI Challenge 2025

Submission for: Build with AI - MCPs for the Community
Category: Discord Helper Bot + AI Study Planner
Impact: Helps OffSec learners access payloads, create study plans, and practice interactively - all within Discord
AI Usage: Dual AI (Gemini + Groq) for payload summarization, study plan generation, quiz creation, and context-aware chat


Built with ❀️ for the OffSec Community

Making security learning accessible, interactive, and AI-powered

"# Discord_Bot"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages