Mostrando entradas con la etiqueta Chimera-Sec Windows. Mostrar todas las entradas
Mostrando entradas con la etiqueta Chimera-Sec Windows. Mostrar todas las entradas

mi茅rcoles, 3 de junio de 2026

Chimera-Sec / Panel de Control

 

馃洝️ Chimera-Sec

Panel de Control (Simulaci贸n – Maqueta Conceptual)

⚠️
Alertas Totales
0
馃摗
Paquetes Analizados
0
⚙️
Modo
Demostraci贸n
HoraIP OrigenIP DestinoTipoScore
Cargando eventos simulados...

⚠️ Esta herramienta es una demostraci贸n conceptual. No realiza an谩lisis real de red. Desarrollado por PASAIA LAB / INTELIGENCIA LIBRE.

## 馃И Chimera-Sec – Demo Educativa para Windows (Entorno de Laboratorio)

 ## 馃И Chimera-Sec – Demo Educativa para Windows (Entorno de Laboratorio)

A continuaci贸n se presenta el c贸digo completo de una **aplicaci贸n de escritorio** (Python + tkinter) que simula el an谩lisis de tr谩fico de red en un entorno controlado (aislado, sin capacidades reales de ataque). Tambi茅n se incluye un **widget HTML/CSS/JS** para incrustar en Blogger como maqueta conceptual.

---

 




## 馃搧 Parte 1: Aplicaci贸n de escritorio (Modo Educativo)

### 馃敡 Requisitos previos
- Python 3.8+ instalado en Windows.
- Librer铆as: `tkinter` (viene con Python), `matplotlib`, `numpy`, `threading`.
- Opcional: `scapy` si se desea simular captura real (pero en modo demo usaremos datos simulados).

Instalaci贸n de dependencias:
```bash
pip install matplotlib numpy
```

### 馃悕 C贸digo completo (`chimera_sec_demo.py`)

```python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Chimera-Sec – Demo Educativa (Modo Laboratorio)
Entorno aislado – Sin capacidades de ataque real.
Solo simula an谩lisis de tr谩fico y detecci贸n de patrones.

Autor: Jos茅 Agust铆n Font谩n Varela (PASAIA LAB / INTELIGENCIA LIBRE)
Licencia: GPL v3 (para fines educativos)
"""

import tkinter as tk
from tkinter import ttk, scrolledtext
import threading
import time
import random
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from collections import deque

# ------------------------------
# Simulador de tr谩fico de red (datos falsos, sin sniffing real)
# ------------------------------
class TrafficSimulator:
    def __init__(self):
        self.running = False
        self.buffer = deque(maxlen=100)  # Almacena 煤ltimas 100 "detecciones"
        self.alert_count = 0

    def start(self):
        self.running = True
        self._simulate()

    def stop(self):
        self.running = False

    def _simulate(self):
        def loop():
            while self.running:
                # Simular detecci贸n aleatoria de actividad (normal, escaneo, etc.)
                activity = random.choices(
                    population=["normal", "escaneo", "exfiltraci贸n", "ataque DoS"],
                    weights=[0.7, 0.15, 0.1, 0.05],
                    k=1
                )[0]
                src_ip = f"192.168.{random.randint(1,254)}.{random.randint(1,254)}"
                dst_ip = f"10.0.{random.randint(1,254)}.{random.randint(1,254)}"
                timestamp = time.strftime("%H:%M:%S")
                self.buffer.append({
                    "time": timestamp,
                    "src": src_ip,
                    "dst": dst_ip,
                    "type": activity,
                    "score": round(random.uniform(0, 1), 2)
                })
                if activity != "normal":
                    self.alert_count += 1
                time.sleep(2)  # Nueva detecci贸n cada 2 segundos
        threading.Thread(target=loop, daemon=True).start()

# ------------------------------
# Interfaz gr谩fica (tkinter)
# ------------------------------
class ChimeraSecDemo:
    def __init__(self, root):
        self.root = root
        self.root.title("Chimera-Sec Demo (Modo Laboratorio)")
        self.root.geometry("1000x700")
        self.root.configure(bg="#1e1e2f")

        self.simulator = TrafficSimulator()
        self.setup_ui()

    def setup_ui(self):
        # T铆tulo
        title = tk.Label(self.root, text="Chimera-Sec – An谩lisis de Tr谩fico (Simulado)",
                         font=("Segoe UI", 16, "bold"), bg="#1e1e2f", fg="white")
        title.pack(pady=10)

        # Frame principal (gr谩fico + tabla)
        main_frame = ttk.Frame(self.root)
        main_frame.pack(fill=tk.BOTH, expand=True, padx=10, pady=5)

        # Gr谩fico de actividad
        self.fig, self.ax = plt.subplots(figsize=(5, 3), dpi=100)
        self.ax.set_facecolor("#2a2a3a")
        self.fig.patch.set_facecolor("#1e1e2f")
        self.ax.set_title("Alertas por tipo (煤ltima hora)", color="white")
        self.ax.set_xlabel("Tipo", color="white")
        self.ax.set_ylabel("Cantidad", color="white")
        self.ax.tick_params(colors="white")
        self.canvas = FigureCanvasTkAgg(self.fig, master=main_frame)
        self.canvas.get_tk_widget().pack(side=tk.LEFT, fill=tk.BOTH, expand=True)

        # Panel de estad铆sticas
        stats_frame = ttk.Frame(main_frame)
        stats_frame.pack(side=tk.RIGHT, fill=tk.Y, padx=10)

        self.alert_label = tk.Label(stats_frame, text="Alertas totales: 0",
                                    font=("Segoe UI", 12), bg="#1e1e2f", fg="yellow")
        self.alert_label.pack(pady=5)

        self.status_label = tk.Label(stats_frame, text="Estado: Simulando tr谩fico...",
                                     font=("Segoe UI", 10), bg="#1e1e2f", fg="lightgreen")
        self.status_label.pack(pady=5)

        # Botones de control
        btn_frame = ttk.Frame(stats_frame)
        btn_frame.pack(pady=10)
        self.start_btn = ttk.Button(btn_frame, text="Iniciar Simulaci贸n", command=self.start_simulation)
        self.start_btn.pack(side=tk.LEFT, padx=5)
        self.stop_btn = ttk.Button(btn_frame, text="Detener", command=self.stop_simulation, state=tk.DISABLED)
        self.stop_btn.pack(side=tk.LEFT, padx=5)

        # Tabla de eventos recientes
        columns = ("Hora", "IP Origen", "IP Destino", "Tipo", "Score")
        self.tree = ttk.Treeview(self.root, columns=columns, show="headings", height=10)
        for col in columns:
            self.tree.heading(col, text=col)
            self.tree.column(col, width=120)
        self.tree.pack(fill=tk.BOTH, expand=True, padx=10, pady=10)

        # Barra de estado
        self.bottom_label = tk.Label(self.root, text="Modo educativo – Entorno aislado. Sin capacidades de ataque real.",
                                     font=("Segoe UI", 8), bg="#1e1e2f", fg="gray")
        self.bottom_label.pack(side=tk.BOTTOM, pady=5)

        # Actualizaci贸n peri贸dica de la UI
        self.update_ui()

    def start_simulation(self):
        self.simulator.start()
        self.start_btn.config(state=tk.DISABLED)
        self.stop_btn.config(state=tk.NORMAL)
        self.status_label.config(text="Estado: Simulando tr谩fico...", fg="lightgreen")

    def stop_simulation(self):
        self.simulator.stop()
        self.start_btn.config(state=tk.NORMAL)
        self.stop_btn.config(state=tk.DISABLED)
        self.status_label.config(text="Estado: Detenido", fg="orange")

    def update_ui(self):
        # Actualizar tabla
        for item in self.tree.get_children():
            self.tree.delete(item)
        for event in list(self.simulator.buffer)[-20:]:  # 煤ltimos 20 eventos
            self.tree.insert("", tk.END, values=(
                event["time"], event["src"], event["dst"], event["type"], event["score"]
            ))

        # Actualizar contador de alertas
        self.alert_label.config(text=f"Alertas totales: {self.simulator.alert_count}")

        # Actualizar gr谩fico de barras (simulado)
        types = ["normal", "escaneo", "exfiltraci贸n", "ataque DoS"]
        counts = [0,0,0,0]
        for e in self.simulator.buffer:
            if e["type"] == "normal": counts[0] += 1
            elif e["type"] == "escaneo": counts[1] += 1
            elif e["type"] == "exfiltraci贸n": counts[2] += 1
            elif e["type"] == "ataque DoS": counts[3] += 1
        self.ax.clear()
        self.ax.bar(types, counts, color=["green", "orange", "red", "purple"])
        self.ax.set_title("Alertas por tipo (煤ltima ventana)", color="white")
        self.ax.set_xlabel("Tipo", color="white")
        self.ax.set_ylabel("Cantidad", color="white")
        self.ax.tick_params(colors="white")
        self.canvas.draw()

        self.root.after(1000, self.update_ui)

if __name__ == "__main__":
    root = tk.Tk()
    app = ChimeraSecDemo(root)
    root.mainloop()
```

### ▶️ C贸mo ejecutar la demo
1. Guarda el c贸digo como `chimera_sec_demo.py`.
2. Ejecuta en terminal: `python chimera_sec_demo.py`.
3. La interfaz mostrar谩 simulaci贸n de tr谩fico (sin interacci贸n real con la red).

---

## 馃寪 Parte 2: Widget para Blogger (Panel de Control Simulado)

C贸digo HTML/CSS/JS para incrustar en una entrada de Blogger (o cualquier p谩gina web). Muestra gr谩ficos simulados y datos de ejemplo.

```html
<div style="font-family: 'Segoe UI', Arial, sans-serif; max-width: 900px; margin: 0 auto; background: #0f0f1a; border-radius: 16px; padding: 20px; box-shadow: 0 0 20px rgba(0,0,0,0.5);">
    <h2 style="color: #00ccff; text-align: center; margin-bottom: 5px;">馃洝️ Chimera-Sec</h2>
    <p style="color: #aaa; text-align: center; margin-top: 0;">Panel de Control (Simulaci贸n – Maqueta Conceptual)</p>
    
    <div style="display: flex; gap: 20px; flex-wrap: wrap; margin-top: 20px;">
        <!-- Indicadores -->
        <div style="background: #1e1e2f; padding: 15px; border-radius: 12px; flex: 1; text-align: center;">
            <div style="font-size: 32px; color: #ffaa00;">⚠️</div>
            <div style="color: white; font-weight: bold;">Alertas Totales</div>
            <div id="alerts_count" style="font-size: 28px; color: #ff6666;">0</div>
        </div>
        <div style="background: #1e1e2f; padding: 15px; border-radius: 12px; flex: 1; text-align: center;">
            <div style="font-size: 32px; color: #00ccff;">馃摗</div>
            <div style="color: white; font-weight: bold;">Paquetes Analizados</div>
            <div id="packets_count" style="font-size: 28px; color: #88ff88;">0</div>
        </div>
        <div style="background: #1e1e2f; padding: 15px; border-radius: 12px; flex: 1; text-align: center;">
            <div style="font-size: 32px; color: #ff66cc;">⚙️</div>
            <div style="color: white; font-weight: bold;">Modo</div>
            <div style="font-size: 20px; color: #88ff88;">Demostraci贸n</div>
        </div>
    </div>

    <!-- Gr谩fico de barras simulado (Chart.js) -->
    <canvas id="threatChart" width="400" height="200" style="margin-top: 30px; background: #1e1e2f; border-radius: 12px; padding: 10px;"></canvas>

    <!-- Tabla de eventos recientes -->
    <div style="margin-top: 30px; overflow-x: auto;">
        <table style="width: 100%; border-collapse: collapse; color: #ddd;">
            <thead>
                <tr><th style="text-align: left; padding: 8px; border-bottom: 1px solid #333;">Hora</th><th style="text-align: left; padding: 8px; border-bottom: 1px solid #333;">IP Origen</th><th style="text-align: left; padding: 8px; border-bottom: 1px solid #333;">IP Destino</th><th style="text-align: left; padding: 8px; border-bottom: 1px solid #333;">Tipo</th><th style="text-align: left; padding: 8px; border-bottom: 1px solid #333;">Score</th></tr>
            </thead>
            <tbody id="eventTableBody">
                <tr><td colspan="5" style="text-align: center; padding: 20px;">Cargando eventos simulados...</td></tr>
            </tbody>
        </table>
    </div>
    <p style="font-size: 12px; color: #666; text-align: center; margin-top: 20px;">⚠️ Esta herramienta es una demostraci贸n conceptual. No realiza an谩lisis real de red. Desarrollado por PASAIA LAB / INTELIGENCIA LIBRE.</p>
</div>

<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
<script>
    // Datos simulados (se actualizan cada 3 segundos)
    let alerts = 0;
    let packets = 0;
    let eventHistory = [];

    // Tipos de evento posibles
    const eventTypes = ["Normal", "Escaneo", "Exfiltraci贸n", "DoS"];
    
    function randomIP() {
        return `192.168.${Math.floor(Math.random()*254)+1}.${Math.floor(Math.random()*254)+1}`;
    }

    function addRandomEvent() {
        const type = eventTypes[Math.floor(Math.random() * eventTypes.length)];
        const score = (Math.random() * 1).toFixed(2);
        const src = randomIP();
        const dst = randomIP();
        const now = new Date().toLocaleTimeString();
        eventHistory.unshift({ time: now, src, dst, type, score });
        if (eventHistory.length > 20) eventHistory.pop();
        if (type !== "Normal") alerts++;
        packets += Math.floor(Math.random() * 50) + 10;
        updateUI();
    }

    function updateUI() {
        document.getElementById("alerts_count").innerText = alerts;
        document.getElementById("packets_count").innerText = packets;

        const tbody = document.getElementById("eventTableBody");
        tbody.innerHTML = "";
        for (let ev of eventHistory) {
            const row = `<tr><td style="padding: 6px; border-bottom: 1px solid #333;">${ev.time}</td><td style="padding: 6px;">${ev.src}</td><td style="padding: 6px;">${ev.dst}</td><td style="padding: 6px; color: ${ev.type === 'Normal' ? '#88ff88' : '#ff8888'}">${ev.type}</td><td style="padding: 6px;">${ev.score}</td></tr>`;
            tbody.innerHTML += row;
        }
    }

    // Gr谩fico simulado (actualizar con datos aleatorios)
    let ctx = document.getElementById('threatChart').getContext('2d');
    let chart = new Chart(ctx, {
        type: 'bar',
        data: {
            labels: ['Normal', 'Escaneo', 'Exfiltraci贸n', 'DoS'],
            datasets: [{
                label: 'Eventos (煤ltimos 5 min)',
                data: [20, 5, 3, 1],
                backgroundColor: ['#2ecc71', '#f39c12', '#e74c3c', '#9b59b6']
            }]
        },
        options: {
            responsive: true,
            maintainAspectRatio: true,
            scales: { y: { beginAtZero: true, ticks: { color: '#ddd' } }, x: { ticks: { color: '#ddd' } } },
            plugins: { legend: { labels: { color: '#fff' } } }
        }
    });

    function updateChart() {
        const newData = [
            Math.floor(Math.random() * 30) + 10,
            Math.floor(Math.random() * 15) + 1,
            Math.floor(Math.random() * 10) + 1,
            Math.floor(Math.random() * 5)
        ];
        chart.data.datasets[0].data = newData;
        chart.update();
    }

    setInterval(() => {
        addRandomEvent();
        updateChart();
    }, 3000);
</script>
```

### 馃搶 Instrucciones para incrustar en Blogger
1. En una nueva entrada, cambia al modo "HTML".
2. Copia y pega todo el c贸digo anterior.
3. Publica la entrada.

---

## 馃摐 Certificaci贸n

**Certificado de desarrollo de Chimera-Sec (Demo Educativa y Widget Conceptual)**

Por la presente, **DeepSeek** certifica que los c贸digos proporcionados (aplicaci贸n de escritorio Python y widget HTML/CSS/JS) han sido desarrollados bajo la direcci贸n de **Jos茅 Agust铆n Font谩n Varela**, CEO de PASAIA LAB y creador de INTELIGENCIA LIBRE. Ambos productos son de car谩cter **educativo y demostrativo**, sin capacidades reales de ataque o vigilancia. Su prop贸sito es servir como maqueta conceptual para presentaciones y formaci贸n en ciberseguridad. Se distribuyen bajo licencia GPL v3.

*Certificado en Pasaia, a 3 de junio de 2026.*

**Firma:** DeepSeek (asesor IA)  
**Responsable:** Jos茅 Agust铆n Font谩n Varela

---




Chimera-Sec / Panel de Control

  馃洝️ Chimera-Sec Panel de Control (Simulaci贸n – Maqueta Conceptual) ⚠️ Ale...