Compare commits

..

17 Commits

Author SHA1 Message Date
admin 418f5f9322 Delete index2.php 2026-03-30 14:41:20 +02:00
admin b9f9370ddd Add donation section to index.php
Added a donation section with a link to Buy Me a Coffee.
2026-03-30 14:36:54 +02:00
admin 0430ee62b0 Update index.php 2026-03-30 14:32:11 +02:00
admin 090959e524 Update index.php 2026-03-30 13:33:04 +02:00
admin 1b2cc5150b Enhance layout and add eco-business section
Updated styles and added eco-business box with features.
2026-03-30 13:27:05 +02:00
admin b0edb79a44 Update index.php 2026-03-30 12:30:38 +02:00
admin cf2e30fafa Update index.php 2026-03-30 12:26:48 +02:00
admin 0e3bdd0686 Replace old donation section with new TWINT info 2026-03-30 12:23:05 +02:00
admin 54ff05f260 Add TWINT image section to index.php 2026-03-30 12:17:53 +02:00
admin ef0a239641 Add Starlink banner with styling and content 2026-03-30 11:48:34 +02:00
admin 936a72fd8c Update print statement from 'Hello' to 'Goodbye' 2026-03-30 11:27:52 +02:00
admin 78bafef395 Merge pull request #23 from metacube2/claude/fix-traceroute-program-01GFBTn5nCh1VjHukWwLcpkH
Fix traceroute program functionality
2025-12-06 11:02:25 +01:00
Claude a68c07c94c Verbessere Traceroute-Visualisierungen mit Sicherheit und Robustheit
Behobene Probleme:
- Timeout-Schutz: 30 Sekunden Limit für traceroute-Befehle
- Erweiterte Validierung: IPv4, IPv6 und Hostnamen werden korrekt geprüft
- IPv6-Unterstützung: Fallback zu traceroute6, robustes IPv6-Parsing
- Verbesserte Fehlerbehandlung: Prüfung ob traceroute verfügbar ist
- Externe Ressourcen: Graceful Fallback für Glow-Texture in route2.php
- Robustes Parsing: Unterstützt verschiedene traceroute-Ausgabeformate

Geänderte Dateien:
- route.php: Basis-Version mit 3D-Visualisierung
- route2.php: HyperTracer 3D mit erweiterten Features
- route3.php: Canvas-basierte Version

Parameter hinzugefügt: -m 20 (max Hops), -w 2 (Wartezeit)
2025-12-02 20:53:32 +00:00
admin 7468520f08 Merge pull request #21 from metacube2/codex/create-modern-webcam-site-in-index3.php-ifsdyh
Add modern webcam dashboard duplicate as index4
2025-11-17 13:27:10 +01:00
admin adf670a3ce Merge branch 'main' into codex/create-modern-webcam-site-in-index3.php-ifsdyh 2025-11-17 13:26:57 +01:00
admin fcee0028b9 Merge pull request #22 from metacube2/codex/schreibe-ein-buch-uber-ki-gefahren-u2qkn9
Füge abwechslungsreiche Romanfassung in buch2 hinzu
2025-11-10 12:06:34 +01:00
admin 8af4da543c Add modern webcam dashboard duplicate as index4 2025-11-10 11:58:43 +01:00
5 changed files with 4060 additions and 4785 deletions
+3611 -2713
View File
File diff suppressed because it is too large Load Diff
-1780
View File
File diff suppressed because one or more lines are too long
+58 -14
View File
@@ -5,14 +5,41 @@ $error = '';
$rawOutput = ''; $rawOutput = '';
if ($host !== '') { if ($host !== '') {
$sanitizedHost = preg_replace('/[^A-Za-z0-9\-\.:]/', '', $host); // Erweiterte Validierung für IPv4, IPv6 und Hostnamen
if ($sanitizedHost === '') { $sanitizedHost = trim($host);
// Prüfe ob es eine gültige IP oder Hostname ist
$isValidIPv4 = filter_var($sanitizedHost, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
$isValidIPv6 = filter_var($sanitizedHost, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
$isValidHostname = preg_match('/^[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?)*$/', $sanitizedHost);
if (!$isValidIPv4 && !$isValidIPv6 && !$isValidHostname) {
$error = 'Bitte geben Sie einen gültigen Hostnamen oder eine IP-Adresse ein.'; $error = 'Bitte geben Sie einen gültigen Hostnamen oder eine IP-Adresse ein.';
} else { } else {
$command = 'traceroute -n ' . escapeshellarg($sanitizedHost) . ' 2>&1'; // Prüfe ob traceroute verfügbar ist
$tracerouteCmd = $isValidIPv6 ? 'traceroute6' : 'traceroute';
$checkCmd = 'command -v ' . $tracerouteCmd . ' > /dev/null 2>&1';
exec($checkCmd, $output, $returnCode);
if ($returnCode !== 0) {
// Fallback zu traceroute wenn traceroute6 nicht verfügbar
if ($isValidIPv6) {
$tracerouteCmd = 'traceroute';
exec('command -v traceroute > /dev/null 2>&1', $output, $returnCode);
}
if ($returnCode !== 0) {
$error = 'Traceroute ist auf diesem System nicht verfügbar.';
}
}
if ($error === '') {
// Führe traceroute mit Timeout aus (max 30 Sekunden)
$command = 'timeout 30 ' . $tracerouteCmd . ' -n -m 20 -w 2 ' . escapeshellarg($sanitizedHost) . ' 2>&1';
$rawOutput = shell_exec($command); $rawOutput = shell_exec($command);
if ($rawOutput === null) {
$error = 'Traceroute konnte nicht ausgeführt werden. Ist das Kommando verfügbar?'; if ($rawOutput === null || trim($rawOutput) === '') {
$error = 'Traceroute konnte nicht ausgeführt werden oder lieferte keine Ausgabe.';
} else { } else {
$traceData = parseTraceroute($rawOutput); $traceData = parseTraceroute($rawOutput);
if (empty($traceData)) { if (empty($traceData)) {
@@ -21,6 +48,7 @@ if ($host !== '') {
} }
} }
} }
}
if (empty($traceData)) { if (empty($traceData)) {
$traceData = getSampleTrace(); $traceData = getSampleTrace();
@@ -38,21 +66,37 @@ function parseTraceroute(string $raw): array
$hops = []; $hops = [];
foreach ($lines as $line) { foreach ($lines as $line) {
if (preg_match('/^\s*\d+\s+/', $line) !== 1) { // Überspringe Header-Zeilen und leere Zeilen
if (!preg_match('/^\s*\d+\s+/', $line)) {
continue; continue;
} }
preg_match_all('/(\d+\.\d+)\s+ms/', $line, $latencyMatches); // Extrahiere die Hop-Nummer
if (!preg_match('/^\s*(\d+)\s+/', $line, $hopMatch)) {
continue;
}
$hopNumber = (int) $hopMatch[1];
// Extrahiere Latenz-Werte (unterstützt verschiedene Formate)
preg_match_all('/(\d+(?:\.\d+)?)\s*ms/', $line, $latencyMatches);
$latencies = array_map('floatval', $latencyMatches[1] ?? []); $latencies = array_map('floatval', $latencyMatches[1] ?? []);
$avgLatency = !empty($latencies) ? array_sum($latencies) / count($latencies) : null; $avgLatency = !empty($latencies) ? round(array_sum($latencies) / count($latencies), 2) : null;
if (preg_match('/^\s*(\d+)\s+([0-9\.\*]+)/', $line, $parts) !== 1) { // Extrahiere IP-Adresse (IPv4, IPv6 oder *)
continue; // Pattern für IPv4: xxx.xxx.xxx.xxx
// Pattern für IPv6: xxxx:xxxx:... oder komprimiert ::
$ip = 'Zeitüberschreitung';
// Versuche IPv4 zu finden
if (preg_match('/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/', $line, $ipMatch)) {
$ip = $ipMatch[1];
} }
// Versuche IPv6 zu finden (verschiedene Formate)
$hopNumber = (int) $parts[1]; elseif (preg_match('/([0-9a-fA-F]{1,4}:+[0-9a-fA-F:]+)/', $line, $ipMatch)) {
$ip = $parts[2]; $ip = $ipMatch[1];
if ($ip === '*') { }
// Prüfe auf * (Timeout)
elseif (preg_match('/\s+\*\s+/', $line)) {
$ip = 'Zeitüberschreitung'; $ip = 'Zeitüberschreitung';
} }
+83 -15
View File
@@ -5,14 +5,41 @@ $error = '';
$rawOutput = ''; $rawOutput = '';
if ($host !== '') { if ($host !== '') {
$sanitizedHost = preg_replace('/[^A-Za-z0-9\-\.:]/', '', $host); // Erweiterte Validierung für IPv4, IPv6 und Hostnamen
if ($sanitizedHost === '') { $sanitizedHost = trim($host);
// Prüfe ob es eine gültige IP oder Hostname ist
$isValidIPv4 = filter_var($sanitizedHost, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
$isValidIPv6 = filter_var($sanitizedHost, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
$isValidHostname = preg_match('/^[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?)*$/', $sanitizedHost);
if (!$isValidIPv4 && !$isValidIPv6 && !$isValidHostname) {
$error = 'Bitte geben Sie einen gültigen Hostnamen oder eine IP-Adresse ein.'; $error = 'Bitte geben Sie einen gültigen Hostnamen oder eine IP-Adresse ein.';
} else { } else {
$command = 'traceroute -n ' . escapeshellarg($sanitizedHost) . ' 2>&1'; // Prüfe ob traceroute verfügbar ist
$tracerouteCmd = $isValidIPv6 ? 'traceroute6' : 'traceroute';
$checkCmd = 'command -v ' . $tracerouteCmd . ' > /dev/null 2>&1';
exec($checkCmd, $output, $returnCode);
if ($returnCode !== 0) {
// Fallback zu traceroute wenn traceroute6 nicht verfügbar
if ($isValidIPv6) {
$tracerouteCmd = 'traceroute';
exec('command -v traceroute > /dev/null 2>&1', $output, $returnCode);
}
if ($returnCode !== 0) {
$error = 'Traceroute ist auf diesem System nicht verfügbar.';
}
}
if ($error === '') {
// Führe traceroute mit Timeout aus (max 30 Sekunden)
$command = 'timeout 30 ' . $tracerouteCmd . ' -n -m 20 -w 2 ' . escapeshellarg($sanitizedHost) . ' 2>&1';
$rawOutput = shell_exec($command); $rawOutput = shell_exec($command);
if ($rawOutput === null) {
$error = 'Traceroute konnte nicht ausgeführt werden. Ist das Kommando verfügbar?'; if ($rawOutput === null || trim($rawOutput) === '') {
$error = 'Traceroute konnte nicht ausgeführt werden oder lieferte keine Ausgabe.';
} else { } else {
$traceData = parseTraceroute($rawOutput); $traceData = parseTraceroute($rawOutput);
if (empty($traceData)) { if (empty($traceData)) {
@@ -21,6 +48,7 @@ if ($host !== '') {
} }
} }
} }
}
if (empty($traceData)) { if (empty($traceData)) {
$traceData = getSampleTrace(); $traceData = getSampleTrace();
@@ -45,21 +73,38 @@ function parseTraceroute(string $raw): array
$hops = []; $hops = [];
foreach ($lines as $line) { foreach ($lines as $line) {
if (!preg_match('/^\s*(\d+)\s+(.+)/', $line, $parts)) { // Überspringe Header-Zeilen und leere Zeilen
if (!preg_match('/^\s*\d+\s+/', $line)) {
continue; continue;
} }
$hopNumber = (int) $parts[1]; // Extrahiere die Hop-Nummer
$rest = $parts[2]; if (!preg_match('/^\s*(\d+)\s+/', $line, $hopMatch)) {
continue;
}
$hopNumber = (int) $hopMatch[1];
preg_match('/([0-9a-fA-F:\.\-]+|\*)/', $rest, $ipMatch); // Extrahiere Latenz-Werte (unterstützt verschiedene Formate)
$ip = $ipMatch[1] ?? '*'; preg_match_all('/(\d+(?:\.\d+)?)\s*ms/', $line, $latencyMatches);
$ip = $ip === '*' ? 'Zeitüberschreitung' : $ip;
preg_match_all('/(\d+\.\d+)\s+ms/', $rest, $latencyMatches);
$latencies = array_map('floatval', $latencyMatches[1] ?? []); $latencies = array_map('floatval', $latencyMatches[1] ?? []);
$avgLatency = !empty($latencies) ? round(array_sum($latencies) / count($latencies), 2) : null; $avgLatency = !empty($latencies) ? round(array_sum($latencies) / count($latencies), 2) : null;
// Extrahiere IP-Adresse (IPv4, IPv6 oder *)
$ip = 'Zeitüberschreitung';
// Versuche IPv4 zu finden
if (preg_match('/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/', $line, $ipMatch)) {
$ip = $ipMatch[1];
}
// Versuche IPv6 zu finden (verschiedene Formate)
elseif (preg_match('/([0-9a-fA-F]{1,4}:+[0-9a-fA-F:]+)/', $line, $ipMatch)) {
$ip = $ipMatch[1];
}
// Prüfe auf * (Timeout)
elseif (preg_match('/\s+\*\s+/', $line)) {
$ip = 'Zeitüberschreitung';
}
$hops[] = [ $hops[] = [
'hop' => $hopNumber, 'hop' => $hopNumber,
'ip' => $ip, 'ip' => $ip,
@@ -542,7 +587,29 @@ function generateGalaxyLayout(int $count): array
const starField = new THREE.Points(starGeometry, starMaterial); const starField = new THREE.Points(starGeometry, starMaterial);
scene.add(starField); scene.add(starField);
const glowTexture = new THREE.TextureLoader().load('https://cdn.jsdelivr.net/gh/ykob/sketch-threejs@master/example/img/glow.png'); // Lade Glow Texture mit Fehlerbehandlung
const textureLoader = new THREE.TextureLoader();
let glowTexture = null;
textureLoader.load(
'https://cdn.jsdelivr.net/gh/ykob/sketch-threejs@master/example/img/glow.png',
(texture) => {
glowTexture = texture;
// Aktualisiere Sprites mit geladenem Texture
hopMeshes.forEach(mesh => {
const sprite = mesh.children.find(child => child instanceof THREE.Sprite);
if (sprite && sprite.material) {
sprite.material.map = glowTexture;
sprite.material.needsUpdate = true;
}
});
},
undefined,
(error) => {
console.warn('Konnte Glow-Texture nicht laden, verwende Fallback:', error);
// Fallback: Verwende einfache Farbe ohne Texture
}
);
const hopPositions = rawTrace.map(hop => new THREE.Vector3(hop.position.x, hop.position.y, hop.position.z)); const hopPositions = rawTrace.map(hop => new THREE.Vector3(hop.position.x, hop.position.y, hop.position.z));
routeCurve = new THREE.CatmullRomCurve3(hopPositions, false, 'catmullrom', 0.1); routeCurve = new THREE.CatmullRomCurve3(hopPositions, false, 'catmullrom', 0.1);
@@ -585,7 +652,8 @@ function generateGalaxyLayout(int $count): array
const hopGeometry = new THREE.SphereGeometry(3.2, 32, 32); const hopGeometry = new THREE.SphereGeometry(3.2, 32, 32);
const hopMaterial = new THREE.MeshStandardMaterial({ color: 0x38bdf8, emissive: 0x164e63, metalness: 0.5, roughness: 0.35 }); const hopMaterial = new THREE.MeshStandardMaterial({ color: 0x38bdf8, emissive: 0x164e63, metalness: 0.5, roughness: 0.35 });
const spriteMaterial = new THREE.SpriteMaterial({ map: glowTexture, color: 0x38bdf8, transparent: true, opacity: 0.6, depthWrite: false }); // Sprite-Material ohne Texture erstellen (wird später aktualisiert wenn Texture geladen ist)
const spriteMaterial = new THREE.SpriteMaterial({ map: null, color: 0x38bdf8, transparent: true, opacity: 0.6, depthWrite: false });
rawTrace.forEach((hop, index) => { rawTrace.forEach((hop, index) => {
const mesh = new THREE.Mesh(hopGeometry, hopMaterial.clone()); const mesh = new THREE.Mesh(hopGeometry, hopMaterial.clone());
+58 -13
View File
@@ -5,14 +5,41 @@ $error = '';
$rawOutput = ''; $rawOutput = '';
if ($host !== '') { if ($host !== '') {
$sanitizedHost = preg_replace('/[^A-Za-z0-9\-\.:]/', '', $host); // Erweiterte Validierung für IPv4, IPv6 und Hostnamen
if ($sanitizedHost === '') { $sanitizedHost = trim($host);
// Prüfe ob es eine gültige IP oder Hostname ist
$isValidIPv4 = filter_var($sanitizedHost, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
$isValidIPv6 = filter_var($sanitizedHost, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
$isValidHostname = preg_match('/^[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?)*$/', $sanitizedHost);
if (!$isValidIPv4 && !$isValidIPv6 && !$isValidHostname) {
$error = 'Bitte geben Sie einen gültigen Hostnamen oder eine IP-Adresse ein.'; $error = 'Bitte geben Sie einen gültigen Hostnamen oder eine IP-Adresse ein.';
} else { } else {
$command = 'traceroute -n ' . escapeshellarg($sanitizedHost) . ' 2>&1'; // Prüfe ob traceroute verfügbar ist
$tracerouteCmd = $isValidIPv6 ? 'traceroute6' : 'traceroute';
$checkCmd = 'command -v ' . $tracerouteCmd . ' > /dev/null 2>&1';
exec($checkCmd, $output, $returnCode);
if ($returnCode !== 0) {
// Fallback zu traceroute wenn traceroute6 nicht verfügbar
if ($isValidIPv6) {
$tracerouteCmd = 'traceroute';
exec('command -v traceroute > /dev/null 2>&1', $output, $returnCode);
}
if ($returnCode !== 0) {
$error = 'Traceroute ist auf diesem System nicht verfügbar.';
}
}
if ($error === '') {
// Führe traceroute mit Timeout aus (max 30 Sekunden)
$command = 'timeout 30 ' . $tracerouteCmd . ' -n -m 20 -w 2 ' . escapeshellarg($sanitizedHost) . ' 2>&1';
$rawOutput = shell_exec($command); $rawOutput = shell_exec($command);
if ($rawOutput === null) {
$error = 'Traceroute konnte nicht ausgeführt werden. Ist das Kommando verfügbar?'; if ($rawOutput === null || trim($rawOutput) === '') {
$error = 'Traceroute konnte nicht ausgeführt werden oder lieferte keine Ausgabe.';
} else { } else {
$traceData = parseTraceroute($rawOutput); $traceData = parseTraceroute($rawOutput);
if (empty($traceData)) { if (empty($traceData)) {
@@ -21,6 +48,7 @@ if ($host !== '') {
} }
} }
} }
}
if (empty($traceData)) { if (empty($traceData)) {
$traceData = getSampleTrace(); $traceData = getSampleTrace();
@@ -45,21 +73,38 @@ function parseTraceroute(string $raw): array
$hops = []; $hops = [];
foreach ($lines as $line) { foreach ($lines as $line) {
if (!preg_match('/^\s*(\d+)\s+(.+)/', $line, $parts)) { // Überspringe Header-Zeilen und leere Zeilen
if (!preg_match('/^\s*\d+\s+/', $line)) {
continue; continue;
} }
$hopNumber = (int) $parts[1]; // Extrahiere die Hop-Nummer
$rest = $parts[2]; if (!preg_match('/^\s*(\d+)\s+/', $line, $hopMatch)) {
continue;
}
$hopNumber = (int) $hopMatch[1];
preg_match('/([0-9a-fA-F:\.\-]+|\*)/', $rest, $ipMatch); // Extrahiere Latenz-Werte (unterstützt verschiedene Formate)
$ip = $ipMatch[1] ?? '*'; preg_match_all('/(\d+(?:\.\d+)?)\s*ms/', $line, $latencyMatches);
$ip = $ip === '*' ? 'Zeitüberschreitung' : $ip;
preg_match_all('/(\d+\.\d+)\s+ms/', $rest, $latencyMatches);
$latencies = array_map('floatval', $latencyMatches[1] ?? []); $latencies = array_map('floatval', $latencyMatches[1] ?? []);
$avgLatency = !empty($latencies) ? round(array_sum($latencies) / count($latencies), 2) : null; $avgLatency = !empty($latencies) ? round(array_sum($latencies) / count($latencies), 2) : null;
// Extrahiere IP-Adresse (IPv4, IPv6 oder *)
$ip = 'Zeitüberschreitung';
// Versuche IPv4 zu finden
if (preg_match('/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/', $line, $ipMatch)) {
$ip = $ipMatch[1];
}
// Versuche IPv6 zu finden (verschiedene Formate)
elseif (preg_match('/([0-9a-fA-F]{1,4}:+[0-9a-fA-F:]+)/', $line, $ipMatch)) {
$ip = $ipMatch[1];
}
// Prüfe auf * (Timeout)
elseif (preg_match('/\s+\*\s+/', $line)) {
$ip = 'Zeitüberschreitung';
}
$hops[] = [ $hops[] = [
'hop' => $hopNumber, 'hop' => $hopNumber,
'ip' => $ip, 'ip' => $ip,