README.md aktualisiert

This commit is contained in:
2025-12-09 07:35:52 +01:00
parent 2c7d40fef1
commit 111782e955

149
README.md
View File

@@ -14,6 +14,8 @@ Dieses Tool ermöglicht es, einzelne oder alle Shops auf einem Plesk-Server temp
-**Multi-Shop-Management**: Verwaltung mehrerer Shops auf einem Server -**Multi-Shop-Management**: Verwaltung mehrerer Shops auf einem Server
-**Bulk-Operationen**: Alle Shops gleichzeitig aktivieren/deaktivieren -**Bulk-Operationen**: Alle Shops gleichzeitig aktivieren/deaktivieren
-**Gesamtübersicht**: Logs und Statistiken über alle Shops hinweg (Top 100 IPs) -**Gesamtübersicht**: Logs und Statistiken über alle Shops hinweg (Top 100 IPs)
-**Bot-Erkennung**: Automatische Identifikation von 80+ Bots/Crawlern (Googlebot, GPTBot, AhrefsBot, etc.)
-**Request-Statistiken**: Requests pro Minute (req/min) und Laufzeit pro Shop
-**Auto-Deaktivierung**: Blocking läuft nach 72 Stunden automatisch ab -**Auto-Deaktivierung**: Blocking läuft nach 72 Stunden automatisch ab
-**Systemd-Service**: Automatischer Start beim Booten -**Systemd-Service**: Automatischer Start beim Booten
-**Sauberes Cleanup**: Vollständige Deinstallation bei Deaktivierung -**Sauberes Cleanup**: Vollständige Deinstallation bei Deaktivierung
@@ -265,60 +267,82 @@ Die Icons zeigen den Modus:
#### Option [0]: Gesamtübersicht aller Shops #### Option [0]: Gesamtübersicht aller Shops
Zeigt eine aggregierte Statistik über alle aktiven Shops: Zeigt eine aggregierte Statistik über alle aktiven Shops mit **Requests pro Minute** und **Bot-Erkennung**:
``` ```
════════════════════════════════════════════════════════════════ ══════════════════════════════════════════════════════════════════════
📊 GESAMTÜBERSICHT ALLER SHOPS 📊 GESAMTÜBERSICHT ALLER SHOPS
════════════════════════════════════════════════════════════════ ══════════════════════════════════════════════════════════════════════
📝 PHP-Blocks gesamt: 1.247 📝 PHP-Blocks gesamt: 173319 (⌀ 42.3 req/min, Laufzeit: 2d 20h 15m)
├─ shop1.example.com: 523 █████████████████████ ├─ air-suspension-parts.de: 19243 (8.2 req/min, seit 39h 12m) ████████████████
├─ shop2.example.com: 412 ████████████████ ├─ gastro-shop-24.com: 20959 (12.1 req/min, seit 28h 45m) ████████████████████████
shop3.example.com: 312 ████████████ horchakustik-shop.de: 29978 (15.3 req/min, seit 32h 38m) ██████████████████████████████
├─ leonessa.at: 12554 (5.8 req/min, seit 36h 05m) ███████████
└─ verve-klima.de: 18412 (9.1 req/min, seit 33h 42m) ██████████████████
🛡️ CrowdSec-Bans gesamt: 892 🛡️ CrowdSec-Bans gesamt: 892
├─ shop1.example.com: 401 ████████████████ ├─ air-suspension-parts.de: 401 ████████████████
├─ shop2.example.com: 298 ███████████ ├─ gastro-shop-24.com: 298 ███████████
└─ shop3.example.com: 193 ███████ └─ horchakustik-shop.de: 193 ███████
🔥 Top 100 blockierte IPs (alle Shops): 🔥 Top 100 blockierte IPs (alle Shops):
185.220.101.34: 127 █████████████████████████ 66.249.66.10 (Googlebot): 7025 ████████████████████
45.95.169.22: 89 █████████████████ 66.249.66.169 (Googlebot): 6179 ████████████████████
194.26.192.64: 67 █████████████ 40.77.167.27 (Bingbot): 571 ████████████████████
173.0.81.65 (PayPal IPN): 466 ████████████████████
216.244.66.196 (DotBot): 416 ████████████████████
185.191.171.5 (SemrushBot): 312 ████████████████████
35.187.50.162 (Unbekannt): 1035 ████████████████████
... ...
════════════════════════════════════════════════════════════════ ══════════════════════════════════════════════════════════════════════
``` ```
**Enthält:** **Enthält:**
- PHP-Blocks pro Shop mit visuellen Balken - **PHP-Blocks gesamt** mit durchschnittlicher Request-Rate und Gesamtlaufzeit
- CrowdSec-Bans pro Shop (nur für PHP+CrowdSec Shops) - **Pro Shop**: Anzahl Blocks, req/min, Laufzeit seit Aktivierung, visueller Balken
- Top 100 der am häufigsten blockierten IPs über alle Shops hinweg - **CrowdSec-Bans** pro Shop (nur für PHP+CrowdSec Shops)
- **Top 100 blockierte IPs** mit automatischer Bot-Erkennung
#### Option [1-n]: Einzelner Shop #### Option [1-n]: Einzelner Shop
Zeigt detaillierte Logs für einen spezifischen Shop: Zeigt detaillierte Logs für einen spezifischen Shop:
``` ```
══════════════════════════════════════════════════════════════════════
📊 Logs für shop1.example.com [PHP + CrowdSec 🛡️] 📊 Logs für shop1.example.com [PHP + CrowdSec 🛡️]
══════════════════════════════════════════════════════════════════════
📝 PHP-Blocks: ⏱️ Aktiviert: 2025-12-08 14:30:00
================================================================================ ⏱️ Laufzeit: 1d 18h 45m
[2025-12-08 17:24:57] IP: 202.8.43.232 | UA: Mozilla/5.0 ... | URI: /produkt-123 📈 Blocks: 19243 (8.2 req/min)
📝 Letzte 50 PHP-Blocks:
======================================================================
[2025-12-10 09:15:23] IP: 66.249.66.10 | UA: Mozilla/5.0 (compatible; Googlebot/2.1) | URI: /produkt-123
[2025-12-10 09:15:21] IP: 40.77.167.27 | UA: Mozilla/5.0 (compatible; bingbot/2.0) | URI: /kategorie
... ...
================================================================================ ======================================================================
Gesamt: 523 Gesamt: 19243
🔥 Top 20 blockierte IPs:
66.249.66.10 (Googlebot): 2341 ████████████████████
40.77.167.27 (Bingbot): 892 ████████████████████
216.244.66.196 (DotBot): 234 ████████████████████
185.191.171.5 (SemrushBot): 189 ████████████████████
52.167.144.225 (Unbekannt): 156 ████████████████████
...
🛡️ CrowdSec Decisions: 🛡️ CrowdSec Decisions:
================================================================================ ======================================================================
Aktive Bans: 401 Aktive Bans: 401
Letzte 20 Bans: Letzte 20 Bans:
🚫 202.8.43.232 (bis 2025-12-11 17:24:57) 🚫 202.8.43.232 (bis 2025-12-11 17:24:57)
🚫 45.95.169.22 (bis 2025-12-11 16:30:12) 🚫 45.95.169.22 (bis 2025-12-11 16:30:12)
... ...
================================================================================ ======================================================================
``` ```
Bei PHP-only Shops wird stattdessen angezeigt: Bei PHP-only Shops wird stattdessen angezeigt:
@@ -331,19 +355,50 @@ Bei PHP-only Shops wird stattdessen angezeigt:
Option `[4] Status anzeigen` zeigt: Option `[4] Status anzeigen` zeigt:
- Anzahl verfügbarer Shops - Anzahl verfügbarer Shops
- Anzahl aktiver Blockings - Anzahl aktiver Blockings
- Liste aller Shops mit aktivem Blocking **und deren Modus** - Liste aller Shops mit aktivem Blocking, **Modus**, **Blocks**, **req/min** und **Laufzeit**
``` ```
📊 Status: 📊 Status:
Shops gesamt: 15 Shops gesamt: 15
Aktive DACH-Blockings: 5 Aktive DACH-Blockings: 5
✓ shop1.example.com [PHP+CS] 🛡️ ✓ shop1.example.com [PHP+CS] 🛡️ - 19243 blocks (8.2 req/min, 1d 18h 45m)
✓ shop2.example.com [PHP] 📝 ✓ shop2.example.com [PHP] 📝 - 12554 blocks (5.8 req/min, 2d 3h 12m)
✓ shop3.example.com [PHP] 📝 ✓ shop3.example.com [PHP] 📝 - 8921 blocks (4.1 req/min, 1d 12h 30m)
✓ shop4.example.com [PHP+CS] 🛡️ ✓ shop4.example.com [PHP+CS] 🛡️ - 29978 blocks (15.3 req/min, 1d 8h 22m)
✓ shop5.example.com [PHP] 📝 ✓ shop5.example.com [PHP] 📝 - 3456 blocks (2.3 req/min, 1d 1h 05m)
``` ```
## 🤖 Bot-Erkennung
Das Script erkennt automatisch über **80 verschiedene Bots und Crawler** anhand des User-Agent-Strings. Die erkannten Bots werden in den Logs hinter der IP-Adresse angezeigt.
### Erkannte Bot-Kategorien
| Kategorie | Bots |
|-----------|------|
| **AI/LLM Crawler** | GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-User, PerplexityBot, Gemini-Deep-Research, cohere-ai, MistralAI-User, AI2Bot, CCBot |
| **Suchmaschinen** | Googlebot, Bingbot, YandexBot, Baiduspider, DuckDuckBot, Applebot, PetalBot, Sogou, Qwantify |
| **SEO-Tools** | AhrefsBot, SemrushBot, MJ12bot, DotBot, BLEXBot, DataForSeoBot, SEOkicks, Screaming Frog, Sistrix |
| **Social Media** | FacebookBot, LinkedInBot, Twitterbot, Pinterest, Slackbot, TelegramBot, WhatsApp, Discordbot |
| **Monitoring** | UptimeRobot, Pingdom, StatusCake, GTmetrix, Site24x7 |
| **E-Commerce** | PayPal IPN, Stripe, Shopify, Amazonbot |
| **Andere** | Bytespider (TikTok), Diffbot, Wget, curl, python-requests, HeadlessChrome, Scrapy |
### Beispiel-Ausgabe mit Bot-Erkennung
```
🔥 Top 100 blockierte IPs (alle Shops):
66.249.66.10 (Googlebot): 7025 ████████████████████
40.77.167.27 (Bingbot): 571 ████████████████████
173.0.81.65 (PayPal IPN): 466 ████████████████████
216.244.66.196 (DotBot): 416 ████████████████████
185.191.171.5 (SemrushBot): 312 ████████████████████
54.36.148.0 (AhrefsBot): 289 ████████████████████
35.187.50.162 (Unbekannt): 1035 ████████████████████
```
Wenn kein Bot erkannt wird, wird `Unbekannt` angezeigt.
## 🔧 Erweiterte Verwendung ## 🔧 Erweiterte Verwendung
### Manuell CrowdSec Decisions prüfen ### Manuell CrowdSec Decisions prüfen
@@ -418,7 +473,7 @@ cscli decisions delete --ip DEINE_IP
- `/usr/local/bin/geoip_crowdsec_watcher.py` - Watcher-Service Script - `/usr/local/bin/geoip_crowdsec_watcher.py` - Watcher-Service Script
- `/etc/systemd/system/geoip-crowdsec-watcher.service` - Systemd Service - `/etc/systemd/system/geoip-crowdsec-watcher.service` - Systemd Service
- `/var/lib/crowdsec/geoip_active_shops.json` - Tracking aktiver Shops (inkl. Modus) - `/var/lib/crowdsec/geoip_active_shops.json` - Tracking aktiver Shops (inkl. Modus und Aktivierungszeit)
## ⚙️ Konfiguration ## ⚙️ Konfiguration
@@ -467,6 +522,17 @@ $countries = ['de', 'at', 'ch']; // Germany, Austria, Switzerland
Füge weitere Ländercodes hinzu (z.B. `'nl'` für Niederlande, `'be'` für Belgien). Die verfügbaren Ländercodes findest du unter: https://www.ipdeny.com/ipblocks/data/aggregated/ Füge weitere Ländercodes hinzu (z.B. `'nl'` für Niederlande, `'be'` für Belgien). Die verfügbaren Ländercodes findest du unter: https://www.ipdeny.com/ipblocks/data/aggregated/
### Bot-Erkennung erweitern
Um weitere Bots zur Erkennung hinzuzufügen, editiere das `BOT_PATTERNS` Dictionary im Python-Script:
```python
BOT_PATTERNS = {
# Existierende Patterns...
'MeinNeuerBot': r'MeinNeuerBot', # Regex-Pattern für User-Agent
}
```
## 🛡️ Sicherheit ## 🛡️ Sicherheit
### Was wird geblockt? ### Was wird geblockt?
@@ -742,9 +808,11 @@ cat /var/www/vhosts/SHOP/httpdocs/geoip_blocked.log | \
### Während aktivem Blocking ### Während aktivem Blocking
1. ✅ Logs regelmäßig prüfen (Gesamtübersicht nutzen!) 1. ✅ Logs regelmäßig prüfen (Gesamtübersicht nutzen!)
2. ✅ Auf Fehlblockierungen achten (sehr selten) 2. ✅ **req/min beobachten** - hohe Werte können auf Angriffe hindeuten
3. ✅ CrowdSec-Statistiken beobachten (nur bei PHP+CrowdSec) 3. ✅ **Bot-Traffic analysieren** - welche Crawler werden geblockt?
4. ✅ Server-Performance monitoren 4. ✅ Auf Fehlblockierungen achten (sehr selten)
5. ✅ CrowdSec-Statistiken beobachten (nur bei PHP+CrowdSec)
6. ✅ Server-Performance monitoren
### Nach Deaktivierung ### Nach Deaktivierung
@@ -773,6 +841,7 @@ cat /var/www/vhosts/SHOP/httpdocs/geoip_blocked.log | \
- ✅ Nicht als permanente Lösung - ✅ Nicht als permanente Lösung
- ✅ Kombinieren mit anderen Security-Maßnahmen - ✅ Kombinieren mit anderen Security-Maßnahmen
- ✅ Regelmäßig Logs prüfen (Gesamtübersicht für schnellen Überblick) - ✅ Regelmäßig Logs prüfen (Gesamtübersicht für schnellen Überblick)
- ✅ **req/min im Auge behalten** für Anomalie-Erkennung
- ✅ Bei CDN: PHP-only Modus verwenden - ✅ Bei CDN: PHP-only Modus verwenden
## 🤝 Contributing ## 🤝 Contributing
@@ -793,6 +862,7 @@ MIT License - siehe LICENSE Datei
- **IP-Ranges**: [ipdeny.com](https://www.ipdeny.com/) (RIPE-basiert) - **IP-Ranges**: [ipdeny.com](https://www.ipdeny.com/) (RIPE-basiert)
- **CrowdSec**: [crowdsec.net](https://www.crowdsec.net/) - **CrowdSec**: [crowdsec.net](https://www.crowdsec.net/)
- **Bot-Listen**: [momenticmarketing.com](https://momenticmarketing.com/blog/ai-search-crawlers-bots), [searchenginejournal.com](https://www.searchenginejournal.com/ai-crawler-user-agents-list/558130/)
- **Entwickelt für**: Plesk-basierte Multi-Shop-Server - **Entwickelt für**: Plesk-basierte Multi-Shop-Server
## 📞 Support ## 📞 Support
@@ -816,13 +886,22 @@ Bei Problemen:
--- ---
**Version**: 2.2.0 (DACH) **Version**: 2.3.0 (DACH)
**Letztes Update**: Dezember 2025 **Letztes Update**: Dezember 2025
**Status**: Production Ready ✅ **Status**: Production Ready ✅
**Erlaubte Länder**: 🇩🇪 Deutschland | 🇦🇹 Österreich | 🇨🇭 Schweiz **Erlaubte Länder**: 🇩🇪 Deutschland | 🇦🇹 Österreich | 🇨🇭 Schweiz
### Changelog ### Changelog
#### v2.3.0
- **NEU**: Bot-Erkennung mit 80+ bekannten Bots/Crawlern (Googlebot, GPTBot, ClaudeBot, AhrefsBot, SemrushBot, etc.)
- **NEU**: Requests pro Minute (req/min) Berechnung pro Shop
- **NEU**: Laufzeit-Anzeige seit Aktivierung (z.B. "1d 18h 45m")
- **NEU**: Erweiterte Status-Ansicht mit Blocks, req/min und Laufzeit
- **NEU**: Top 20 IPs mit Bot-Erkennung in Einzelshop-Logs
- Bot-Kategorien: AI/LLM, Suchmaschinen, SEO-Tools, Social Media, Monitoring, E-Commerce
- Verbesserte Gesamtübersicht mit durchschnittlicher Request-Rate
#### v2.2.0 #### v2.2.0
- **NEU**: Modus-Auswahl bei Aktivierung (PHP+CrowdSec 🛡️ oder Nur PHP 📝) - **NEU**: Modus-Auswahl bei Aktivierung (PHP+CrowdSec 🛡️ oder Nur PHP 📝)
- **NEU**: PHP-only Modus für Server hinter CDN/Reverse-Proxy (Link11, Cloudflare) - **NEU**: PHP-only Modus für Server hinter CDN/Reverse-Proxy (Link11, Cloudflare)