Skip to content

edycutjong/botcarbon

Repository files navigation

🌍 BotCarbon

Quantifying the carbon cost of cyber attacks β€” turning cybersecurity into a verifiable ESG metric.

Live Demo Demo Video HackOWASP 8.0 DoraHacks BUIDL

SDG 13 (Climate Action) Γ— Cybersecurity | April 18–19, 2026


πŸ“Έ See It in Action

Live Attack Dashboard β€” Real-time traffic monitoring under DDoS attack:

Live Attack Dashboard

Shield OFF β€” Attack traffic consuming wasted compute:

Shield OFF Mode

Carbon Formula β€” Transparent methodology: 1 req = 0.12g COβ‚‚

Carbon Formula Tooltip

Attack Origins β€” Geographic threat intelligence with intensity-scaled pulses:

Attack Origins Map

Threat Log β€” Terminal-style live stream of attack events:

Threat Log

Idle State β€” Clean dashboard when no attack is in progress:

Idle Dashboard

πŸ’‘ The Problem

Nobody tracks the carbon footprint of cyber attacks.

  • A single DDoS attack can consume 150+ kWh of wasted server compute
  • Global bot traffic accounts for 30-40% of all internet requests
  • This invisible energy waste generates millions of tons of COβ‚‚ annually

πŸ›‘οΈ The Solution

BotCarbon is a real-time SOC dashboard that:

  1. Quantifies the energy wasted by malicious bot traffic (kWh per request)
  2. Visualizes the carbon impact with live charts and equivalency metrics
  3. Demonstrates the environmental benefit of edge protection (Cloudflare)
  4. Proves that cybersecurity IS sustainability

The "fix" for a bad BotCarbon score is literally: "Route through Cloudflare."

πŸ–₯️ Dashboard Features

Feature Description
Traffic Monitor Real-time area chart showing blocked vs. passed attack traffic
Carbon Gauge Live COβ‚‚ savings counter with equivalency comparisons
Shield Toggle Enable/disable Cloudflare Edge Shield in real-time
Attack Map Geographic threat origins with intensity-scaled pulses
Threat Log Terminal-style live stream of attack events
Formula Tooltip Transparent methodology: 1 req = 0.12g COβ‚‚

πŸ“ The Math

Energy per request:     0.0003 kWh (SWD Model)
Grid emission factor:   0.400 kg COβ‚‚/kWh (US average)
COβ‚‚ per blocked req:    0.12g

β†’ 1,000,000 blocked requests = 120 kg COβ‚‚ prevented
β†’ Equivalent to driving 292 miles πŸš—

Source: Sustainable Web Design Model (SWD), DIMPACT Project

πŸ—οΈ Architecture

Architecture Diagram

πŸ“ File Structure

botcarbon/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                # Next.js 16 App Router
β”‚   β”‚   β”œβ”€β”€ layout.tsx      # Root layout (fonts, metadata, SEO)
β”‚   β”‚   β”œβ”€β”€ page.tsx        # Main SOC dashboard page
β”‚   β”‚   └── globals.css     # Design system (glassmorphism, glow, grid)
β”‚   β”œβ”€β”€ components/         # 8 dashboard components
β”‚   β”‚   β”œβ”€β”€ TrafficChart    # Real-time Recharts area chart
β”‚   β”‚   β”œβ”€β”€ CarbonGauge     # COβ‚‚ savings + equivalencies
β”‚   β”‚   β”œβ”€β”€ ShieldToggle    # Cloudflare edge toggle
β”‚   β”‚   β”œβ”€β”€ AttackMap       # Geographic threat origins
β”‚   β”‚   β”œβ”€β”€ AttackLog       # Terminal-style event stream
β”‚   β”‚   β”œβ”€β”€ FormulaTooltip  # Methodology transparency
β”‚   β”‚   β”œβ”€β”€ MetricCard      # Glowing stat cards
β”‚   β”‚   └── Header          # SOC-style nav bar
β”‚   └── lib/                # Shared utilities
β”‚       β”œβ”€β”€ carbon.ts       # COβ‚‚ math (SWD Model)
β”‚       β”œβ”€β”€ constants.ts    # Attack types, thresholds
β”‚       └── mock-data.ts    # Real-time data generation
β”œβ”€β”€ scripts/
β”‚   └── attack.py           # DDoS simulator (Python)
β”œβ”€β”€ public/                 # Screenshots, logos
β”œβ”€β”€ .env.example            # Environment template
└── package.json

⚑ Tech Stack

Layer Technology
Frontend Next.js 16, React 19
Styling Tailwind CSS v4
Charts Recharts
Animations Framer Motion
Edge Cloudflare Edge (simulated)
Fonts Inter, JetBrains Mono, Orbitron
Deploy Vercel

πŸ† Sponsor Tracks Targeted

  • Cloudflare (Technical Partner): Edge Shield simulation in src/components/ShieldToggle.tsx. Carbon offset calculations in src/lib/carbon.ts. Attack filtering logic driven by shield state throughout the dashboard.
  • SDG 13 β€” Climate Action: Core formula (1 req = 0.12g COβ‚‚) from the Sustainable Web Design Model, implemented in src/lib/carbon.ts.
  • Cybersecurity (OWASP-aligned): 8 attack types simulated (DDoS, SQL Injection, XSS, Brute Force, Credential Stuffing, etc.) β€” see scripts/attack.py.

πŸš€ Run It Locally (For Judges)

# 1. Clone
git clone https://github.com/edycutjong/botcarbon.git
cd botcarbon

# 2. Install
npm install

# 3. Set up env (optional β€” app works without any keys)
cp .env.example .env.local

# 4. Run
npm run dev
# β†’ http://localhost:3000

πŸ“Œ Note for Judges: No API keys, accounts, or setup required! The dashboard runs entirely client-side with simulated real-time data. Just npm run dev and you're live.

Run the Attack Simulator (Optional)

# In a separate terminal
python scripts/attack.py --intensity high

πŸ“Š Demo Script (30 seconds)

  1. 0:00 β€” Open the dark-mode SOC dashboard. Traffic is calm.
  2. 0:05 β€” Run python attack.py in a terminal. Dashboard lights up red.
  3. 0:10 β€” Charts spike: "Warning: Attack consuming 150 kWh of wasted compute."
  4. 0:15 β€” Click "Enable Cloudflare Edge Shield" toggle.
  5. 0:20 β€” Attack traffic drops to zero. Green counter animates: "150 kWh saved. 60kg COβ‚‚ prevented."
  6. 0:25 β€” Show equivalencies: "That's like preventing 146 miles of driving."
  7. 0:30 β€” Formula tooltip: "1 req = 0.12g COβ‚‚ (SWD Model)"

🏷️ Track Alignment

  • Primary: SDG 13 β€” Climate Action
  • Secondary: Cybersecurity (OWASP-aligned)
  • Sponsor: Cloudflare (Technical Partner)

πŸ“„ License

MIT β€” Built for HackOWASP 8.0


BotCarbon β€” Cybersecurity IS Sustainability πŸŒπŸ›‘οΈ

About

🌍 The Carbon Cost of Cyber Attacks β€” Real-time SOC dashboard quantifying COβ‚‚ emissions from malicious bot traffic. HackOWASP 8.0 | SDG 13 Γ— Cybersecurity

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors