round34: Emby-Port ergaenzt, API-Scanner erkennt jetzt auch Namespace-Catch-alls wie bei FritzBox/Hue Bridge

This commit is contained in:
2026-07-24 21:18:04 +02:00
parent 70da526921
commit fedb3e9127
2 changed files with 21 additions and 2 deletions

View File

@@ -154,7 +154,25 @@ export async function detectApis(baseUrl: string): Promise<DetectedApi[]> {
}) })
); );
const matches = checks.filter((c): c is DetectedApi => c !== null); let matches = checks.filter((c): c is DetectedApi => c !== null);
// Zweite Stufe gegen Catch-all-Verhalten, das die Kontrollprobe oben nicht
// erwischt (z. B. FritzBox/Hue Bridge: 404 für "echte" Fremdpfade, aber
// jede Anfrage UNTER/NAHE einem bekannten API-Pfad wird gleich generisch
// beantwortet). Für jeden Treffer wird eine offensichtlich erfundene
// Variante DESSELBEN Pfads geprüft (letztes Segment mit Zufallssuffix).
// Antwortet die genauso "positiv", war der ursprüngliche Treffer
// vermutlich nur ein generischer Handler, kein echter Endpunkt.
const verified = await Promise.all(
matches.map(async (m) => {
const mutatedPath = m.path.replace(/([^/]+)$/, `$1-x${Date.now().toString(36)}`);
const sibling = await fetchRaw(`${baseUrl}${mutatedPath}`);
const isCatchAll =
!!sibling && sibling.status !== 404 && sibling.status !== 0 && isApiLikeResponse(sibling);
return isCatchAll ? null : m;
})
);
matches = verified.filter((m): m is DetectedApi => m !== null);
// Mehrere Kandidaten-Einträge können denselben Pfad haben (z. B. das // Mehrere Kandidaten-Einträge können denselben Pfad haben (z. B. das
// generische "/api/status" -> "REST-API" UND das Portainer-spezifische // generische "/api/status" -> "REST-API" UND das Portainer-spezifische

View File

@@ -10,7 +10,8 @@ export const TYPICAL_PORTS = [
9000, 9090, 9091, 9443, // Portainer, Cockpit/Prometheus, Transmission 9000, 9090, 9091, 9443, // Portainer, Cockpit/Prometheus, Transmission
8123, // Home Assistant 8123, // Home Assistant
32400, // Plex 32400, // Plex
7878, 8989, 9117, 6789, // Radarr, Sonarr, Jackett/Prowlarr, NZBGet/SABnzbd 8096, 8920, // Emby (HTTP/HTTPS)
7878, 8989, 9117, 6789, 6767, 8686, 5055, // Radarr, Sonarr, Jackett/Prowlarr, NZBGet/SABnzbd, Bazarr, Lidarr, Overseerr
19999, // Netdata 19999, // Netdata
5665, 5666, // Icinga/Nagios 5665, 5666, // Icinga/Nagios
8181, 8282, 8181, 8282,