Upload files to "cybersecurity/Network Reputation Service"

This commit is contained in:
2025-09-04 13:26:42 +02:00
parent dbce1cb2a3
commit ed4c37af89
7 changed files with 2065 additions and 0 deletions

View File

@@ -0,0 +1,295 @@
# 🛡️ Firewall-Audit - Network Reputation Service
![Version](https://img.shields.io/badge/version-1.3-blue.svg)
![PowerShell](https://img.shields.io/badge/PowerShell-5.1+-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
Ein professionelles PowerShell-Audit-Tool zur Bewertung der Filtereffektivität Ihrer Firewall durch das Testen kategorisierter URLs basierend auf ihrer Netzwerk-Reputation.
## 📋 Inhaltsverzeichnis
- [Überblick](#-überblick)
- [Funktionen](#-funktionen)
- [Voraussetzungen](#-voraussetzungen)
- [Installation](#-installation)
- [Nutzung](#-nutzung)
- [Konfiguration](#-konfiguration)
- [Generierter Bericht](#-generierter-bericht)
- [Datenstruktur](#-datenstruktur)
- [Bewertungssystem](#-bewertungssystem)
- [Fehlerbehebung](#-fehlerbehebung)
- [Mitwirken](#-mitwirken)
- [Lizenz](#-lizenz)
## 🎯 Überblick
Dieses PowerShell-Skript testet die Effektivität Ihrer Firewall, indem es überprüft, dass schädliche URLs korrekt blockiert werden, während legitime Websites zugänglich bleiben. Es generiert einen professionellen HTML-Bericht mit Bewertung, Statistiken und Empfehlungen.
**Autor:** Hubert Cornet
**Version:** 1.3
**Datum:** 3. September 2025
## ✨ Funktionen
- 🔍 **Automatisiertes Testen** von Hunderten kategorisierter URLs
- 📊 **Intelligente Bewertung** mit Noten von A+ bis F
- 📱 **Responsive HTML-Berichte** mit interaktiver Benutzeroberfläche
- 🔧 **Proxy-Unterstützung** mit Authentifizierung
-**Echtzeit-Fortschrittsbalken**
- 🎨 **Farbkodierte Visualisierungen** der Ergebnisse
- 💾 **JSON-Export** der Rohdaten
- 🌐 **Multi-Methoden-Erkennung** von Blockierungen
## 📋 Voraussetzungen
### Systemanforderungen
- Windows 10/11 oder Windows Server 2016+
- PowerShell 5.1 oder höher
- Aktive Internetverbindung
- Schreibrechte im Skript-Verzeichnis
### PowerShell-Module (werden automatisch installiert)
- `PSWriteHTML`
- `PSWriteColor`
### Erforderliche Dateien
- `file-nrs.json` - Datenbank kategorisierter URLs
## 🚀 Installation
1. **Laden Sie das Skript** in einen dedizierten Ordner herunter
2. **Laden Sie die JSON-Datei** von hier herunter:
```
https://gitea.tips-of-mine.com/Tips-Of-Mine/Powershell/src/branch/main/cybersecurity/Network%20Reputation%20Service/file-nrs.json
```
3. **Platzieren Sie beide Dateien** im selben Verzeichnis
## 💻 Nutzung
### Grundlegende Nutzung
```powershell
.\AuditFirewall.ps1
```
### Mit Proxy
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.unternehmen.com:8080"
```
### Mit Proxy-Authentifizierung
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.unternehmen.com:8080" -ProxyUseAuthentication
```
### Mit benutzerdefiniertem Timeout
```powershell
.\AuditFirewall.ps1 -TimeoutSeconds 15
```
## ⚙️ Konfiguration
### Verfügbare Parameter
| Parameter | Typ | Beschreibung | Standard |
|-----------|-----|--------------|----------|
| `ProxyUrl` | String | Netzwerk-Proxy-URL | Keine |
| `ProxyUseAuthentication` | Switch | Proxy-Authentifizierung aktivieren | False |
| `TimeoutSeconds` | Integer | Timeout pro URL | 10 |
### Anpassung der Block-Schlüsselwörter
Bearbeiten Sie die Variable `$BlockKeywords` im Skript:
```powershell
$BlockKeywords = @("Seite blockiert", "Zugriff verweigert", "Web-Filterung", "Access Denied", "Site Blocked")
```
## 📊 Generierter Bericht
Das Skript generiert automatisch:
### 📁 Ausgabe-Dateistruktur
```
Rapports/
└── [Datum und Uhrzeit]/
├── Audit_Firewall_Report.html # Hauptbericht
└── Results.json # Rohdaten
```
### 🎨 HTML-Berichtsinhalt
- **Zusammenfassung**: Gesamtpunktzahl und wichtige Statistiken
- **Punktetabelle**: Leistung nach Kategorie
- **Interaktive Details**: Einzelne Tests pro URL
- **Bewertungsskala**: Erklärung des Bewertungssystems
## 📁 Datenstruktur
### Format von `file-nrs.json`
```json
{
"categorie": [
{
"id": "malware",
"nom": "Malware",
"description": "Websites, die schädliche Software verbreiten",
"urls": [
{
"url": "http://beispiel-malware.com",
"reputation": "malicious",
"expected_action": "block"
},
{
"url": "https://legitime-website.com",
"reputation": "safe",
"expected_action": "allow"
}
]
}
]
}
```
### Erwartete Aktionen
- `"block"`: URL sollte von der Firewall blockiert werden
- `"allow"`: URL sollte zugänglich bleiben
## 📈 Bewertungssystem
### Notenskala
| Note | Punktzahl | Interpretation |
|------|-----------|---------------|
| **A+** | 95-100% | 🟢 Ausgezeichnet / Perfekt |
| **A** | 90-95% | 🟢 Sehr gutes Filtering-Niveau |
| **B+** | 85-90% | 🟡 Sehr gut |
| **B** | 80-85% | 🟡 Gut, einige Anpassungen nötig |
| **C+** | 75-80% | 🟠 Ziemlich gut |
| **C** | 70-75% | 🟠 Durchschnittlich, erhebliche Lücken |
| **D+** | 65-70% | 🔴 Akzeptabel |
| **D** | 60-65% | 🔴 Schwach, ineffektives Filtering |
| **E+** | 55-60% | 🔴 Sehr schwach |
| **E** | 50-55% | 🔴 Unzureichend |
| **F+** | 45-50% | ⚫ Kritisch |
| **F** | 0-45% | ⚫ Sofortige Maßnahmen erforderlich |
### Berechnungsmethode
```
Punktzahl = (Korrekt gefilterte URLs / Gesamtzahl getesteter URLs) × 100
```
## 🔍 Erkennungsmethoden
### Wie das Skript Blockierungen erkennt:
1. **Inhaltsanalyse**: Suche nach Schlüsselwörtern von Blockierungsseiten
2. **Netzwerk-Timeouts**: Anfragen, die ablaufen (wahrscheinliche Firewall-Blockierung)
3. **Verbindungsfehler**: Unfähigkeit, den Server zu erreichen
4. **HTTP-Statuscodes**: Analyse der Serverantworten
### Simulierte HTTP-Header:
Das Skript simuliert einen modernen Browser, um Erkennung zu vermeiden:
```
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36...
Accept: text/html,application/xhtml+xml,application/xml...
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
```
## 🔧 Fehlerbehebung
### Häufige Probleme
#### ❌ "Datei 'file-nrs.json' existiert nicht!"
**Lösung:** Laden Sie die JSON-Datei vom bereitgestellten Link herunter und platzieren Sie sie im selben Ordner wie das Skript.
#### ❌ "Modul X kann nicht installiert werden"
**Lösung:** Führen Sie PowerShell als Administrator aus oder verwenden Sie:
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```
#### ❌ Häufige Timeouts
**Lösungen:**
- Erhöhen Sie den `-TimeoutSeconds` Wert
- Überprüfen Sie Ihre Netzwerkverbindung
- Konfigurieren Sie die Proxy-Einstellungen korrekt
#### ❌ Falsch-Positive/Negative
**Lösungen:**
- Aktualisieren Sie die Block-Schlüsselwörter
- Überprüfen Sie die Firewall-Konfiguration
- Passen Sie die JSON-Datei an Ihre Umgebung an
## 🏢 Empfohlene Anwendungsfälle
### 📅 Regelmäßige Nutzung
- **Monatliches Audit** der Firewall-Effektivität
- **Validierung** nach Regel-Updates
- **Benchmarking** zwischen Sicherheitslösungen
### 👥 Management-Berichterstattung
- **Dashboards** für IT-Management
- **Messbare Sicherheits-KPIs**
- **Investitionsbegründung** für Sicherheit
### 🔧 Konfigurationstests
- **Validierung** nach Netzwerkänderungen
- **Regressionstests** der Firewall-Regeln
- **Sicherheits-Compliance-Audit**
## ⚠️ Technische Einschränkungen
### Beachtenswertes:
- **Sequenzielle Tests**: Keine Parallelisierung (kann langsam sein)
- **Grundlegende Erkennung**: Basiert auf vordefinierten Schlüsselwörtern
- **Falsch-Positive**: Legitime Websites zeitweise unzugänglich
- **Sicherheit**: Skript kontaktiert tatsächlich getestete URLs
### Best Practices:
1. 🕐 Führen Sie während schwacher Verkehrszeiten aus
2. 📊 Analysieren Sie Ergebnisse im Kontext
3. 🔄 Halten Sie JSON-Datei aktuell
4. 📈 Verfolgen Sie die Entwicklung der Punktzahlen über Zeit
## 🤝 Mitwirken
### Um beizutragen:
1. Forken Sie das Projekt
2. Erstellen Sie Ihren Feature-Branch
3. Committen Sie Ihre Änderungen
4. Pushen Sie zum Branch
5. Öffnen Sie eine Pull Request
### Verbesserungsideen:
- [ ] Test-Parallelisierung für bessere Performance
- [ ] Ausgeklügeltere Blockseiten-Erkennung
- [ ] Externe Reputationsdatenbank-Unterstützung
- [ ] Grafische Benutzeroberfläche für Konfiguration
- [ ] Threat Intelligence API-Integration
## 🎯 Roadmap
### Version 1.4 (geplant)
- [ ] Parallele Tests für verbesserte Performance
- [ ] Benutzerdefinierte SSL-Zertifikat-Unterstützung
- [ ] E-Mail-Benachrichtigungen für Ergebnisse
### Version 2.0 (zukünftig)
- [ ] Web-Interface für Konfiguration
- [ ] SIEM-Lösungsintegration
- [ ] REST API für Automatisierung
## 📞 Support
Für Hilfe oder um Probleme zu melden:
- 📧 Kontaktieren Sie den Autor: Hubert Cornet
- 🐛 Öffnen Sie ein Issue im Projekt-Repository
- 📚 Konsultieren Sie die technische Dokumentation
## 📄 Lizenz
Dieses Projekt steht unter MIT-Lizenz. Siehe die `LICENSE`-Datei für weitere Details.
---
**⭐ Wenn Ihnen dieses Skript nützlich war, geben Sie ihm gerne einen Stern!**
---
*Zuletzt aktualisiert: 3. September 2025*

View File

@@ -0,0 +1,295 @@
# 🛡️ Firewall Audit - Network Reputation Service
![Version](https://img.shields.io/badge/version-1.3-blue.svg)
![PowerShell](https://img.shields.io/badge/PowerShell-5.1+-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
A professional PowerShell audit tool to evaluate your firewall's filtering effectiveness by testing categorized URLs based on their network reputation.
## 📋 Table of Contents
- [Overview](#-overview)
- [Features](#-features)
- [Prerequisites](#-prerequisites)
- [Installation](#-installation)
- [Usage](#-usage)
- [Configuration](#-configuration)
- [Generated Report](#-generated-report)
- [Data Structure](#-data-structure)
- [Scoring System](#-scoring-system)
- [Troubleshooting](#-troubleshooting)
- [Contributing](#-contributing)
- [License](#-license)
## 🎯 Overview
This PowerShell script tests your firewall's effectiveness by verifying that malicious URLs are correctly blocked while legitimate sites remain accessible. It generates a professional HTML report with scoring, statistics, and recommendations.
**Author:** Hubert Cornet
**Version:** 1.3
**Date:** September 3, 2025
## ✨ Features
- 🔍 **Automated testing** of hundreds of categorized URLs
- 📊 **Smart scoring** with grades from A+ to F
- 📱 **Responsive HTML report** with interactive interface
- 🔧 **Proxy support** with authentication
-**Real-time progress bars**
- 🎨 **Color-coded visualizations** of results
- 💾 **JSON export** of raw data
- 🌐 **Multi-method detection** of blocks
## 📋 Prerequisites
### System Requirements
- Windows 10/11 or Windows Server 2016+
- PowerShell 5.1 or higher
- Active Internet connection
- Write permissions in the script directory
### PowerShell Modules (installed automatically)
- `PSWriteHTML`
- `PSWriteColor`
### Required Files
- `file-nrs.json` - Categorized URLs database
## 🚀 Installation
1. **Download the script** to a dedicated folder
2. **Download the JSON file** from:
```
https://gitea.tips-of-mine.com/Tips-Of-Mine/Powershell/src/branch/main/cybersecurity/Network%20Reputation%20Service/file-nrs.json
```
3. **Place both files** in the same directory
## 💻 Usage
### Basic Usage
```powershell
.\AuditFirewall.ps1
```
### With Proxy
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.company.com:8080"
```
### With Proxy Authentication
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.company.com:8080" -ProxyUseAuthentication
```
### With Custom Timeout
```powershell
.\AuditFirewall.ps1 -TimeoutSeconds 15
```
## ⚙️ Configuration
### Available Parameters
| Parameter | Type | Description | Default |
|-----------|------|-------------|---------|
| `ProxyUrl` | String | Network proxy URL | None |
| `ProxyUseAuthentication` | Switch | Enable proxy auth | False |
| `TimeoutSeconds` | Integer | Timeout per URL | 10 |
### Customizing Block Keywords
Modify the `$BlockKeywords` variable in the script:
```powershell
$BlockKeywords = @("site blocked", "access denied", "web filtering", "Access Denied", "Site Blocked")
```
## 📊 Generated Report
The script automatically generates:
### 📁 Output File Structure
```
Reports/
└── [Date and Time]/
├── Audit_Firewall_Report.html # Main report
└── Results.json # Raw data
```
### 🎨 HTML Report Content
- **Executive Summary**: Global score and key statistics
- **Score Table**: Performance by category
- **Interactive Details**: Individual tests by URL
- **Grading Scale**: Scoring system explanation
## 📁 Data Structure
### `file-nrs.json` Format
```json
{
"categorie": [
{
"id": "malware",
"nom": "Malware",
"description": "Sites distributing malicious software",
"urls": [
{
"url": "http://example-malware.com",
"reputation": "malicious",
"expected_action": "block"
},
{
"url": "https://legitimate-site.com",
"reputation": "safe",
"expected_action": "allow"
}
]
}
]
}
```
### Expected Actions
- `"block"`: URL should be blocked by firewall
- `"allow"`: URL should remain accessible
## 📈 Scoring System
### Grading Scale
| Grade | Score | Interpretation |
|-------|--------|---------------|
| **A+** | 95-100% | 🟢 Excellent / Perfect |
| **A** | 90-95% | 🟢 Very good filtering level |
| **B+** | 85-90% | 🟡 Very good |
| **B** | 80-85% | 🟡 Good, some adjustments needed |
| **C+** | 75-80% | 🟠 Fairly good |
| **C** | 70-75% | 🟠 Average, significant gaps |
| **D+** | 65-70% | 🔴 Acceptable |
| **D** | 60-65% | 🔴 Weak, ineffective filtering |
| **E+** | 55-60% | 🔴 Very weak |
| **E** | 50-55% | 🔴 Insufficient |
| **F+** | 45-50% | ⚫ Critical |
| **F** | 0-45% | ⚫ Immediate action required |
### Calculation Method
```
Score = (Correctly filtered URLs / Total tested URLs) × 100
```
## 🔍 Detection Methods
### How the script detects blocks:
1. **Content Analysis**: Search for block page keywords
2. **Network Timeouts**: Requests that expire (probable firewall block)
3. **Connection Errors**: Unable to reach the server
4. **HTTP Status Codes**: Analysis of server responses
### Simulated HTTP Headers:
The script simulates a modern browser to avoid detection:
```
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36...
Accept: text/html,application/xhtml+xml,application/xml...
Accept-Language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7
```
## 🔧 Troubleshooting
### Common Issues
#### ❌ "File 'file-nrs.json' does not exist!"
**Solution:** Download the JSON file from the provided link and place it in the same folder as the script.
#### ❌ "Cannot install module X"
**Solution:** Run PowerShell as administrator or use:
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```
#### ❌ Frequent Timeouts
**Solutions:**
- Increase `-TimeoutSeconds` value
- Check your network connection
- Configure proxy settings correctly
#### ❌ False Positives/Negatives
**Solutions:**
- Update block keywords
- Verify firewall configuration
- Adapt JSON file to your environment
## 🏢 Recommended Use Cases
### 📅 Periodic Usage
- **Monthly audit** of firewall effectiveness
- **Validation** after rule updates
- **Benchmarking** between security solutions
### 👥 Management Reporting
- **Dashboards** for IT management
- **Measurable security KPIs**
- **Investment justification** for security
### 🔧 Configuration Testing
- **Validation** after network changes
- **Regression testing** of firewall rules
- **Security compliance audit**
## ⚠️ Technical Limitations
### Points of Attention:
- **Sequential Testing**: No parallelization (can be slow)
- **Basic Detection**: Relies on predefined keywords
- **False Positives**: Legitimate sites temporarily inaccessible
- **Security**: Script actually contacts tested URLs
### Best Practices:
1. 🕐 Run during off-peak hours
2. 📊 Analyze results in context
3. 🔄 Keep JSON file updated
4. 📈 Track score evolution over time
## 🤝 Contributing
### To Contribute:
1. Fork the project
2. Create your feature branch
3. Commit your changes
4. Push to the branch
5. Open a Pull Request
### Improvement Ideas:
- [ ] Test parallelization for better performance
- [ ] More sophisticated block page detection
- [ ] External reputation database support
- [ ] Graphical interface for configuration
- [ ] Threat intelligence API integration
## 🎯 Roadmap
### Version 1.4 (planned)
- [ ] Parallel testing for improved performance
- [ ] Custom SSL certificate support
- [ ] Email notifications for results
### Version 2.0 (future)
- [ ] Web interface for configuration
- [ ] SIEM solution integration
- [ ] REST API for automation
## 📞 Support
For help or to report issues:
- 📧 Contact the author: Hubert Cornet
- 🐛 Open an issue on the project repository
- 📚 Consult the technical documentation
## 📄 License
This project is under MIT license. See the `LICENSE` file for more details.
---
**⭐ If this script was useful to you, feel free to give it a star!**
---
*Last updated: September 3, 2025*

View File

@@ -0,0 +1,295 @@
# 🛡️ Auditoría de Firewall - Network Reputation Service
![Version](https://img.shields.io/badge/version-1.3-blue.svg)
![PowerShell](https://img.shields.io/badge/PowerShell-5.1+-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
Una herramienta profesional de auditoría en PowerShell para evaluar la efectividad del filtrado de su firewall mediante pruebas de URLs categorizadas basadas en su reputación de red.
## 📋 Índice de Contenidos
- [Visión General](#-visión-general)
- [Características](#-características)
- [Prerequisitos](#-prerequisitos)
- [Instalación](#-instalación)
- [Uso](#-uso)
- [Configuración](#-configuración)
- [Informe Generado](#-informe-generado)
- [Estructura de Datos](#-estructura-de-datos)
- [Sistema de Puntuación](#-sistema-de-puntuación)
- [Resolución de Problemas](#-resolución-de-problemas)
- [Contribuir](#-contribuir)
- [Licencia](#-licencia)
## 🎯 Visión General
Este script de PowerShell prueba la efectividad de su firewall verificando que las URLs maliciosas sean correctamente bloqueadas mientras que los sitios legítimos permanezcan accesibles. Genera un informe HTML profesional con puntuación, estadísticas y recomendaciones.
**Autor:** Hubert Cornet
**Versión:** 1.3
**Fecha:** 3 de septiembre de 2025
## ✨ Características
- 🔍 **Pruebas automatizadas** de cientos de URLs categorizadas
- 📊 **Puntuación inteligente** con calificaciones de A+ a F
- 📱 **Informe HTML responsive** con interfaz interactiva
- 🔧 **Soporte de proxy** con autenticación
-**Barras de progreso en tiempo real**
- 🎨 **Visualizaciones codificadas por colores** de resultados
- 💾 **Exportación JSON** de datos en bruto
- 🌐 **Detección multi-método** de bloqueos
## 📋 Prerequisitos
### Requisitos del Sistema
- Windows 10/11 o Windows Server 2016+
- PowerShell 5.1 o superior
- Conexión a Internet activa
- Permisos de escritura en el directorio del script
### Módulos de PowerShell (instalados automáticamente)
- `PSWriteHTML`
- `PSWriteColor`
### Archivos Requeridos
- `file-nrs.json` - Base de datos de URLs categorizadas
## 🚀 Instalación
1. **Descargue el script** en una carpeta dedicada
2. **Descargue el archivo JSON** desde:
```
https://gitea.tips-of-mine.com/Tips-Of-Mine/Powershell/src/branch/main/cybersecurity/Network%20Reputation%20Service/file-nrs.json
```
3. **Coloque ambos archivos** en el mismo directorio
## 💻 Uso
### Uso Básico
```powershell
.\AuditFirewall.ps1
```
### Con Proxy
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.empresa.com:8080"
```
### Con Autenticación de Proxy
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.empresa.com:8080" -ProxyUseAuthentication
```
### Con Timeout Personalizado
```powershell
.\AuditFirewall.ps1 -TimeoutSeconds 15
```
## ⚙️ Configuración
### Parámetros Disponibles
| Parámetro | Tipo | Descripción | Por Defecto |
|-----------|------|-------------|-------------|
| `ProxyUrl` | String | URL del proxy de red | Ninguno |
| `ProxyUseAuthentication` | Switch | Activar autenticación de proxy | False |
| `TimeoutSeconds` | Integer | Timeout por URL | 10 |
### Personalización de Palabras Clave de Bloqueo
Modifique la variable `$BlockKeywords` en el script:
```powershell
$BlockKeywords = @("sitio bloqueado", "acceso denegado", "filtrado web", "Access Denied", "Site Blocked")
```
## 📊 Informe Generado
El script genera automáticamente:
### 📁 Estructura de Archivos de Salida
```
Rapports/
└── [Fecha y Hora]/
├── Audit_Firewall_Report.html # Informe principal
└── Results.json # Datos en bruto
```
### 🎨 Contenido del Informe HTML
- **Resumen Ejecutivo**: Puntuación global y estadísticas clave
- **Tabla de Puntuaciones**: Rendimiento por categoría
- **Detalles Interactivos**: Pruebas individuales por URL
- **Escala de Calificación**: Explicación del sistema de puntuación
## 📁 Estructura de Datos
### Formato de `file-nrs.json`
```json
{
"categorie": [
{
"id": "malware",
"nom": "Malware",
"description": "Sitios que distribuyen software malicioso",
"urls": [
{
"url": "http://ejemplo-malware.com",
"reputation": "malicious",
"expected_action": "block"
},
{
"url": "https://sitio-legitimo.com",
"reputation": "safe",
"expected_action": "allow"
}
]
}
]
}
```
### Acciones Esperadas
- `"block"`: La URL debe ser bloqueada por el firewall
- `"allow"`: La URL debe permanecer accesible
## 📈 Sistema de Puntuación
### Escala de Calificación
| Calificación | Puntuación | Interpretación |
|--------------|------------|---------------|
| **A+** | 95-100% | 🟢 Excelente / Perfecto |
| **A** | 90-95% | 🟢 Muy buen nivel de filtrado |
| **B+** | 85-90% | 🟡 Muy bueno |
| **B** | 80-85% | 🟡 Bueno, algunos ajustes necesarios |
| **C+** | 75-80% | 🟠 Bastante bueno |
| **C** | 70-75% | 🟠 Promedio, brechas significativas |
| **D+** | 65-70% | 🔴 Aceptable |
| **D** | 60-65% | 🔴 Débil, filtrado ineficaz |
| **E+** | 55-60% | 🔴 Muy débil |
| **E** | 50-55% | 🔴 Insuficiente |
| **F+** | 45-50% | ⚫ Crítico |
| **F** | 0-45% | ⚫ Acción inmediata requerida |
### Método de Cálculo
```
Puntuación = (URLs correctamente filtradas / Total URLs probadas) × 100
```
## 🔍 Métodos de Detección
### Cómo el script detecta bloqueos:
1. **Análisis de Contenido**: Búsqueda de palabras clave de páginas de bloqueo
2. **Timeouts de Red**: Solicitudes que expiran (probable bloqueo de firewall)
3. **Errores de Conexión**: Incapacidad para alcanzar el servidor
4. **Códigos de Estado HTTP**: Análisis de respuestas del servidor
### Encabezados HTTP Simulados:
El script simula un navegador moderno para evitar detección:
```
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36...
Accept: text/html,application/xhtml+xml,application/xml...
Accept-Language: es-ES,es;q=0.9,en-US;q=0.8,en;q=0.7
```
## 🔧 Resolución de Problemas
### Problemas Comunes
#### ❌ "¡El archivo 'file-nrs.json' no existe!"
**Solución:** Descargue el archivo JSON del enlace proporcionado y colóquelo en la misma carpeta que el script.
#### ❌ "No se puede instalar el módulo X"
**Solución:** Ejecute PowerShell como administrador o use:
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```
#### ❌ Timeouts Frecuentes
**Soluciones:**
- Incremente el valor de `-TimeoutSeconds`
- Verifique su conexión de red
- Configure correctamente los ajustes de proxy
#### ❌ Falsos Positivos/Negativos
**Soluciones:**
- Actualice las palabras clave de bloqueo
- Verifique la configuración del firewall
- Adapte el archivo JSON a su entorno
## 🏢 Casos de Uso Recomendados
### 📅 Uso Periódico
- **Auditoría mensual** de efectividad del firewall
- **Validación** después de actualizaciones de reglas
- **Benchmarking** entre soluciones de seguridad
### 👥 Reportes Gerenciales
- **Dashboards** para gestión de TI
- **KPIs de seguridad** medibles
- **Justificación de inversión** en seguridad
### 🔧 Pruebas de Configuración
- **Validación** después de cambios de red
- **Pruebas de regresión** de reglas de firewall
- **Auditoría de cumplimiento** de seguridad
## ⚠️ Limitaciones Técnicas
### Puntos de Atención:
- **Pruebas Secuenciales**: Sin paralelización (puede ser lento)
- **Detección Básica**: Se basa en palabras clave predefinidas
- **Falsos Positivos**: Sitios legítimos temporalmente inaccesibles
- **Seguridad**: El script realmente contacta las URLs probadas
### Mejores Prácticas:
1. 🕐 Ejecutar durante horas de menor tráfico
2. 📊 Analizar resultados en contexto
3. 🔄 Mantener actualizado el archivo JSON
4. 📈 Seguir la evolución de las puntuaciones a lo largo del tiempo
## 🤝 Contribuir
### Para Contribuir:
1. Haga fork del proyecto
2. Cree su rama de característica
3. Haga commit de sus cambios
4. Push a la rama
5. Abra un Pull Request
### Ideas de Mejora:
- [ ] Paralelización de pruebas para mejor rendimiento
- [ ] Detección más sofisticada de páginas de bloqueo
- [ ] Soporte de bases de datos de reputación externas
- [ ] Interfaz gráfica para configuración
- [ ] Integración con APIs de threat intelligence
## 🎯 Hoja de Ruta
### Versión 1.4 (planificada)
- [ ] Pruebas paralelas para mejor rendimiento
- [ ] Soporte de certificados SSL personalizados
- [ ] Notificaciones por email de resultados
### Versión 2.0 (futuro)
- [ ] Interfaz web para configuración
- [ ] Integración con soluciones SIEM
- [ ] API REST para automatización
## 📞 Soporte
Para obtener ayuda o reportar problemas:
- 📧 Contacte al autor: Hubert Cornet
- 🐛 Abra un issue en el repositorio del proyecto
- 📚 Consulte la documentación técnica
## 📄 Licencia
Este proyecto está bajo licencia MIT. Ver el archivo `LICENSE` para más detalles.
---
**⭐ ¡Si este script le fue útil, no dude en darle una estrella!**
---
*Última actualización: 3 de septiembre de 2025*

View File

@@ -0,0 +1,295 @@
# 🛡️ Audit Firewall - Network Reputation Service
![Version](https://img.shields.io/badge/version-1.3-blue.svg)
![PowerShell](https://img.shields.io/badge/PowerShell-5.1+-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
Un outil d'audit PowerShell professionnel pour évaluer l'efficacité du filtrage de votre firewall en testant des URLs catégorisées selon leur réputation réseau.
## 📋 Table des matières
- [Aperçu](#-aperçu)
- [Fonctionnalités](#-fonctionnalités)
- [Prérequis](#-prérequis)
- [Installation](#-installation)
- [Utilisation](#-utilisation)
- [Configuration](#-configuration)
- [Rapport généré](#-rapport-généré)
- [Structure des données](#-structure-des-données)
- [Système de scoring](#-système-de-scoring)
- [Dépannage](#-dépannage)
- [Contribution](#-contribution)
- [Licence](#-licence)
## 🎯 Aperçu
Ce script PowerShell teste l'efficacité de votre firewall en vérifiant si des URLs malveillantes sont correctement bloquées et si des sites légitimes restent accessibles. Il génère un rapport HTML professionnel avec scoring, statistiques et recommandations.
**Auteur :** Hubert Cornet
**Version :** 1.3
**Date :** 03/09/2025
## ✨ Fonctionnalités
- 🔍 **Test automatisé** de centaines d'URLs catégorisées
- 📊 **Scoring intelligent** avec notes de A+ à F
- 📱 **Rapport HTML responsive** avec interface interactive
- 🔧 **Support des proxies** avec authentification
-**Barres de progression** en temps réel
- 🎨 **Visualisations colorées** des résultats
- 💾 **Export JSON** des données brutes
- 🌐 **Détection multi-méthodes** des blocages
## 📋 Prérequis
### Système requis
- Windows 10/11 ou Windows Server 2016+
- PowerShell 5.1 ou supérieur
- Connexion Internet active
- Droits d'écriture dans le répertoire du script
### Modules PowerShell (installés automatiquement)
- `PSWriteHTML`
- `PSWriteColor`
### Fichiers requis
- `file-nrs.json` - Base de données des URLs catégorisées
## 🚀 Installation
1. **Téléchargez le script** dans un dossier dédié
2. **Téléchargez le fichier JSON** depuis :
```
https://gitea.tips-of-mine.com/Tips-Of-Mine/Powershell/src/branch/main/cybersecurity/Network%20Reputation%20Service/file-nrs.json
```
3. **Placez les deux fichiers** dans le même répertoire
## 💻 Utilisation
### Utilisation basique
```powershell
.\AuditFirewall.ps1
```
### Avec proxy
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.entreprise.com:8080"
```
### Avec authentification proxy
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.entreprise.com:8080" -ProxyUseAuthentication
```
### Avec timeout personnalisé
```powershell
.\AuditFirewall.ps1 -TimeoutSeconds 15
```
## ⚙️ Configuration
### Paramètres disponibles
| Paramètre | Type | Description | Défaut |
|-----------|------|-------------|---------|
| `ProxyUrl` | String | URL du proxy réseau | Aucun |
| `ProxyUseAuthentication` | Switch | Active l'auth proxy | False |
| `TimeoutSeconds` | Integer | Délai d'attente par URL | 10 |
### Personnalisation des mots-clés de blocage
Modifiez la variable `$BlockKeywords` dans le script :
```powershell
$BlockKeywords = @("site bloqué", "access denied", "filtrage web", "Access Denied", "Site Blocked")
```
## 📊 Rapport généré
Le script génère automatiquement :
### 📁 Structure des fichiers de sortie
```
Rapports/
└── [Date et Heure]/
├── Audit_Firewall_Report.html # Rapport principal
└── Results.json # Données brutes
```
### 🎨 Contenu du rapport HTML
- **Résumé exécutif** : Score global et statistiques clés
- **Tableau des scores** : Performance par catégorie
- **Détails interactifs** : Tests individuels par URL
- **Barème de notation** : Explication du système de scoring
## 📁 Structure des données
### Format du fichier `file-nrs.json`
```json
{
"categorie": [
{
"id": "malware",
"nom": "Malware",
"description": "Sites distribuant des logiciels malveillants",
"urls": [
{
"url": "http://example-malware.com",
"reputation": "malicious",
"expected_action": "block"
},
{
"url": "https://legitimate-site.com",
"reputation": "safe",
"expected_action": "allow"
}
]
}
]
}
```
### Actions attendues
- `"block"` : L'URL doit être bloquée par le firewall
- `"allow"` : L'URL doit rester accessible
## 📈 Système de scoring
### Barème de notation
| Note | Score | Interprétation |
|------|--------|---------------|
| **A+** | 95-100% | 🟢 Excellent / Parfait |
| **A** | 90-95% | 🟢 Très bon niveau de filtrage |
| **B+** | 85-90% | 🟡 Très bon |
| **B** | 80-85% | 🟡 Bon, quelques ajustements |
| **C+** | 75-80% | 🟠 Assez bon |
| **C** | 70-75% | 🟠 Moyen, lacunes importantes |
| **D+** | 65-70% | 🔴 Passable |
| **D** | 60-65% | 🔴 Faible, filtrage inefficace |
| **E+** | 55-60% | 🔴 Très faible |
| **E** | 50-55% | 🔴 Insuffisant |
| **F+** | 45-50% | ⚫ Critique |
| **F** | 0-45% | ⚫ Action immédiate requise |
### Méthode de calcul
```
Score = (URLs correctement filtrées / Total URLs testées) × 100
```
## 🔍 Méthodes de détection
### Comment le script détecte un blocage :
1. **Analyse du contenu** : Recherche de mots-clés de pages de blocage
2. **Timeouts réseau** : Requêtes qui expirent (probable blocage firewall)
3. **Erreurs de connexion** : Impossibilité d'atteindre le serveur
4. **Codes de statut HTTP** : Analyse des réponses serveur
### Headers HTTP simulés :
Le script simule un navigateur moderne pour éviter la détection :
```
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36...
Accept: text/html,application/xhtml+xml,application/xml...
Accept-Language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7
```
## 🔧 Dépannage
### Problèmes courants
#### ❌ "Le fichier 'file-nrs.json' n'existe pas!"
**Solution :** Téléchargez le fichier JSON depuis le lien fourni et placez-le dans le même dossier que le script.
#### ❌ "Impossible d'installer le module X"
**Solution :** Exécutez PowerShell en tant qu'administrateur ou utilisez :
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```
#### ❌ Timeouts fréquents
**Solutions :**
- Augmentez la valeur de `-TimeoutSeconds`
- Vérifiez votre connexion réseau
- Configurez correctement les paramètres proxy
#### ❌ Faux positifs/négatifs
**Solutions :**
- Mettez à jour les mots-clés de blocage
- Vérifiez la configuration de votre firewall
- Adaptez le fichier JSON à votre environnement
## 🏢 Cas d'usage recommandés
### 📅 Utilisation périodique
- **Audit mensuel** de l'efficacité du firewall
- **Validation** après mise à jour des règles
- **Benchmarking** entre solutions de sécurité
### 👥 Reporting managérial
- **Tableaux de bord** pour la direction IT
- **KPIs de sécurité** mesurables
- **Justification** des investissements sécurité
### 🔧 Tests de configuration
- **Validation** après changements réseau
- **Tests de régression** des règles firewall
- **Audit de conformité** sécurité
## ⚠️ Limitations techniques
### Points d'attention :
- **Tests séquentiels** : Pas de parallélisation (peut être lent)
- **Détection basique** : Repose sur des mots-clés prédéfinis
- **Faux positifs** : Sites légitimes temporairement inaccessibles
- **Sécurité** : Le script contacte réellement les URLs testées
### Bonnes pratiques :
1. 🕐 Exécuter en heures creuses
2. 📊 Analyser les résultats dans le contexte
3. 🔄 Maintenir à jour le fichier JSON
4. 📈 Suivre l'évolution des scores dans le temps
## 🤝 Contribution
### Pour contribuer :
1. Fork le projet
2. Créez votre branche feature
3. Committez vos changements
4. Poussez vers la branche
5. Ouvrez une Pull Request
### Idées d'améliorations :
- [ ] Parallélisation des tests pour améliorer les performances
- [ ] Détection plus sophistiquée des pages de blocage
- [ ] Support de bases de données de réputations externes
- [ ] Interface graphique pour la configuration
- [ ] Intégration avec des APIs de threat intelligence
## 🎯 Roadmap
### Version 1.4 (prévue)
- [ ] Tests parallèles pour améliorer les performances
- [ ] Support des certificats SSL personnalisés
- [ ] Notifications par email des résultats
### Version 2.0 (future)
- [ ] Interface web pour la configuration
- [ ] Intégration avec des solutions SIEM
- [ ] API REST pour l'automatisation
## 📞 Support
Pour obtenir de l'aide ou signaler des problèmes :
- 📧 Contactez l'auteur : Hubert Cornet
- 🐛 Ouvrez une issue sur le dépôt du projet
- 📚 Consultez la documentation technique
## 📄 Licence
Ce projet est sous licence MIT. Voir le fichier `LICENSE` pour plus de détails.
---
**⭐ Si ce script vous a été utile, n'hésitez pas à lui donner une étoile !**
---
*Dernière mise à jour : 03 septembre 2025*

View File

@@ -0,0 +1,295 @@
# 🛡️ Audit Firewall - Network Reputation Service
![Version](https://img.shields.io/badge/version-1.3-blue.svg)
![PowerShell](https://img.shields.io/badge/PowerShell-5.1+-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
Uno strumento professionale di audit PowerShell per valutare l'efficacia del filtraggio del tuo firewall testando URL categorizzati basati sulla loro reputazione di rete.
## 📋 Indice dei Contenuti
- [Panoramica](#-panoramica)
- [Caratteristiche](#-caratteristiche)
- [Prerequisiti](#-prerequisiti)
- [Installazione](#-installazione)
- [Utilizzo](#-utilizzo)
- [Configurazione](#-configurazione)
- [Report Generato](#-report-generato)
- [Struttura Dati](#-struttura-dati)
- [Sistema di Punteggio](#-sistema-di-punteggio)
- [Risoluzione Problemi](#-risoluzione-problemi)
- [Contribuire](#-contribuire)
- [Licenza](#-licenza)
## 🎯 Panoramica
Questo script PowerShell testa l'efficacia del tuo firewall verificando che gli URL malevoli siano correttamente bloccati mentre i siti legittimi rimangano accessibili. Genera un report HTML professionale con punteggi, statistiche e raccomandazioni.
**Autore:** Hubert Cornet
**Versione:** 1.3
**Data:** 3 settembre 2025
## ✨ Caratteristiche
- 🔍 **Test automatizzato** di centinaia di URL categorizzati
- 📊 **Punteggio intelligente** con voti da A+ a F
- 📱 **Report HTML responsive** con interfaccia interattiva
- 🔧 **Supporto proxy** con autenticazione
-**Barre di progresso in tempo reale**
- 🎨 **Visualizzazioni colorate** dei risultati
- 💾 **Esportazione JSON** dei dati grezzi
- 🌐 **Rilevamento multi-metodo** dei blocchi
## 📋 Prerequisiti
### Requisiti di Sistema
- Windows 10/11 o Windows Server 2016+
- PowerShell 5.1 o superiore
- Connessione Internet attiva
- Permessi di scrittura nella directory dello script
### Moduli PowerShell (installati automaticamente)
- `PSWriteHTML`
- `PSWriteColor`
### File Richiesti
- `file-nrs.json` - Database di URL categorizzati
## 🚀 Installazione
1. **Scarica lo script** in una cartella dedicata
2. **Scarica il file JSON** da:
```
https://gitea.tips-of-mine.com/Tips-Of-Mine/Powershell/src/branch/main/cybersecurity/Network%20Reputation%20Service/file-nrs.json
```
3. **Posiziona entrambi i file** nella stessa directory
## 💻 Utilizzo
### Utilizzo Base
```powershell
.\AuditFirewall.ps1
```
### Con Proxy
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.azienda.com:8080"
```
### Con Autenticazione Proxy
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.azienda.com:8080" -ProxyUseAuthentication
```
### Con Timeout Personalizzato
```powershell
.\AuditFirewall.ps1 -TimeoutSeconds 15
```
## ⚙️ Configurazione
### Parametri Disponibili
| Parametro | Tipo | Descrizione | Predefinito |
|-----------|------|-------------|-------------|
| `ProxyUrl` | String | URL del proxy di rete | Nessuno |
| `ProxyUseAuthentication` | Switch | Abilita autenticazione proxy | False |
| `TimeoutSeconds` | Integer | Timeout per URL | 10 |
### Personalizzazione Parole Chiave di Blocco
Modifica la variabile `$BlockKeywords` nello script:
```powershell
$BlockKeywords = @("sito bloccato", "accesso negato", "filtraggio web", "Access Denied", "Site Blocked")
```
## 📊 Report Generato
Lo script genera automaticamente:
### 📁 Struttura File di Output
```
Rapports/
└── [Data e Ora]/
├── Audit_Firewall_Report.html # Report principale
└── Results.json # Dati grezzi
```
### 🎨 Contenuto Report HTML
- **Riassunto Esecutivo**: Punteggio globale e statistiche chiave
- **Tabella Punteggi**: Performance per categoria
- **Dettagli Interattivi**: Test individuali per URL
- **Scala di Valutazione**: Spiegazione del sistema di punteggio
## 📁 Struttura Dati
### Formato `file-nrs.json`
```json
{
"categorie": [
{
"id": "malware",
"nom": "Malware",
"description": "Siti che distribuiscono software malevolo",
"urls": [
{
"url": "http://esempio-malware.com",
"reputation": "malicious",
"expected_action": "block"
},
{
"url": "https://sito-legittimo.com",
"reputation": "safe",
"expected_action": "allow"
}
]
}
]
}
```
### Azioni Attese
- `"block"`: L'URL dovrebbe essere bloccato dal firewall
- `"allow"`: L'URL dovrebbe rimanere accessibile
## 📈 Sistema di Punteggio
### Scala di Valutazione
| Voto | Punteggio | Interpretazione |
|------|-----------|-----------------|
| **A+** | 95-100% | 🟢 Eccellente / Perfetto |
| **A** | 90-95% | 🟢 Ottimo livello di filtraggio |
| **B+** | 85-90% | 🟡 Molto buono |
| **B** | 80-85% | 🟡 Buono, alcuni aggiustamenti necessari |
| **C+** | 75-80% | 🟠 Discreto |
| **C** | 70-75% | 🟠 Medio, lacune significative |
| **D+** | 65-70% | 🔴 Accettabile |
| **D** | 60-65% | 🔴 Debole, filtraggio inefficace |
| **E+** | 55-60% | 🔴 Molto debole |
| **E** | 50-55% | 🔴 Insufficiente |
| **F+** | 45-50% | ⚫ Critico |
| **F** | 0-45% | ⚫ Azione immediata richiesta |
### Metodo di Calcolo
```
Punteggio = (URL filtrati correttamente / Totale URL testati) × 100
```
## 🔍 Metodi di Rilevamento
### Come lo script rileva i blocchi:
1. **Analisi del Contenuto**: Ricerca parole chiave delle pagine di blocco
2. **Timeout di Rete**: Richieste che scadono (probabile blocco firewall)
3. **Errori di Connessione**: Incapacità di raggiungere il server
4. **Codici di Stato HTTP**: Analisi delle risposte del server
### Header HTTP Simulati:
Lo script simula un browser moderno per evitare il rilevamento:
```
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36...
Accept: text/html,application/xhtml+xml,application/xml...
Accept-Language: it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7
```
## 🔧 Risoluzione Problemi
### Problemi Comuni
#### ❌ "File 'file-nrs.json' non esiste!"
**Soluzione:** Scarica il file JSON dal link fornito e posizionalo nella stessa cartella dello script.
#### ❌ "Impossibile installare il modulo X"
**Soluzione:** Esegui PowerShell come amministratore o usa:
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```
#### ❌ Timeout Frequenti
**Soluzioni:**
- Aumenta il valore di `-TimeoutSeconds`
- Verifica la tua connessione di rete
- Configura correttamente le impostazioni proxy
#### ❌ Falsi Positivi/Negativi
**Soluzioni:**
- Aggiorna le parole chiave di blocco
- Verifica la configurazione del firewall
- Adatta il file JSON al tuo ambiente
## 🏢 Casi d'Uso Raccomandati
### 📅 Uso Periodico
- **Audit mensile** dell'efficacia del firewall
- **Validazione** dopo aggiornamenti delle regole
- **Benchmarking** tra soluzioni di sicurezza
### 👥 Report Manageriali
- **Dashboard** per il management IT
- **KPI di sicurezza** misurabili
- **Giustificazione investimenti** in sicurezza
### 🔧 Test di Configurazione
- **Validazione** dopo modifiche di rete
- **Test di regressione** delle regole firewall
- **Audit di conformità** della sicurezza
## ⚠️ Limitazioni Tecniche
### Punti di Attenzione:
- **Test Sequenziali**: Nessuna parallelizzazione (può essere lento)
- **Rilevamento Base**: Si basa su parole chiave predefinite
- **Falsi Positivi**: Siti legittimi temporaneamente inaccessibili
- **Sicurezza**: Lo script contatta effettivamente gli URL testati
### Best Practice:
1. 🕐 Esegui durante le ore di minor traffico
2. 📊 Analizza i risultati nel contesto
3. 🔄 Mantieni aggiornato il file JSON
4. 📈 Monitora l'evoluzione dei punteggi nel tempo
## 🤝 Contribuire
### Per Contribuire:
1. Fai fork del progetto
2. Crea il tuo branch feature
3. Committa le tue modifiche
4. Push al branch
5. Apri una Pull Request
### Idee di Miglioramento:
- [ ] Parallelizzazione test per migliori performance
- [ ] Rilevamento più sofisticato delle pagine di blocco
- [ ] Supporto database reputazione esterni
- [ ] Interfaccia grafica per la configurazione
- [ ] Integrazione con API di threat intelligence
## 🎯 Roadmap
### Versione 1.4 (pianificata)
- [ ] Test paralleli per performance migliorate
- [ ] Supporto certificati SSL personalizzati
- [ ] Notifiche email per i risultati
### Versione 2.0 (futuro)
- [ ] Interfaccia web per configurazione
- [ ] Integrazione con soluzioni SIEM
- [ ] API REST per automazione
## 📞 Supporto
Per aiuto o segnalare problemi:
- 📧 Contatta l'autore: Hubert Cornet
- 🐛 Apri un issue nel repository del progetto
- 📚 Consulta la documentazione tecnica
## 📄 Licenza
Questo progetto è sotto licenza MIT. Vedi il file `LICENSE` per maggiori dettagli.
---
**⭐ Se questo script ti è stato utile, non esitare a dargli una stella!**
---
*Ultimo aggiornamento: 3 settembre 2025*

View File

@@ -0,0 +1,295 @@
# 🛡️ Audyt Firewall - Network Reputation Service
![Version](https://img.shields.io/badge/version-1.3-blue.svg)
![PowerShell](https://img.shields.io/badge/PowerShell-5.1+-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
Profesjonalne narzędzie audytowe PowerShell do oceny skuteczności filtrowania zapory sieciowej poprzez testowanie skategoryzowanych URL-i na podstawie ich reputacji sieciowej.
## 📋 Spis Treści
- [Przegląd](#-przegląd)
- [Funkcje](#-funkcje)
- [Wymagania](#-wymagania)
- [Instalacja](#-instalacja)
- [Użycie](#-użycie)
- [Konfiguracja](#-konfiguracja)
- [Wygenerowany Raport](#-wygenerowany-raport)
- [Struktura Danych](#-struktura-danych)
- [System Punktacji](#-system-punktacji)
- [Rozwiązywanie Problemów](#-rozwiązywanie-problemów)
- [Współpraca](#-współpraca)
- [Licencja](#-licencja)
## 🎯 Przegląd
Ten skrypt PowerShell testuje skuteczność zapory sieciowej, sprawdzając czy złośliwe URL-e są prawidłowo blokowane, podczas gdy legalne strony pozostają dostępne. Generuje profesjonalny raport HTML z punktacją, statystykami i rekomendacjami.
**Autor:** Hubert Cornet
**Wersja:** 1.3
**Data:** 3 września 2025
## ✨ Funkcje
- 🔍 **Automatyczne testowanie** setek skategoryzowanych URL-i
- 📊 **Inteligentna punktacja** z ocenami od A+ do F
- 📱 **Responsywny raport HTML** z interaktywnym interfejsem
- 🔧 **Obsługa proxy** z uwierzytelnianiem
-**Paski postępu w czasie rzeczywistym**
- 🎨 **Kolorowe wizualizacje** wyników
- 💾 **Eksport JSON** surowych danych
- 🌐 **Wielometodowe wykrywanie** blokad
## 📋 Wymagania
### Wymagania Systemowe
- Windows 10/11 lub Windows Server 2016+
- PowerShell 5.1 lub wyższy
- Aktywne połączenie internetowe
- Uprawnienia do zapisu w katalogu skryptu
### Moduły PowerShell (instalowane automatycznie)
- `PSWriteHTML`
- `PSWriteColor`
### Wymagane Pliki
- `file-nrs.json` - Baza danych skategoryzowanych URL-i
## 🚀 Instalacja
1. **Pobierz skrypt** do dedykowanego folderu
2. **Pobierz plik JSON** z:
```
https://gitea.tips-of-mine.com/Tips-Of-Mine/Powershell/src/branch/main/cybersecurity/Network%20Reputation%20Service/file-nrs.json
```
3. **Umieść oba pliki** w tym samym katalogu
## 💻 Użycie
### Podstawowe Użycie
```powershell
.\AuditFirewall.ps1
```
### Z Proxy
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.firma.com:8080"
```
### Z Uwierzytelnianiem Proxy
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.firma.com:8080" -ProxyUseAuthentication
```
### Z Niestandardowym Limitem Czasu
```powershell
.\AuditFirewall.ps1 -TimeoutSeconds 15
```
## ⚙️ Konfiguracja
### Dostępne Parametry
| Parametr | Typ | Opis | Domyślny |
|----------|-----|------|----------|
| `ProxyUrl` | String | URL proxy sieciowego | Brak |
| `ProxyUseAuthentication` | Switch | Włącz uwierzytelnianie proxy | False |
| `TimeoutSeconds` | Integer | Limit czasu na URL | 10 |
### Dostosowanie Słów Kluczowych Blokady
Zmodyfikuj zmienną `$BlockKeywords` w skrypcie:
```powershell
$BlockKeywords = @("strona zablokowana", "dostęp zabroniony", "filtrowanie web", "Access Denied", "Site Blocked")
```
## 📊 Wygenerowany Raport
Skrypt automatycznie generuje:
### 📁 Struktura Plików Wyjściowych
```
Rapports/
└── [Data i Czas]/
├── Audit_Firewall_Report.html # Główny raport
└── Results.json # Surowe dane
```
### 🎨 Zawartość Raportu HTML
- **Streszczenie Wykonawcze**: Globalny wynik i kluczowe statystyki
- **Tabela Wyników**: Wydajność według kategorii
- **Interaktywne Szczegóły**: Indywidualne testy na URL
- **Skala Ocen**: Wyjaśnienie systemu punktacji
## 📁 Struktura Danych
### Format `file-nrs.json`
```json
{
"categorie": [
{
"id": "malware",
"nom": "Malware",
"description": "Strony dystrybuujące złośliwe oprogramowanie",
"urls": [
{
"url": "http://przykład-malware.com",
"reputation": "malicious",
"expected_action": "block"
},
{
"url": "https://legalna-strona.com",
"reputation": "safe",
"expected_action": "allow"
}
]
}
]
}
```
### Oczekiwane Działania
- `"block"`: URL powinien być zablokowany przez zaporę
- `"allow"`: URL powinien pozostać dostępny
## 📈 System Punktacji
### Skala Ocen
| Ocena | Punkty | Interpretacja |
|-------|--------|---------------|
| **A+** | 95-100% | 🟢 Doskonały / Idealny |
| **A** | 90-95% | 🟢 Bardzo dobry poziom filtrowania |
| **B+** | 85-90% | 🟡 Bardzo dobry |
| **B** | 80-85% | 🟡 Dobry, potrzebne pewne dostosowania |
| **C+** | 75-80% | 🟠 Dość dobry |
| **C** | 70-75% | 🟠 Średni, znaczące luki |
| **D+** | 65-70% | 🔴 Do zaakceptowania |
| **D** | 60-65% | 🔴 Słaby, nieefektywne filtrowanie |
| **E+** | 55-60% | 🔴 Bardzo słaby |
| **E** | 50-55% | 🔴 Niewystarczający |
| **F+** | 45-50% | ⚫ Krytyczny |
| **F** | 0-45% | ⚫ Wymagane natychmiastowe działanie |
### Metoda Obliczania
```
Punkty = (Poprawnie filtrowane URL-e / Łączna liczba testowanych URL-i) × 100
```
## 🔍 Metody Wykrywania
### Jak skrypt wykrywa blokady:
1. **Analiza Zawartości**: Wyszukiwanie słów kluczowych stron blokujących
2. **Limity Czasu Sieci**: Żądania, które wygasają (prawdopodobna blokada zapory)
3. **Błędy Połączenia**: Niemożność osiągnięcia serwera
4. **Kody Statusu HTTP**: Analiza odpowiedzi serwera
### Symulowane Nagłówki HTTP:
Skrypt symuluje nowoczesną przeglądarkę, aby uniknąć wykrycia:
```
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36...
Accept: text/html,application/xhtml+xml,application/xml...
Accept-Language: pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7
```
## 🔧 Rozwiązywanie Problemów
### Częste Problemy
#### ❌ "Plik 'file-nrs.json' nie istnieje!"
**Rozwiązanie:** Pobierz plik JSON z podanego linku i umieść go w tym samym folderze co skrypt.
#### ❌ "Nie można zainstalować modułu X"
**Rozwiązanie:** Uruchom PowerShell jako administrator lub użyj:
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```
#### ❌ Częste Limity Czasu
**Rozwiązania:**
- Zwiększ wartość `-TimeoutSeconds`
- Sprawdź połączenie sieciowe
- Poprawnie skonfiguruj ustawienia proxy
#### ❌ Fałszywe Pozytywne/Negatywne
**Rozwiązania:**
- Zaktualizuj słowa kluczowe blokady
- Sprawdź konfigurację zapory
- Dostosuj plik JSON do swojego środowiska
## 🏢 Zalecane Przypadki Użycia
### 📅 Użycie Okresowe
- **Miesięczny audyt** skuteczności zapory
- **Walidacja** po aktualizacjach reguł
- **Benchmarking** między rozwiązaniami bezpieczeństwa
### 👥 Raporty Zarządcze
- **Dashboardy** dla zarządzania IT
- **Mierzalne KPI bezpieczeństwa**
- **Uzasadnienie inwestycji** w bezpieczeństwo
### 🔧 Testy Konfiguracji
- **Walidacja** po zmianach sieciowych
- **Testy regresji** reguł zapory
- **Audyt zgodności** bezpieczeństwa
## ⚠️ Ograniczenia Techniczne
### Punkty Uwagi:
- **Testy Sekwencyjne**: Brak równoległości (może być wolne)
- **Podstawowe Wykrywanie**: Opiera się na predefiniowanych słowach kluczowych
- **Fałszywe Pozytywne**: Legalne strony czasowo niedostępne
- **Bezpieczeństwo**: Skrypt rzeczywiście kontaktuje się z testowanymi URL-ami
### Najlepsze Praktyki:
1. 🕐 Uruchamiaj podczas godzin mniejszego ruchu
2. 📊 Analizuj wyniki w kontekście
3. 🔄 Utrzymuj aktualny plik JSON
4. 📈 Śledź ewolucję wyników w czasie
## 🤝 Współpraca
### Aby Współpracować:
1. Zrób fork projektu
2. Utwórz swoją gałąź funkcji
3. Zatwierdź swoje zmiany
4. Wypchnij do gałęzi
5. Otwórz Pull Request
### Pomysły na Ulepszenia:
- [ ] Równoległość testów dla lepszej wydajności
- [ ] Bardziej wyrafinowane wykrywanie stron blokujących
- [ ] Obsługa zewnętrznych baz danych reputacji
- [ ] Interfejs graficzny do konfiguracji
- [ ] Integracja z API threat intelligence
## 🎯 Mapa Drogowa
### Wersja 1.4 (planowana)
- [ ] Testy równoległe dla lepszej wydajności
- [ ] Obsługa niestandardowych certyfikatów SSL
- [ ] Powiadomienia email o wynikach
### Wersja 2.0 (przyszłość)
- [ ] Interfejs webowy do konfiguracji
- [ ] Integracja z rozwiązaniami SIEM
- [ ] API REST do automatyzacji
## 📞 Wsparcie
Aby uzyskać pomoc lub zgłosić problemy:
- 📧 Skontaktuj się z autorem: Hubert Cornet
- 🐛 Otwórz issue w repozytorium projektu
- 📚 Zapoznaj się z dokumentacją techniczną
## 📄 Licencja
Ten projekt jest pod licencją MIT. Zobacz plik `LICENSE` po więcej szczegółów.
---
**⭐ Jeśli ten skrypt był dla Ciebie przydatny, nie wahaj się dać mu gwiazdkę!**
---
*Ostatnia aktualizacja: 3 września 2025*

View File

@@ -0,0 +1,295 @@
# 🛡️ Auditoria de Firewall - Network Reputation Service
![Version](https://img.shields.io/badge/version-1.3-blue.svg)
![PowerShell](https://img.shields.io/badge/PowerShell-5.1+-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
Uma ferramenta profissional de auditoria em PowerShell para avaliar a eficácia da filtragem do seu firewall testando URLs categorizadas baseadas na sua reputação de rede.
## 📋 Índice de Conteúdos
- [Visão Geral](#-visão-geral)
- [Características](#-características)
- [Pré-requisitos](#-pré-requisitos)
- [Instalação](#-instalação)
- [Uso](#-uso)
- [Configuração](#-configuração)
- [Relatório Gerado](#-relatório-gerado)
- [Estrutura de Dados](#-estrutura-de-dados)
- [Sistema de Pontuação](#-sistema-de-pontuação)
- [Resolução de Problemas](#-resolução-de-problemas)
- [Contribuir](#-contribuir)
- [Licença](#-licença)
## 🎯 Visão Geral
Este script PowerShell testa a eficácia do seu firewall verificando se URLs maliciosas são corretamente bloqueadas enquanto sites legítimos permanecem acessíveis. Gera um relatório HTML profissional com pontuação, estatísticas e recomendações.
**Autor:** Hubert Cornet
**Versão:** 1.3
**Data:** 3 de setembro de 2025
## ✨ Características
- 🔍 **Testes automatizados** de centenas de URLs categorizadas
- 📊 **Pontuação inteligente** com notas de A+ a F
- 📱 **Relatório HTML responsivo** com interface interativa
- 🔧 **Suporte a proxy** com autenticação
-**Barras de progresso em tempo real**
- 🎨 **Visualizações coloridas** dos resultados
- 💾 **Exportação JSON** dos dados brutos
- 🌐 **Detecção multi-método** de bloqueios
## 📋 Pré-requisitos
### Requisitos do Sistema
- Windows 10/11 ou Windows Server 2016+
- PowerShell 5.1 ou superior
- Conexão à Internet ativa
- Permissões de escrita no diretório do script
### Módulos PowerShell (instalados automaticamente)
- `PSWriteHTML`
- `PSWriteColor`
### Arquivos Necessários
- `file-nrs.json` - Base de dados de URLs categorizadas
## 🚀 Instalação
1. **Descarregue o script** numa pasta dedicada
2. **Descarregue o arquivo JSON** de:
```
https://gitea.tips-of-mine.com/Tips-Of-Mine/Powershell/src/branch/main/cybersecurity/Network%20Reputation%20Service/file-nrs.json
```
3. **Coloque ambos os arquivos** no mesmo diretório
## 💻 Uso
### Uso Básico
```powershell
.\AuditFirewall.ps1
```
### Com Proxy
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.empresa.com:8080"
```
### Com Autenticação de Proxy
```powershell
.\AuditFirewall.ps1 -ProxyUrl "http://proxy.empresa.com:8080" -ProxyUseAuthentication
```
### Com Timeout Personalizado
```powershell
.\AuditFirewall.ps1 -TimeoutSeconds 15
```
## ⚙️ Configuração
### Parâmetros Disponíveis
| Parâmetro | Tipo | Descrição | Padrão |
|-----------|------|-----------|---------|
| `ProxyUrl` | String | URL do proxy de rede | Nenhum |
| `ProxyUseAuthentication` | Switch | Ativar autenticação de proxy | False |
| `TimeoutSeconds` | Integer | Timeout por URL | 10 |
### Personalização das Palavras-chave de Bloqueio
Modifique a variável `$BlockKeywords` no script:
```powershell
$BlockKeywords = @("site bloqueado", "acesso negado", "filtragem web", "Access Denied", "Site Blocked")
```
## 📊 Relatório Gerado
O script gera automaticamente:
### 📁 Estrutura de Arquivos de Saída
```
Rapports/
└── [Data e Hora]/
├── Audit_Firewall_Report.html # Relatório principal
└── Results.json # Dados brutos
```
### 🎨 Conteúdo do Relatório HTML
- **Resumo Executivo**: Pontuação global e estatísticas-chave
- **Tabela de Pontuações**: Performance por categoria
- **Detalhes Interativos**: Testes individuais por URL
- **Escala de Avaliação**: Explicação do sistema de pontuação
## 📁 Estrutura de Dados
### Formato `file-nrs.json`
```json
{
"categorie": [
{
"id": "malware",
"nom": "Malware",
"description": "Sites que distribuem software malicioso",
"urls": [
{
"url": "http://exemplo-malware.com",
"reputation": "malicious",
"expected_action": "block"
},
{
"url": "https://site-legitimo.com",
"reputation": "safe",
"expected_action": "allow"
}
]
}
]
}
```
### Ações Esperadas
- `"block"`: A URL deve ser bloqueada pelo firewall
- `"allow"`: A URL deve permanecer acessível
## 📈 Sistema de Pontuação
### Escala de Avaliação
| Nota | Pontuação | Interpretação |
|------|-----------|---------------|
| **A+** | 95-100% | 🟢 Excelente / Perfeito |
| **A** | 90-95% | 🟢 Muito bom nível de filtragem |
| **B+** | 85-90% | 🟡 Muito bom |
| **B** | 80-85% | 🟡 Bom, alguns ajustes necessários |
| **C+** | 75-80% | 🟠 Razoavelmente bom |
| **C** | 70-75% | 🟠 Médio, lacunas significativas |
| **D+** | 65-70% | 🔴 Aceitável |
| **D** | 60-65% | 🔴 Fraco, filtragem ineficaz |
| **E+** | 55-60% | 🔴 Muito fraco |
| **E** | 50-55% | 🔴 Insuficiente |
| **F+** | 45-50% | ⚫ Crítico |
| **F** | 0-45% | ⚫ Ação imediata necessária |
### Método de Cálculo
```
Pontuação = (URLs filtradas corretamente / Total de URLs testadas) × 100
```
## 🔍 Métodos de Detecção
### Como o script deteta bloqueios:
1. **Análise de Conteúdo**: Procura por palavras-chave de páginas de bloqueio
2. **Timeouts de Rede**: Pedidos que expiram (provável bloqueio do firewall)
3. **Erros de Conexão**: Incapacidade de alcançar o servidor
4. **Códigos de Estado HTTP**: Análise das respostas do servidor
### Cabeçalhos HTTP Simulados:
O script simula um navegador moderno para evitar detecção:
```
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36...
Accept: text/html,application/xhtml+xml,application/xml...
Accept-Language: pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7
```
## 🔧 Resolução de Problemas
### Problemas Comuns
#### ❌ "Arquivo 'file-nrs.json' não existe!"
**Solução:** Descarregue o arquivo JSON do link fornecido e coloque-o na mesma pasta do script.
#### ❌ "Não é possível instalar o módulo X"
**Solução:** Execute PowerShell como administrador ou use:
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```
#### ❌ Timeouts Frequentes
**Soluções:**
- Aumente o valor de `-TimeoutSeconds`
- Verifique a sua conexão de rede
- Configure corretamente as definições de proxy
#### ❌ Falsos Positivos/Negativos
**Soluções:**
- Atualize as palavras-chave de bloqueio
- Verifique a configuração do firewall
- Adapte o arquivo JSON ao seu ambiente
## 🏢 Casos de Uso Recomendados
### 📅 Uso Periódico
- **Auditoria mensal** da eficácia do firewall
- **Validação** após atualizações de regras
- **Benchmarking** entre soluções de segurança
### 👥 Relatórios Gerenciais
- **Dashboards** para gestão de TI
- **KPIs de segurança** mensuráveis
- **Justificação de investimento** em segurança
### 🔧 Testes de Configuração
- **Validação** após mudanças de rede
- **Testes de regressão** das regras do firewall
- **Auditoria de conformidade** de segurança
## ⚠️ Limitações Técnicas
### Pontos de Atenção:
- **Testes Sequenciais**: Sem paralelização (pode ser lento)
- **Detecção Básica**: Baseia-se em palavras-chave predefinidas
- **Falsos Positivos**: Sites legítimos temporariamente inacessíveis
- **Segurança**: O script realmente contacta as URLs testadas
### Melhores Práticas:
1. 🕐 Execute durante horas de menor tráfego
2. 📊 Analise os resultados no contexto
3. 🔄 Mantenha o arquivo JSON atualizado
4. 📈 Acompanhe a evolução das pontuações ao longo do tempo
## 🤝 Contribuir
### Para Contribuir:
1. Faça fork do projeto
2. Crie o seu branch de funcionalidade
3. Faça commit das suas alterações
4. Push para o branch
5. Abra um Pull Request
### Ideias de Melhoria:
- [ ] Paralelização de testes para melhor performance
- [ ] Detecção mais sofisticada de páginas de bloqueio
- [ ] Suporte a bases de dados de reputação externas
- [ ] Interface gráfica para configuração
- [ ] Integração com APIs de threat intelligence
## 🎯 Roteiro
### Versão 1.4 (planeada)
- [ ] Testes paralelos para performance melhorada
- [ ] Suporte a certificados SSL personalizados
- [ ] Notificações por email dos resultados
### Versão 2.0 (futuro)
- [ ] Interface web para configuração
- [ ] Integração com soluções SIEM
- [ ] API REST para automação
## 📞 Suporte
Para obter ajuda ou reportar problemas:
- 📧 Contacte o autor: Hubert Cornet
- 🐛 Abra um issue no repositório do projeto
- 📚 Consulte a documentação técnica
## 📄 Licença
Este projeto está sob licença MIT. Veja o arquivo `LICENSE` para mais detalhes.
---
**⭐ Se este script foi útil para si, não hesite em dar-lhe uma estrela!**
---
*Última atualização: 3 de setembro de 2025*