CYRAGE commited on
Commit
69e0eeb
·
verified ·
1 Parent(s): 33ab891

### Programmier-Anweisung für eine Benutzeroberfläche (UI) zur Visualisierung und Analyse von IT-Sicherheitsmethoden Um eine benutzerfreundliche und interaktive Benutzeroberfläche (UI) zu entwickeln, die die Informationen aus dem bereitgestellten „IT Security Methods – Complete Cheat-Sheet“ visualisiert und analysiert, müssen wir eine präzise Programmier-Anweisung formulieren. Die UI soll Entwicklern, IT-Sicherheitsanalysten oder Administratoren helfen, die Sicherheitsmethoden (z. B. XSS, DoS, DDoS, TLS, etc.) zu verstehen, zu filtern, zu durchsuchen und spezifische Details anzuzeigen. Die Anweisung wird den gesamten Softwareentwicklungsprozess abdecken, basierend auf dem zuvor beschriebenen strukturierten Ansatz für Softwareprojekte, und spezifisch auf die Erstellung einer UI ausgerichtet sein. Dabei wird die Bedeutung präziser Anweisungen berücksichtigt, wie im Restaurant-Beispiel gezeigt, um irrelevante Daten zu vermeiden und ein fokussiertes Ergebnis zu erzielen. --- ### Prompt zur Erstellung einer UI für IT-Sicherheitsmethoden #### 1. Projektplanung und Anforderungen - **Projektziel**: Entwicklung einer interaktiven Web-basierten Benutzeroberfläche, die IT-Sicherheitsmethoden aus dem „IT Security Methods – Complete Cheat-Sheet“ strukturiert darstellt, durchsuchbar macht und es Benutzern ermöglicht, spezifische Details zu jeder Methode (z. B. XSS, DDoS, TLS) anzuzeigen. Die UI soll benutzerfreundlich sein, sowohl für technische als auch weniger technische Nutzer, und eine Analyse der Sicherheitsmethoden ermöglichen (z. B. Vergleich von Methoden, Filtern nach Kategorie). - **Funktionale Anforderungen**: - Anzeige aller Sicherheitsmethoden in einer übersichtlichen, kategorisierten Struktur (z. B. XSS, DoS, TLS als Kategorien). - Suchfunktion, um Methoden nach Namen, Kategorien oder Schlüsselwörtern zu finden. - Filteroptionen (z. B. nach Kategorie, Angriffstyp, Schutzmaßnahme). - Detailansicht für jede Methode mit Beschreibung, Beispielen und relevanten Links (z. B. OWASP, RFCs). - Interaktive Visualisierung (z. B. Diagramme für Angriffstypen oder Schutzmaßnahmen). - Exportfunktion für ausgewählte Daten (z. B. als JSON oder PDF). - **Nicht-funktionale Anforderungen**: - **Benutzerfreundlichkeit**: Intuitive Navigation, responsive Design für Desktop und Mobile. - **Performance**: Ladezeiten unter 2 Sekunden für die Hauptansicht. - **Sicherheit**: Schutz vor XSS, sichere Datenverarbeitung, keine Speicherung sensibler Benutzerdaten. - **Skalierbarkeit**: Unterstützung für zukünftige Erweiterungen (z. B. neue Sicherheitsmethoden). - **Stakeholder-Analyse**: - **Endnutzer**: IT-Sicherheitsanalysten, Entwickler, Administratoren. - **Kunden**: Unternehmen, die Sicherheitsmethoden für Schulungen oder Audits nutzen. - **Entwickler**: Team, das die UI wartet und erweitert. - **Anforderungen der Stakeholder**: Schneller Zugriff auf Informationen, einfache Bedienung, zuverlässige und sichere Anwendung. - **Projektplan**: - **Meilenstein 1**: Anforderungsanalyse und Mockups (2 Wochen). - **Meilenstein 2**: Technologieauswahl und Prototyp (3 Wochen). - **Meilenstein 3**: Implementierung der UI (6 Wochen). - **Meilenstein 4**: Testen und Fehlerbehebung (2 Wochen). - **Meilenstein 5**: Deployment und Dokumentation (1 Woche). - **Verantwortlichkeiten**: - UI/UX-Designer: Erstellung von Mockups und responsive Design. - Frontend-Entwickler: Implementierung der UI und Visualisierungen. - Backend-Entwickler: Datenverarbeitung und API-Bereitstellung. - QA-Team: Testen der Funktionalität und Sicherheit. --- #### 2. Technologieauswahl - **Programmiersprache**: - **Frontend**: JavaScript (für dynamische UI-Elemente). - **Backend**: Python (für API und Datenverarbeitung, falls erforderlich). - **Frameworks und Bibliotheken**: - **Frontend**: - React.js für die Erstellung der Benutzeroberfläche (komponentenbasiert, performant). - Chart.js für interaktive Diagramme (z. B. Verteilung von Angriffstypen). - Material-UI oder Tailwind CSS für ein modernes, responsives Design. - **Backend** (falls benötigt): - FastAPI oder Flask für eine REST-API zur Datenverarbeitung. - SQLite oder MongoDB für die Speicherung der Sicherheitsmethoden-Daten. - **Entwicklungsumgebung**: - **IDE**: VS Code für Frontend- und Backend-Entwicklung. - **Versionskontrolle**: Git mit GitHub für Zusammenarbeit und Code-Management. - **Tools**: - Webpack/Vite für das Bundling von Frontend-Ressourcen. - ESLint und Prettier für Code-Qualität. - Docker für einheitliche Entwicklungsumgebungen. - **Datenquelle**: - Die Daten aus dem „IT Security Methods – Complete Cheat-Sheet“ werden als JSON-Datei strukturiert und in die Anwendung eingebunden (z. B. lokal oder über eine API). --- #### 3. Entwicklung - **Architekturdesign**: - **Frontend**: React-Komponentenstruktur mit: - **Hauptkomponente**: Übersicht aller Kategorien (z. B. XSS, DDoS). - **Such- und Filterkomponente**: Eingabefeld und Dropdowns für Kategorien. - **Detailkomponente**: Anzeige von Details zu einer Methode (z. B. Beschreibung, Links). - **Diagrammkomponente**: Visualisierung mit Chart.js (z. B. Balkendiagramm für Angriffstypen). - **Backend** (optional): REST-API mit Endpunkten wie `/methods`, `/search`, `/categories`. - **Schnittstellen**: - JSON-basierte Datenstruktur für die Sicherheitsmethoden. - API-Calls für dynamische Datenaktualisierung (falls erweitert). - **Datenmodellierung**: - Struktur der Sicherheitsmethoden in JSON, z. B.: ```json { "categories": [ { "name": "XSS", "methods": [ { "name": "Reflected-XSS", "description": "Angriff, bei dem bösartiger Code in einer Anfrage reflektiert wird.", "mitigation": ["Input-Validation", "Output-Encoding"], "references": ["OWASP XSS Prevention"] }, ... ] }, ... ] } ``` - Speicherung in einer SQLite-Datenbank oder als statische JSON-Datei. - **Implementierung**: - **Frontend**: - React-Komponenten für die Darstellung der Kategorien und Methoden. - Suchfunktion mit Fuzzy-Suche (z. B. mit Fuse.js). - Filterlogik für Kategorien und Angriffstypen. - Chart.js für Visualisierungen (z. B. Balkendiagramm für Häufigkeit von Methoden). - Responsive Design mit Tailwind CSS. - **Backend** (falls benötigt): - FastAPI für Endpunkte zur Datenabfrage. - Caching (z. B. Redis) für schnellere Antwortzeiten. - Verwendung von Design Patterns wie „Component Pattern“ (React) und „RESTful API Design“. - **Integration**: - Verbindung von Frontend und Backend über REST-API (falls verwendet). - Einbindung von Chart.js für Diagramme. - Sicherstellung, dass die UI mit statischen JSON-Daten oder dynamischen API-Daten funktioniert. --- #### 4. Kontextverständnis und Aufgabenautomatisierung - **Kontextanalyse**: - Die UI erkennt den Kontext basierend auf Benutzeraktionen (z. B. Auswahl einer Kategorie wie „XSS“ zeigt nur relevante Methoden an). - Analyse von JSON-Daten, um dynamische Filteroptionen zu generieren. - **Aufgabenerkennung**: - Erkennung von Benutzerintentionen (z. B. Suche nach „XSS“ zeigt nur XSS-Methoden). - Vorschläge basierend auf häufigen Suchbegriffen (z. B. „OWASP“, „DDoS“). - **Automatisierungstools**: - CI/CD-Pipeline mit GitHub Actions für automatische Builds und Tests. - Skripte zur Konvertierung des Cheat-Sheets in JSON. - Automatische Generierung von Diagrammen basierend auf Daten (z. B. Verteilung der Methoden). --- #### 5. Testen - **Unit-Tests**: - Testen von React-Komponenten mit Jest und React Testing Library. - Überprüfung der Such- und Filterlogik. - **Integrationstests**: - Testen der Interaktion zwischen Frontend und API (falls verwendet). - Sicherstellung, dass Diagramme korrekt gerendert werden. - **Systemtests**: - Überprüfung der gesamten UI in verschiedenen Browsern (Chrome, Firefox, Safari). - Tests auf mobilen Geräten für responsives Design. - **Benutzertests**: - Feedback von IT-Sicherheitsanalysten einholen, um Usability zu bewerten. - Testen der Suchfunktion und Navigation mit echten Nutzern. --- #### 6. Dokumentation und Support - **Dokumentation**: - **Benutzerhandbuch**: Anleitung zur Nutzung der UI (z. B. Suche, Filter, Export). - **Technische Dokumentation**: Beschreibung der React-Komponenten und API-Endpunkte. - **API-Dokumentation**: Falls Backend verwendet, Swagger/OpenAPI-Dokumentation. - **Support**: - Einrichtung eines FAQ-Bereichs in der UI. - Kontaktformular für Benutzeranfragen. --- #### 7. Deployment und Wartung - **Deployment**: - Bereitstellung der UI auf einer Cloud-Plattform wie Vercel oder Netlify. - Konfiguration von HTTPS und Sicherheitsheadern (z. B. HSTS, CSP). - Einrichtung eines CDN für schnellere Ladezeiten. - **Wartung**: - Regelmäßige Updates der Sicherheitsmethoden-Daten (z. B. neue OWASP-Einträge). - Monitoring der UI-Performance mit Tools wie Sentry. - Behebung von Fehlern basierend auf Benutzerfeedback. --- #### Beispiel-JSON für die UI Um die Daten für die UI zu strukturieren, könnte ein Auszug des JSON wie folgt aussehen: ```json { "categories": [ { "name": "XSS", "methods": [ { "name": "Reflected-XSS", "description": "Angriff, bei dem bösartiger Code in einer Anfrage reflektiert wird.", "mitigation": ["Input-Validation", "Output-Encoding"], "references": ["https://owasp.org/www-community/attacks/xss/"] }, { "name": "Stored-XSS", "description": "Angriff, bei dem bösartiger Code auf dem Server gespeichert wird.", "mitigation": ["Sanitization", "CSP"], "references": ["https://owasp.org/www-community/attacks/xss/"] } ] }, { "name": "DDoS", "methods": [ { "name": "DNS Amplification", "description": "Verstärkung von DNS-Anfragen zur Überlastung eines Servers.", "mitigation": ["Cloud Scrubbing", "Anycast Diffusion"], "references": ["https://www.cloudflare.com/learning/ddos/dns-amplification-ddos-attack/"] } ] } ] } ``` --- #### Beispiel-Chart für Visualisierung Um die Verteilung der Sicherheitsmethoden nach Kategorien zu visualisieren, könnte die UI ein Balkendiagramm anzeigen. Hier ist ein Beispiel für ein Chart.js-Balkendiagramm, das die Anzahl der Methoden pro Kategorie darstellt: ```chartjs { "type": "bar", "data": { "labels": ["XSS", "DoS", "DDoS", "IPSec", "TLS", "AES", "MFA", "WAF"], "datasets": [ { "label": "Anzahl der Methoden", "data": [10, 12, 13, 14, 13, 13, 14, 14], "backgroundColor": [ "#3b82f6", "#ef4444", "#10b981", "#f59e0b", "#8b5cf6", "#ec4899", "#14b8a6", "#f97316" ], "borderColor": [ "#1e3a8a", "#b91c1c", "#047857", "#b45309", "#5b21b6", "#be185d", "#0f766e", "#c2410c" ], "borderWidth": 1 } ] }, "options": { "scales": { "y": { "beginAtZero": true, "title": { "display": true, "text": "Anzahl der Methoden" } }, "x": { "title": { "display": true, "text": "Kategorien" } } }, "plugins": { "legend": { "display": false }, "title": { "display": true, "text": "Verteilung der IT-Sicherheitsmethoden nach Kategorie" } } } } ``` Dieses Diagramm zeigt die Anzahl der Methoden pro Kategorie (z. B. XSS, DoS) in einem farblich abgestimmten Balkendiagramm, das für helle und dunkle Themes geeignet ist. --- #### Fazit Diese Programmier-Anweisung bietet eine klare, schrittweise Anleitung zur Entwicklung einer interaktiven UI für IT-Sicherheitsmethoden. Durch die präzise Formulierung der Anforderungen – inspiriert vom Restaurant-Beispiel, das die Bedeutung spezifischer Anweisungen zeigt – wird sichergestellt, dass die UI nur relevante Daten anzeigt und die Bedürfnisse der Benutzer (z. B. schnelle Suche, klare Visualisierung) erfüllt. Die Verwendung von React, Chart.js und Tailwind CSS ermöglicht eine moderne, skalierbare und benutzerfreundliche Anwendung, die sowohl für technische als auch weniger technische Nutzer geeignet ist. Die Anweisung deckt alle Phasen ab – von der Planung bis zur Wartung – und berücksichtigt Sicherheitsaspekte wie CSP und HSTS, die im Cheat-Sheet selbst erwähnt sind, um die Anwendung abzusichern. - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +6 -4
  2. index.html +1047 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Itsecdash
3
- emoji: 👀
4
- colorFrom: indigo
5
  colorTo: purple
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: itsecdash
3
+ emoji: 🐳
4
+ colorFrom: red
5
  colorTo: purple
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,1047 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>IT Security Methods Dashboard</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
10
+ <style>
11
+ .method-card:hover {
12
+ transform: translateY(-5px);
13
+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
14
+ }
15
+ .dark .chart-container {
16
+ background-color: #1f2937;
17
+ }
18
+ .search-highlight {
19
+ background-color: #fef08a;
20
+ padding: 0 2px;
21
+ border-radius: 2px;
22
+ }
23
+ </style>
24
+ </head>
25
+ <body class="bg-gray-50 dark:bg-gray-900 transition-colors duration-200">
26
+ <div class="min-h-screen">
27
+ <!-- Header -->
28
+ <header class="bg-blue-600 text-white shadow-lg">
29
+ <div class="container mx-auto px-4 py-6">
30
+ <div class="flex flex-col md:flex-row justify-between items-center">
31
+ <div class="flex items-center mb-4 md:mb-0">
32
+ <i class="fas fa-shield-alt text-3xl mr-3"></i>
33
+ <h1 class="text-2xl font-bold">IT Security Methods Dashboard</h1>
34
+ </div>
35
+ <div class="flex items-center space-x-4">
36
+ <button id="theme-toggle" class="p-2 rounded-full bg-blue-700 hover:bg-blue-800">
37
+ <i class="fas fa-moon"></i>
38
+ </button>
39
+ <button id="export-btn" class="px-4 py-2 bg-blue-700 hover:bg-blue-800 rounded-lg flex items-center">
40
+ <i class="fas fa-file-export mr-2"></i> Export
41
+ </button>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </header>
46
+
47
+ <!-- Main Content -->
48
+ <main class="container mx-auto px-4 py-8">
49
+ <!-- Search and Filter Section -->
50
+ <div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 mb-8">
51
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
52
+ <!-- Search -->
53
+ <div class="md:col-span-2">
54
+ <label for="search" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Search Methods</label>
55
+ <div class="relative">
56
+ <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
57
+ <i class="fas fa-search text-gray-400"></i>
58
+ </div>
59
+ <input type="text" id="search" class="block w-full pl-10 pr-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white" placeholder="Search by name, category or keyword...">
60
+ </div>
61
+ </div>
62
+
63
+ <!-- Category Filter -->
64
+ <div>
65
+ <label for="category-filter" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Filter by Category</label>
66
+ <select id="category-filter" class="block w-full pl-3 pr-10 py-2 text-base border border-gray-300 dark:border-gray-600 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md dark:bg-gray-700 dark:text-white">
67
+ <option value="all">All Categories</option>
68
+ <!-- Categories will be populated by JavaScript -->
69
+ </select>
70
+ </div>
71
+ </div>
72
+
73
+ <!-- Advanced Filters (Collapsible) -->
74
+ <div class="mt-4">
75
+ <button id="advanced-filters-toggle" class="text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 text-sm font-medium flex items-center">
76
+ <i class="fas fa-sliders-h mr-2"></i> Advanced Filters
77
+ <i id="advanced-filters-arrow" class="fas fa-chevron-down ml-1 text-xs"></i>
78
+ </button>
79
+
80
+ <div id="advanced-filters" class="hidden mt-4 pt-4 border-t border-gray-200 dark:border-gray-700">
81
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-6">
82
+ <!-- Attack Type Filter -->
83
+ <div>
84
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Attack Type</label>
85
+ <div class="space-y-2">
86
+ <div class="flex items-center">
87
+ <input id="attack-web" type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded dark:bg-gray-700">
88
+ <label for="attack-web" class="ml-2 text-sm text-gray-700 dark:text-gray-300">Web</label>
89
+ </div>
90
+ <div class="flex items-center">
91
+ <input id="attack-network" type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded dark:bg-gray-700">
92
+ <label for="attack-network" class="ml-2 text-sm text-gray-700 dark:text-gray-300">Network</label>
93
+ </div>
94
+ <div class="flex items-center">
95
+ <input id="attack-system" type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded dark:bg-gray-700">
96
+ <label for="attack-system" class="ml-2 text-sm text-gray-700 dark:text-gray-300">System</label>
97
+ </div>
98
+ </div>
99
+ </div>
100
+
101
+ <!-- Mitigation Filter -->
102
+ <div>
103
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Mitigation</label>
104
+ <div class="space-y-2">
105
+ <div class="flex items-center">
106
+ <input id="mitigation-encryption" type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded dark:bg-gray-700">
107
+ <label for="mitigation-encryption" class="ml-2 text-sm text-gray-700 dark:text-gray-300">Encryption</label>
108
+ </div>
109
+ <div class="flex items-center">
110
+ <input id="mitigation-validation" type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded dark:bg-gray-700">
111
+ <label for="mitigation-validation" class="ml-2 text-sm text-gray-700 dark:text-gray-300">Validation</label>
112
+ </div>
113
+ <div class="flex items-center">
114
+ <input id="mitigation-monitoring" type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 dark:border-gray-600 rounded dark:bg-gray-700">
115
+ <label for="mitigation-monitoring" class="ml-2 text-sm text-gray-700 dark:text-gray-300">Monitoring</label>
116
+ </div>
117
+ </div>
118
+ </div>
119
+
120
+ <!-- Severity Filter -->
121
+ <div>
122
+ <label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Severity</label>
123
+ <div class="flex items-center space-x-4">
124
+ <div class="flex items-center">
125
+ <input id="severity-high" type="checkbox" class="h-4 w-4 text-red-600 focus:ring-red-500 border-gray-300 dark:border-gray-600 rounded dark:bg-gray-700">
126
+ <label for="severity-high" class="ml-2 text-sm text-gray-700 dark:text-gray-300">High</label>
127
+ </div>
128
+ <div class="flex items-center">
129
+ <input id="severity-medium" type="checkbox" class="h-4 w-4 text-yellow-600 focus:ring-yellow-500 border-gray-300 dark:border-gray-600 rounded dark:bg-gray-700">
130
+ <label for="severity-medium" class="ml-2 text-sm text-gray-700 dark:text-gray-300">Medium</label>
131
+ </div>
132
+ <div class="flex items-center">
133
+ <input id="severity-low" type="checkbox" class="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 dark:border-gray-600 rounded dark:bg-gray-700">
134
+ <label for="severity-low" class="ml-2 text-sm text-gray-700 dark:text-gray-300">Low</label>
135
+ </div>
136
+ </div>
137
+ </div>
138
+ </div>
139
+ </div>
140
+ </div>
141
+ </div>
142
+
143
+ <!-- Stats and Chart Section -->
144
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-8 mb-8">
145
+ <!-- Stats Cards -->
146
+ <div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
147
+ <div class="flex items-center justify-between">
148
+ <div>
149
+ <p class="text-sm font-medium text-gray-500 dark:text-gray-400">Total Methods</p>
150
+ <p id="total-methods" class="text-3xl font-bold text-gray-900 dark:text-white">0</p>
151
+ </div>
152
+ <div class="p-3 rounded-full bg-blue-100 dark:bg-blue-900 text-blue-600 dark:text-blue-300">
153
+ <i class="fas fa-list-check text-xl"></i>
154
+ </div>
155
+ </div>
156
+ </div>
157
+
158
+ <div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
159
+ <div class="flex items-center justify-between">
160
+ <div>
161
+ <p class="text-sm font-medium text-gray-500 dark:text-gray-400">Categories</p>
162
+ <p id="total-categories" class="text-3xl font-bold text-gray-900 dark:text-white">0</p>
163
+ </div>
164
+ <div class="p-3 rounded-full bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-300">
165
+ <i class="fas fa-tags text-xl"></i>
166
+ </div>
167
+ </div>
168
+ </div>
169
+
170
+ <div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
171
+ <div class="flex items-center justify-between">
172
+ <div>
173
+ <p class="text-sm font-medium text-gray-500 dark:text-gray-400">Common Mitigation</p>
174
+ <p id="common-mitigation" class="text-3xl font-bold text-gray-900 dark:text-white">-</p>
175
+ </div>
176
+ <div class="p-3 rounded-full bg-purple-100 dark:bg-purple-900 text-purple-600 dark:text-purple-300">
177
+ <i class="fas fa-shield-alt text-xl"></i>
178
+ </div>
179
+ </div>
180
+ </div>
181
+ </div>
182
+
183
+ <!-- Chart Section -->
184
+ <div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 mb-8">
185
+ <div class="flex justify-between items-center mb-4">
186
+ <h2 class="text-lg font-semibold text-gray-900 dark:text-white">Security Methods Distribution</h2>
187
+ <div class="flex space-x-2">
188
+ <button id="chart-bar" class="px-3 py-1 text-sm bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-md">Bar</button>
189
+ <button id="chart-pie" class="px-3 py-1 text-sm bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-md">Pie</button>
190
+ <button id="chart-doughnut" class="px-3 py-1 text-sm bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-md">Doughnut</button>
191
+ </div>
192
+ </div>
193
+ <div class="chart-container" style="position: relative; height: 400px;">
194
+ <canvas id="methods-chart"></canvas>
195
+ </div>
196
+ </div>
197
+
198
+ <!-- Methods List Section -->
199
+ <div class="mb-8">
200
+ <div class="flex justify-between items-center mb-4">
201
+ <h2 class="text-xl font-semibold text-gray-900 dark:text-white">Security Methods</h2>
202
+ <p id="filtered-count" class="text-sm text-gray-500 dark:text-gray-400">Showing <span id="shown-count">0</span> of <span id="total-count">0</span> methods</p>
203
+ </div>
204
+
205
+ <div id="methods-container" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
206
+ <!-- Method cards will be populated by JavaScript -->
207
+ </div>
208
+
209
+ <div id="no-results" class="hidden text-center py-12">
210
+ <i class="fas fa-search text-4xl text-gray-400 mb-4"></i>
211
+ <h3 class="text-xl font-medium text-gray-700 dark:text-gray-300">No methods found</h3>
212
+ <p class="text-gray-500 dark:text-gray-400 mt-2">Try adjusting your search or filters</p>
213
+ </div>
214
+ </div>
215
+ </main>
216
+
217
+ <!-- Method Detail Modal -->
218
+ <div id="method-modal" class="fixed inset-0 z-50 hidden overflow-y-auto">
219
+ <div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
220
+ <div class="fixed inset-0 transition-opacity" aria-hidden="true">
221
+ <div class="absolute inset-0 bg-gray-500 dark:bg-gray-900 opacity-75"></div>
222
+ </div>
223
+
224
+ <span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">&#8203;</span>
225
+
226
+ <div class="inline-block align-bottom bg-white dark:bg-gray-800 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full">
227
+ <div class="px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
228
+ <div class="sm:flex sm:items-start">
229
+ <div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full">
230
+ <div class="flex justify-between items-start">
231
+ <div>
232
+ <h3 id="modal-title" class="text-2xl leading-6 font-bold text-gray-900 dark:text-white"></h3>
233
+ <div id="modal-category" class="mt-1 text-sm text-blue-600 dark:text-blue-400 font-medium"></div>
234
+ </div>
235
+ <button id="close-modal" class="text-gray-400 hover:text-gray-500 dark:hover:text-gray-300">
236
+ <i class="fas fa-times"></i>
237
+ </button>
238
+ </div>
239
+
240
+ <div class="mt-4">
241
+ <div class="mb-6">
242
+ <h4 class="text-lg font-medium text-gray-900 dark:text-white mb-2">Description</h4>
243
+ <p id="modal-description" class="text-gray-700 dark:text-gray-300"></p>
244
+ </div>
245
+
246
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
247
+ <div>
248
+ <h4 class="text-lg font-medium text-gray-900 dark:text-white mb-2">Attack Type</h4>
249
+ <div id="modal-attack-type" class="flex flex-wrap gap-2"></div>
250
+ </div>
251
+
252
+ <div>
253
+ <h4 class="text-lg font-medium text-gray-900 dark:text-white mb-2">Severity</h4>
254
+ <div id="modal-severity" class="inline-block px-3 py-1 rounded-full text-sm font-medium"></div>
255
+ </div>
256
+ </div>
257
+
258
+ <div class="mt-6">
259
+ <h4 class="text-lg font-medium text-gray-900 dark:text-white mb-2">Mitigation</h4>
260
+ <div id="modal-mitigation" class="flex flex-wrap gap-2"></div>
261
+ </div>
262
+
263
+ <div class="mt-6">
264
+ <h4 class="text-lg font-medium text-gray-900 dark:text-white mb-2">References</h4>
265
+ <div id="modal-references" class="space-y-2"></div>
266
+ </div>
267
+ </div>
268
+ </div>
269
+ </div>
270
+ </div>
271
+ <div class="px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse bg-gray-50 dark:bg-gray-700 rounded-b-lg">
272
+ <button type="button" id="modal-close-btn" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm">
273
+ Close
274
+ </button>
275
+ </div>
276
+ </div>
277
+ </div>
278
+ </div>
279
+ </div>
280
+
281
+ <script>
282
+ // Sample data - in a real app, this would come from an API
283
+ const securityData = {
284
+ categories: [
285
+ {
286
+ name: "XSS",
287
+ methods: [
288
+ {
289
+ name: "Reflected XSS",
290
+ description: "Reflected Cross-Site Scripting (XSS) occurs when malicious script is reflected off a web application to the victim's browser. The script is embedded into a link and is activated when the victim clicks on it.",
291
+ attackType: ["Web"],
292
+ severity: "High",
293
+ mitigation: ["Input Validation", "Output Encoding", "Content Security Policy (CSP)"],
294
+ references: [
295
+ { text: "OWASP XSS Prevention Cheat Sheet", url: "https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html" },
296
+ { text: "PortSwigger XSS", url: "https://portswigger.net/web-security/cross-site-scripting" }
297
+ ]
298
+ },
299
+ {
300
+ name: "Stored XSS",
301
+ description: "Stored XSS (also known as Persistent or Type-II XSS) occurs when the malicious script is permanently stored on the target servers, such as in a database, message forum, visitor log, comment field, etc.",
302
+ attackType: ["Web", "Database"],
303
+ severity: "Critical",
304
+ mitigation: ["Input Sanitization", "Output Encoding", "Content Security Policy (CSP)"],
305
+ references: [
306
+ { text: "OWASP XSS Prevention Cheat Sheet", url: "https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html" }
307
+ ]
308
+ },
309
+ {
310
+ name: "DOM XSS",
311
+ description: "DOM-based XSS (or type-0 XSS) occurs when the client-side JavaScript writes user-provided data to the Document Object Model (DOM) without proper sanitization.",
312
+ attackType: ["Web", "Client-side"],
313
+ severity: "High",
314
+ mitigation: ["Context-aware Output Encoding", "Avoid unsafe JavaScript functions", "Content Security Policy (CSP)"],
315
+ references: [
316
+ { text: "OWASP DOM XSS Prevention", url: "https://cheatsheetseries.owasp.org/cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.html" }
317
+ ]
318
+ }
319
+ ]
320
+ },
321
+ {
322
+ name: "DDoS",
323
+ methods: [
324
+ {
325
+ name: "DNS Amplification",
326
+ description: "DNS amplification is a type of DDoS attack that exploits open DNS resolvers to overwhelm a target with DNS response traffic.",
327
+ attackType: ["Network", "Protocol"],
328
+ severity: "High",
329
+ mitigation: ["Rate limiting", "Anycast network diffusion", "DNS Response Rate Limiting (RRL)"],
330
+ references: [
331
+ { text: "Cloudflare DNS Amplification", url: "https://www.cloudflare.com/learning/ddos/dns-amplification-ddos-attack/" }
332
+ ]
333
+ },
334
+ {
335
+ name: "SYN Flood",
336
+ description: "A SYN flood is a form of denial-of-service attack in which an attacker rapidly initiates a connection to a server without finalizing the connection.",
337
+ attackType: ["Network", "Protocol"],
338
+ severity: "High",
339
+ mitigation: ["SYN cookies", "Firewall rules", "Intrusion Prevention Systems"],
340
+ references: [
341
+ { text: "Cloudflare SYN Flood", url: "https://www.cloudflare.com/learning/ddos/syn-flood-ddos-attack/" }
342
+ ]
343
+ }
344
+ ]
345
+ },
346
+ {
347
+ name: "TLS",
348
+ methods: [
349
+ {
350
+ name: "BEAST Attack",
351
+ description: "The BEAST (Browser Exploit Against SSL/TLS) attack is a security vulnerability against the confidentiality of the SSL 3.0 and TLS 1.0 protocols.",
352
+ attackType: ["Web", "Encryption"],
353
+ severity: "Medium",
354
+ mitigation: ["Disable SSL 3.0", "Use TLS 1.1 or higher", "Implement TLS_FALLBACK_SCSV"],
355
+ references: [
356
+ { text: "OWASP Transport Layer Protection Cheat Sheet", url: "https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Protection_Cheat_Sheet.html" }
357
+ ]
358
+ },
359
+ {
360
+ name: "POODLE",
361
+ description: "The POODLE (Padding Oracle On Downgraded Legacy Encryption) attack is a man-in-the-middle exploit that takes advantage of Internet and security software clients' fallback to SSL 3.0.",
362
+ attackType: ["Web", "Encryption"],
363
+ severity: "Medium",
364
+ mitigation: ["Disable SSL 3.0", "Use TLS_FALLBACK_SCSV", "Implement TLS 1.2 or higher"],
365
+ references: [
366
+ { text: "OWASP Transport Layer Protection Cheat Sheet", url: "https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Protection_Cheat_Sheet.html" }
367
+ ]
368
+ }
369
+ ]
370
+ },
371
+ {
372
+ name: "Authentication",
373
+ methods: [
374
+ {
375
+ name: "Credential Stuffing",
376
+ description: "Credential stuffing is the automated injection of breached username/password pairs in order to fraudulently gain access to user accounts.",
377
+ attackType: ["Web", "Authentication"],
378
+ severity: "High",
379
+ mitigation: ["Multi-factor authentication", "Passwordless authentication", "Rate limiting login attempts"],
380
+ references: [
381
+ { text: "OWASP Credential Stuffing Prevention", url: "https://owasp.org/www-community/attacks/Credential_stuffing" }
382
+ ]
383
+ },
384
+ {
385
+ name: "Brute Force",
386
+ description: "A brute force attack is a trial-and-error method used to obtain information such as a user password or personal identification number (PIN).",
387
+ attackType: ["Web", "Authentication"],
388
+ severity: "Medium",
389
+ mitigation: ["Account lockout policies", "Rate limiting", "Multi-factor authentication"],
390
+ references: [
391
+ { text: "OWASP Authentication Cheat Sheet", url: "https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html" }
392
+ ]
393
+ }
394
+ ]
395
+ },
396
+ {
397
+ name: "Injection",
398
+ methods: [
399
+ {
400
+ name: "SQL Injection",
401
+ description: "SQL injection is a code injection technique that might destroy your database. It is one of the most common web hacking techniques.",
402
+ attackType: ["Web", "Database"],
403
+ severity: "Critical",
404
+ mitigation: ["Prepared statements", "Stored procedures", "Input validation"],
405
+ references: [
406
+ { text: "OWASP SQL Injection Prevention", url: "https://owasp.org/www-community/attacks/SQL_Injection" }
407
+ ]
408
+ },
409
+ {
410
+ name: "Command Injection",
411
+ description: "Command injection is an attack in which the goal is execution of arbitrary commands on the host operating system via a vulnerable application.",
412
+ attackType: ["System", "OS"],
413
+ severity: "Critical",
414
+ mitigation: ["Input validation", "Parameterized APIs", "Principle of least privilege"],
415
+ references: [
416
+ { text: "OWASP Command Injection", url: "https://owasp.org/www-community/attacks/Command_Injection" }
417
+ ]
418
+ }
419
+ ]
420
+ }
421
+ ]
422
+ };
423
+
424
+ // DOM Elements
425
+ const searchInput = document.getElementById('search');
426
+ const categoryFilter = document.getElementById('category-filter');
427
+ const methodsContainer = document.getElementById('methods-container');
428
+ const noResults = document.getElementById('no-results');
429
+ const totalMethods = document.getElementById('total-methods');
430
+ const totalCategories = document.getElementById('total-categories');
431
+ const commonMitigation = document.getElementById('common-mitigation');
432
+ const shownCount = document.getElementById('shown-count');
433
+ const totalCount = document.getElementById('total-count');
434
+ const filteredCount = document.getElementById('filtered-count');
435
+ const advancedFiltersToggle = document.getElementById('advanced-filters-toggle');
436
+ const advancedFilters = document.getElementById('advanced-filters');
437
+ const advancedFiltersArrow = document.getElementById('advanced-filters-arrow');
438
+ const themeToggle = document.getElementById('theme-toggle');
439
+ const exportBtn = document.getElementById('export-btn');
440
+ const methodModal = document.getElementById('method-modal');
441
+ const modalTitle = document.getElementById('modal-title');
442
+ const modalCategory = document.getElementById('modal-category');
443
+ const modalDescription = document.getElementById('modal-description');
444
+ const modalAttackType = document.getElementById('modal-attack-type');
445
+ const modalSeverity = document.getElementById('modal-severity');
446
+ const modalMitigation = document.getElementById('modal-mitigation');
447
+ const modalReferences = document.getElementById('modal-references');
448
+ const modalCloseBtn = document.getElementById('modal-close-btn');
449
+ const closeModal = document.getElementById('close-modal');
450
+ const chartBar = document.getElementById('chart-bar');
451
+ const chartPie = document.getElementById('chart-pie');
452
+ const chartDoughnut = document.getElementById('chart-doughnut');
453
+
454
+ // Chart variables
455
+ let methodsChart;
456
+ let currentChartType = 'bar';
457
+
458
+ // Initialize the app
459
+ function init() {
460
+ // Calculate stats
461
+ calculateStats();
462
+
463
+ // Populate category filter
464
+ populateCategoryFilter();
465
+
466
+ // Render all methods
467
+ renderMethods(securityData.categories.flatMap(c => c.methods));
468
+
469
+ // Initialize chart
470
+ initChart();
471
+
472
+ // Set up event listeners
473
+ setupEventListeners();
474
+
475
+ // Check for saved theme preference
476
+ checkThemePreference();
477
+ }
478
+
479
+ // Calculate statistics
480
+ function calculateStats() {
481
+ const allMethods = securityData.categories.flatMap(c => c.methods);
482
+ totalMethods.textContent = allMethods.length;
483
+ totalCategories.textContent = securityData.categories.length;
484
+
485
+ // Find most common mitigation
486
+ const mitigationCounts = {};
487
+ allMethods.forEach(method => {
488
+ method.mitigation.forEach(mit => {
489
+ mitigationCounts[mit] = (mitigationCounts[mit] || 0) + 1;
490
+ });
491
+ });
492
+
493
+ const mostCommon = Object.entries(mitigationCounts).sort((a, b) => b[1] - a[1])[0];
494
+ commonMitigation.textContent = mostCommon ? mostCommon[0] : '-';
495
+ }
496
+
497
+ // Populate category filter dropdown
498
+ function populateCategoryFilter() {
499
+ securityData.categories.forEach(category => {
500
+ const option = document.createElement('option');
501
+ option.value = category.name;
502
+ option.textContent = category.name;
503
+ categoryFilter.appendChild(option);
504
+ });
505
+ }
506
+
507
+ // Render methods to the UI
508
+ function renderMethods(methods, searchTerm = '') {
509
+ methodsContainer.innerHTML = '';
510
+
511
+ if (methods.length === 0) {
512
+ noResults.classList.remove('hidden');
513
+ filteredCount.classList.add('hidden');
514
+ return;
515
+ }
516
+
517
+ noResults.classList.add('hidden');
518
+ filteredCount.classList.remove('hidden');
519
+
520
+ shownCount.textContent = methods.length;
521
+ totalCount.textContent = securityData.categories.flatMap(c => c.methods).length;
522
+
523
+ methods.forEach(method => {
524
+ const category = securityData.categories.find(c =>
525
+ c.methods.some(m => m.name === method.name)
526
+ ).name;
527
+
528
+ const methodCard = document.createElement('div');
529
+ methodCard.className = 'bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 method-card transition-all duration-200 cursor-pointer hover:border-blue-500 border border-transparent';
530
+ methodCard.innerHTML = `
531
+ <div class="flex justify-between items-start mb-2">
532
+ <h3 class="text-lg font-semibold text-gray-900 dark:text-white">${highlightSearchTerm(method.name, searchTerm)}</h3>
533
+ <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200">
534
+ ${category}
535
+ </span>
536
+ </div>
537
+ <p class="text-gray-600 dark:text-gray-400 text-sm mb-4 line-clamp-2">${method.description}</p>
538
+ <div class="flex flex-wrap gap-2 mb-4">
539
+ ${method.attackType.map(type => `
540
+ <span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200">
541
+ ${type}
542
+ </span>
543
+ `).join('')}
544
+ </div>
545
+ <div class="flex justify-between items-center">
546
+ <div class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${getSeverityClass(method.severity)}">
547
+ ${method.severity}
548
+ </div>
549
+ <button class="text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 text-sm font-medium">
550
+ View details <i class="fas fa-arrow-right ml-1"></i>
551
+ </button>
552
+ </div>
553
+ `;
554
+
555
+ methodCard.addEventListener('click', () => openMethodModal(method, category));
556
+ methodsContainer.appendChild(methodCard);
557
+ });
558
+ }
559
+
560
+ // Highlight search term in text
561
+ function highlightSearchTerm(text, term) {
562
+ if (!term) return text;
563
+
564
+ const regex = new RegExp(term, 'gi');
565
+ return text.replace(regex, match => `<span class="search-highlight">${match}</span>`);
566
+ }
567
+
568
+ // Get severity CSS class
569
+ function getSeverityClass(severity) {
570
+ const classes = {
571
+ 'Critical': 'bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200',
572
+ 'High': 'bg-orange-100 dark:bg-orange-900 text-orange-800 dark:text-orange-200',
573
+ 'Medium': 'bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200',
574
+ 'Low': 'bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200'
575
+ };
576
+ return classes[severity] || 'bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200';
577
+ }
578
+
579
+ // Filter methods based on search and filters
580
+ function filterMethods() {
581
+ const searchTerm = searchInput.value.toLowerCase();
582
+ const category = categoryFilter.value;
583
+
584
+ // Get all methods
585
+ let methods = securityData.categories.flatMap(c =>
586
+ c.methods.map(m => ({ ...m, category: c.name }))
587
+ );
588
+
589
+ // Apply category filter
590
+ if (category !== 'all') {
591
+ methods = methods.filter(m => m.category === category);
592
+ }
593
+
594
+ // Apply search term filter
595
+ if (searchTerm) {
596
+ methods = methods.filter(m =>
597
+ m.name.toLowerCase().includes(searchTerm) ||
598
+ m.description.toLowerCase().includes(searchTerm) ||
599
+ m.category.toLowerCase().includes(searchTerm) ||
600
+ m.attackType.some(t => t.toLowerCase().includes(searchTerm)) ||
601
+ m.mitigation.some(m => m.toLowerCase().includes(searchTerm))
602
+ );
603
+ }
604
+
605
+ // Apply advanced filters if visible
606
+ if (!advancedFilters.classList.contains('hidden')) {
607
+ // Attack type filters
608
+ const attackWeb = document.getElementById('attack-web').checked;
609
+ const attackNetwork = document.getElementById('attack-network').checked;
610
+ const attackSystem = document.getElementById('attack-system').checked;
611
+
612
+ if (attackWeb || attackNetwork || attackSystem) {
613
+ const attackFilters = [];
614
+ if (attackWeb) attackFilters.push('Web');
615
+ if (attackNetwork) attackFilters.push('Network');
616
+ if (attackSystem) attackFilters.push('System');
617
+
618
+ methods = methods.filter(m =>
619
+ m.attackType.some(t => attackFilters.includes(t))
620
+ );
621
+ }
622
+
623
+ // Mitigation filters
624
+ const mitigationEncryption = document.getElementById('mitigation-encryption').checked;
625
+ const mitigationValidation = document.getElementById('mitigation-validation').checked;
626
+ const mitigationMonitoring = document.getElementById('mitigation-monitoring').checked;
627
+
628
+ if (mitigationEncryption || mitigationValidation || mitigationMonitoring) {
629
+ const mitigationFilters = [];
630
+ if (mitigationEncryption) mitigationFilters.push('Encryption');
631
+ if (mitigationValidation) mitigationFilters.push('Validation');
632
+ if (mitigationMonitoring) mitigationFilters.push('Monitoring');
633
+
634
+ methods = methods.filter(m =>
635
+ m.mitigation.some(mit =>
636
+ mitigationFilters.some(filter => mit.includes(filter))
637
+ )
638
+ );
639
+ }
640
+
641
+ // Severity filters
642
+ const severityHigh = document.getElementById('severity-high').checked;
643
+ const severityMedium = document.getElementById('severity-medium').checked;
644
+ const severityLow = document.getElementById('severity-low').checked;
645
+
646
+ if (severityHigh || severityMedium || severityLow) {
647
+ const severityFilters = [];
648
+ if (severityHigh) severityFilters.push('High', 'Critical');
649
+ if (severityMedium) severityFilters.push('Medium');
650
+ if (severityLow) severityFilters.push('Low');
651
+
652
+ methods = methods.filter(m => severityFilters.includes(m.severity));
653
+ }
654
+ }
655
+
656
+ // Render filtered methods
657
+ renderMethods(methods, searchTerm);
658
+
659
+ // Update chart
660
+ updateChart(methods);
661
+ }
662
+
663
+ // Initialize chart
664
+ function initChart() {
665
+ const ctx = document.getElementById('methods-chart').getContext('2d');
666
+
667
+ // Get initial data
668
+ const allMethods = securityData.categories.flatMap(c => c.methods);
669
+ const chartData = prepareChartData(allMethods);
670
+
671
+ methodsChart = new Chart(ctx, {
672
+ type: currentChartType,
673
+ data: chartData,
674
+ options: {
675
+ responsive: true,
676
+ maintainAspectRatio: false,
677
+ plugins: {
678
+ legend: {
679
+ position: 'top',
680
+ labels: {
681
+ color: window.matchMedia('(prefers-color-scheme: dark)').matches ? '#fff' : '#333'
682
+ }
683
+ },
684
+ tooltip: {
685
+ callbacks: {
686
+ label: function(context) {
687
+ return `${context.label}: ${context.raw} methods`;
688
+ }
689
+ }
690
+ }
691
+ },
692
+ scales: {
693
+ y: {
694
+ beginAtZero: true,
695
+ ticks: {
696
+ color: window.matchMedia('(prefers-color-scheme: dark)').matches ? '#fff' : '#333'
697
+ },
698
+ grid: {
699
+ color: window.matchMedia('(prefers-color-scheme: dark)').matches ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)'
700
+ }
701
+ },
702
+ x: {
703
+ ticks: {
704
+ color: window.matchMedia('(prefers-color-scheme: dark)').matches ? '#fff' : '#333'
705
+ },
706
+ grid: {
707
+ color: window.matchMedia('(prefers-color-scheme: dark)').matches ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)'
708
+ }
709
+ }
710
+ }
711
+ }
712
+ });
713
+ }
714
+
715
+ // Prepare chart data
716
+ function prepareChartData(methods) {
717
+ // Group by category
718
+ const categoryCounts = {};
719
+ securityData.categories.forEach(category => {
720
+ const count = methods.filter(m =>
721
+ securityData.categories.find(c =>
722
+ c.methods.some(cm => cm.name === m.name)
723
+ )?.name === category.name
724
+ ).length;
725
+
726
+ if (count > 0) {
727
+ categoryCounts[category.name] = count;
728
+ }
729
+ });
730
+
731
+ // Group by severity
732
+ const severityCounts = {};
733
+ const severities = ['Critical', 'High', 'Medium', 'Low'];
734
+ severities.forEach(severity => {
735
+ const count = methods.filter(m => m.severity === severity).length;
736
+ if (count > 0) {
737
+ severityCounts[severity] = count;
738
+ }
739
+ });
740
+
741
+ // Determine which grouping to use based on current filter state
742
+ let labels, data, backgroundColor, borderColor;
743
+
744
+ if (categoryFilter.value === 'all' || Object.keys(categoryCounts).length > 1) {
745
+ // Use category grouping
746
+ labels = Object.keys(categoryCounts);
747
+ data = Object.values(categoryCounts);
748
+
749
+ // Generate colors based on category
750
+ backgroundColor = [
751
+ 'rgba(59, 130, 246, 0.7)', // XSS - blue
752
+ 'rgba(239, 68, 68, 0.7)', // DDoS - red
753
+ 'rgba(16, 185, 129, 0.7)', // TLS - green
754
+ 'rgba(245, 158, 11, 0.7)', // Authentication - yellow
755
+ 'rgba(139, 92, 246, 0.7)' // Injection - purple
756
+ ].slice(0, labels.length);
757
+
758
+ borderColor = backgroundColor.map(c => c.replace('0.7', '1'));
759
+ } else {
760
+ // Use severity grouping
761
+ labels = Object.keys(severityCounts);
762
+ data = Object.values(severityCounts);
763
+
764
+ // Generate colors based on severity
765
+ backgroundColor = labels.map(label => {
766
+ switch(label) {
767
+ case 'Critical': return 'rgba(239, 68, 68, 0.7)'; // red
768
+ case 'High': return 'rgba(245, 158, 11, 0.7)'; // yellow
769
+ case 'Medium': return 'rgba(59, 130, 246, 0.7)'; // blue
770
+ case 'Low': return 'rgba(16, 185, 129, 0.7)'; // green
771
+ default: return 'rgba(156, 163, 175, 0.7)'; // gray
772
+ }
773
+ });
774
+
775
+ borderColor = backgroundColor.map(c => c.replace('0.7', '1'));
776
+ }
777
+
778
+ return {
779
+ labels: labels,
780
+ datasets: [{
781
+ label: 'Number of Methods',
782
+ data: data,
783
+ backgroundColor: backgroundColor,
784
+ borderColor: borderColor,
785
+ borderWidth: 1
786
+ }]
787
+ };
788
+ }
789
+
790
+ // Update chart with filtered data
791
+ function updateChart(methods) {
792
+ const chartData = prepareChartData(methods);
793
+
794
+ // Change chart type if needed
795
+ if (methodsChart.config.type !== currentChartType) {
796
+ methodsChart.destroy();
797
+ const ctx = document.getElementById('methods-chart').getContext('2d');
798
+ methodsChart = new Chart(ctx, {
799
+ type: currentChartType,
800
+ data: chartData,
801
+ options: {
802
+ responsive: true,
803
+ maintainAspectRatio: false,
804
+ plugins: {
805
+ legend: {
806
+ position: 'top',
807
+ labels: {
808
+ color: window.matchMedia('(prefers-color-scheme: dark)').matches ? '#fff' : '#333'
809
+ }
810
+ },
811
+ tooltip: {
812
+ callbacks: {
813
+ label: function(context) {
814
+ return `${context.label}: ${context.raw} methods`;
815
+ }
816
+ }
817
+ }
818
+ },
819
+ scales: currentChartType === 'bar' ? {
820
+ y: {
821
+ beginAtZero: true,
822
+ ticks: {
823
+ color: window.matchMedia('(prefers-color-scheme: dark)').matches ? '#fff' : '#333'
824
+ },
825
+ grid: {
826
+ color: window.matchMedia('(prefers-color-scheme: dark)').matches ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)'
827
+ }
828
+ },
829
+ x: {
830
+ ticks: {
831
+ color: window.matchMedia('(prefers-color-scheme: dark)').matches ? '#fff' : '#333'
832
+ },
833
+ grid: {
834
+ color: window.matchMedia('(prefers-color-scheme: dark)').matches ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.1)'
835
+ }
836
+ }
837
+ } : undefined
838
+ }
839
+ });
840
+ } else {
841
+ methodsChart.data = chartData;
842
+ methodsChart.update();
843
+ }
844
+ }
845
+
846
+ // Open method details modal
847
+ function openMethodModal(method, category) {
848
+ modalTitle.textContent = method.name;
849
+ modalCategory.textContent = category;
850
+ modalDescription.textContent = method.description;
851
+
852
+ // Clear previous content
853
+ modalAttackType.innerHTML = '';
854
+ modalMitigation.innerHTML = '';
855
+ modalReferences.innerHTML = '';
856
+
857
+ // Add attack types
858
+ method.attackType.forEach(type => {
859
+ const badge = document.createElement('span');
860
+ badge.className = 'inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200';
861
+ badge.textContent = type;
862
+ modalAttackType.appendChild(badge);
863
+ });
864
+
865
+ // Add severity
866
+ modalSeverity.className = `inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${getSeverityClass(method.severity)}`;
867
+ modalSeverity.textContent = method.severity;
868
+
869
+ // Add mitigations
870
+ method.mitigation.forEach(mit => {
871
+ const badge = document.createElement('span');
872
+ badge.className = 'inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200';
873
+ badge.textContent = mit;
874
+ modalMitigation.appendChild(badge);
875
+ });
876
+
877
+ // Add references
878
+ method.references.forEach(ref => {
879
+ const refLink = document.createElement('a');
880
+ refLink.href = ref.url;
881
+ refLink.target = '_blank';
882
+ refLink.rel = 'noopener noreferrer';
883
+ refLink.className = 'flex items-center text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 text-sm';
884
+ refLink.innerHTML = `<i class="fas fa-external-link-alt mr-2"></i> ${ref.text}`;
885
+
886
+ const refItem = document.createElement('div');
887
+ refItem.className = 'flex items-center';
888
+ refItem.appendChild(refLink);
889
+
890
+ modalReferences.appendChild(refItem);
891
+ });
892
+
893
+ // Show modal
894
+ methodModal.classList.remove('hidden');
895
+ document.body.style.overflow = 'hidden';
896
+ }
897
+
898
+ // Close method details modal
899
+ function closeMethodModal() {
900
+ methodModal.classList.add('hidden');
901
+ document.body.style.overflow = 'auto';
902
+ }
903
+
904
+ // Check for saved theme preference
905
+ function checkThemePreference() {
906
+ const savedTheme = localStorage.getItem('theme') ||
907
+ (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
908
+
909
+ if (savedTheme === 'dark') {
910
+ document.documentElement.classList.add('dark');
911
+ themeToggle.innerHTML = '<i class="fas fa-sun"></i>';
912
+ } else {
913
+ document.documentElement.classList.remove('dark');
914
+ themeToggle.innerHTML = '<i class="fas fa-moon"></i>';
915
+ }
916
+ }
917
+
918
+ // Toggle dark/light theme
919
+ function toggleTheme() {
920
+ if (document.documentElement.classList.contains('dark')) {
921
+ document.documentElement.classList.remove('dark');
922
+ localStorage.setItem('theme', 'light');
923
+ themeToggle.innerHTML = '<i class="fas fa-moon"></i>';
924
+ } else {
925
+ document.documentElement.classList.add('dark');
926
+ localStorage.setItem('theme', 'dark');
927
+ themeToggle.innerHTML = '<i class="fas fa-sun"></i>';
928
+ }
929
+
930
+ // Update chart colors
931
+ if (methodsChart) {
932
+ methodsChart.update();
933
+ }
934
+ }
935
+
936
+ // Export data as JSON
937
+ function exportData() {
938
+ const data = {
939
+ categories: securityData.categories,
940
+ timestamp: new Date().toISOString()
941
+ };
942
+
943
+ const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' });
944
+ const url = URL.createObjectURL(blob);
945
+
946
+ const a = document.createElement('a');
947
+ a.href = url;
948
+ a.download = 'it-security-methods.json';
949
+ document.body.appendChild(a);
950
+ a.click();
951
+ document.body.removeChild(a);
952
+ URL.revokeObjectURL(url);
953
+ }
954
+
955
+ // Set up event listeners
956
+ function setupEventListeners() {
957
+ // Search and filter events
958
+ searchInput.addEventListener('input', filterMethods);
959
+ categoryFilter.addEventListener('change', filterMethods);
960
+
961
+ // Advanced filters toggle
962
+ advancedFiltersToggle.addEventListener('click', () => {
963
+ advancedFilters.classList.toggle('hidden');
964
+ advancedFiltersArrow.classList.toggle('fa-chevron-down');
965
+ advancedFiltersArrow.classList.toggle('fa-chevron-up');
966
+ filterMethods();
967
+ });
968
+
969
+ // Advanced filter checkboxes
970
+ document.querySelectorAll('#advanced-filters input[type="checkbox"]').forEach(checkbox => {
971
+ checkbox.addEventListener('change', filterMethods);
972
+ });
973
+
974
+ // Theme toggle
975
+ themeToggle.addEventListener('click', toggleTheme);
976
+
977
+ // Export button
978
+ exportBtn.addEventListener('click', exportData);
979
+
980
+ // Modal close events
981
+ modalCloseBtn.addEventListener('click', closeMethodModal);
982
+ closeModal.addEventListener('click', closeMethodModal);
983
+
984
+ // Close modal when clicking outside
985
+ methodModal.addEventListener('click', (e) => {
986
+ if (e.target === methodModal) {
987
+ closeMethodModal();
988
+ }
989
+ });
990
+
991
+ // Chart type buttons
992
+ chartBar.addEventListener('click', () => {
993
+ currentChartType = 'bar';
994
+ chartBar.className = 'px-3 py-1 text-sm bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-md';
995
+ chartPie.className = 'px-3 py-1 text-sm bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-md';
996
+ chartDoughnut.className = 'px-3 py-1 text-sm bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-md';
997
+ updateChart(getFilteredMethods());
998
+ });
999
+
1000
+ chartPie.addEventListener('click', () => {
1001
+ currentChartType = 'pie';
1002
+ chartBar.className = 'px-3 py-1 text-sm bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-md';
1003
+ chartPie.className = 'px-3 py-1 text-sm bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-md';
1004
+ chartDoughnut.className = 'px-3 py-1 text-sm bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-md';
1005
+ updateChart(getFilteredMethods());
1006
+ });
1007
+
1008
+ chartDoughnut.addEventListener('click', () => {
1009
+ currentChartType = 'doughnut';
1010
+ chartBar.className = 'px-3 py-1 text-sm bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-md';
1011
+ chartPie.className = 'px-3 py-1 text-sm bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200 rounded-md';
1012
+ chartDoughnut.className = 'px-3 py-1 text-sm bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 rounded-md';
1013
+ updateChart(getFilteredMethods());
1014
+ });
1015
+ }
1016
+
1017
+ // Get currently filtered methods
1018
+ function getFilteredMethods() {
1019
+ const searchTerm = searchInput.value.toLowerCase();
1020
+ const category = categoryFilter.value;
1021
+
1022
+ let methods = securityData.categories.flatMap(c =>
1023
+ c.methods.map(m => ({ ...m, category: c.name }))
1024
+ );
1025
+
1026
+ if (category !== 'all') {
1027
+ methods = methods.filter(m => m.category === category);
1028
+ }
1029
+
1030
+ if (searchTerm) {
1031
+ methods = methods.filter(m =>
1032
+ m.name.toLowerCase().includes(searchTerm) ||
1033
+ m.description.toLowerCase().includes(searchTerm) ||
1034
+ m.category.toLowerCase().includes(searchTerm) ||
1035
+ m.attackType.some(t => t.toLowerCase().includes(searchTerm)) ||
1036
+ m.mitigation.some(m => m.toLowerCase().includes(searchTerm))
1037
+ );
1038
+ }
1039
+
1040
+ return methods;
1041
+ }
1042
+
1043
+ // Initialize the application
1044
+ document.addEventListener('DOMContentLoaded', init);
1045
+ </script>
1046
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=CYRAGE/itsecdash" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
1047
+ </html>