generated from Dicken/dickendock
round56: Kritischer Bugfix - Geraete mit 0 von masscan gefundenen Ports loesten faelschlich vollen 65535-Port-Fallback-Scan aus
This commit is contained in:
@@ -391,7 +391,21 @@ export async function scanRoutes(app: FastifyInstance): Promise<void> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const masscanPorts = masscanBatch?.get(device.ip);
|
// WICHTIG (Bugfix round56): masscanBatch.get(device.ip) liefert
|
||||||
|
// "undefined" in ZWEI völlig unterschiedlichen Fällen: (a) der
|
||||||
|
// gesamte masscan-Batch ist fehlgeschlagen (masscanBatch ===
|
||||||
|
// null), ODER (b) der Batch war erfolgreich, aber DIESES
|
||||||
|
// Gerät hat schlicht KEINE offenen Ports - ein bei Handys/
|
||||||
|
// Smart-Geräten völlig normales, gültiges Ergebnis. Der
|
||||||
|
// bisherige Code hat beide Fälle identisch behandelt und
|
||||||
|
// damit für JEDES Gerät mit null gefundenen Ports fälschlich
|
||||||
|
// einen kompletten, langsamen 65535-Port-TCP-Fallback-Scan
|
||||||
|
// ausgelöst - genau das, was masscan eigentlich vermeiden
|
||||||
|
// sollte. Ein leeres Array ist in JS truthy (nur undefined/
|
||||||
|
// null/0/""/NaN/false sind falsy), daher reicht es, hier statt
|
||||||
|
// "undefined" bewusst ein leeres Array zu liefern, wenn der
|
||||||
|
// Batch als Ganzes erfolgreich war.
|
||||||
|
const masscanPorts = masscanBatch ? masscanBatch.get(device.ip) ?? [] : undefined;
|
||||||
const preFetched: PreFetchedScanData = {
|
const preFetched: PreFetchedScanData = {
|
||||||
masscanAttempted: true,
|
masscanAttempted: true,
|
||||||
masscanPorts,
|
masscanPorts,
|
||||||
|
|||||||
Reference in New Issue
Block a user