shadow1ng/fscan · error

%s

Error message

%s

What it means

Generic wrapper in ActiveMQ authenticateSTOMP for an empty STOMP response: the read succeeded but returned 0 bytes (n == 0), so there is no server frame to classify and authentication cannot be judged; the underlying message comes from the i18n sentinel for this case.

Source

Thrown at plugins/services/activemq.go:180

		return false, err
	}

	stompConnect := fmt.Sprintf("CONNECT\naccept-version:1.0,1.1,1.2\nhost:/\nlogin:%s\npasscode:%s\n\n\x00",
		username, password)

	_ = conn.SetWriteDeadline(time.Now().Add(timeout))
	if _, err := conn.Write([]byte(stompConnect)); err != nil {
		return false, fmt.Errorf("%s: %w", i18n.GetText("activemq_stomp_send_failed"), err)
	}

	_ = conn.SetReadDeadline(time.Now().Add(timeout))
	response := make([]byte, 1024)
	n, err := conn.Read(response)
	if err != nil {
		return false, fmt.Errorf("%s: %w", i18n.GetText("activemq_stomp_read_failed"), err)
	}
	if n == 0 {
		return false, fmt.Errorf("%s", i18n.GetText("activemq_stomp_empty_response"))
	}

	responseStr := string(response[:n])

	if strings.Contains(responseStr, "CONNECTED") {
		return true, nil
	} else if strings.Contains(responseStr, "ERROR") {
		errorMsg := i18n.GetText("activemq_stomp_auth_error")
		if strings.Contains(responseStr, "Authentication failed") {
			errorMsg = "Authentication failed"
		} else if strings.Contains(responseStr, "Access denied") {
			errorMsg = "Access denied"
		} else if strings.Contains(responseStr, "Invalid credentials") {
			errorMsg = "Invalid credentials"
		}
		return false, fmt.Errorf("%s", errorMsg)
	}

View on GitHub (pinned to 95cc12e753)

Solutions

  1. Verify the target port hosts a STOMP transport (default 61613)
  2. Enable the STOMP connector in activemq.xml if missing
  3. Check broker limits (maxConnections) and proxy idle-close behavior
  4. Retest with telnet/nc to confirm the port answers
Defensive patterns

Strategy: fallback

Validate before calling

// confirm the endpoint speaks STOMP before deep probing
banner, _ := quickProbe(addr)
if banner == "" { log.Println("port closes connections silently; not STOMP") }

Try / catch

if _, err := authSTOMP(conn); err != nil {
    if strings.Contains(err.Error(), "empty_response") {
        // treat as non-STOMP service, skip
    }
}

Prevention

When it happens

Trigger: conn.Read returns n==0 with no error, meaning an immediate EOF: the peer accepted TCP then closed before answering the STOMP handshake.

Common situations: Pointing the probe at a non-STOMP port that drops unknown protocols, ActiveMQ with the STOMP transport disabled, a TCP proxy/LB health-check closing idle connections, or the broker rejecting the client at TCP level (max connections).

Related errors


AI-assisted analysis of shadow1ng/fscan@95cc12e753 (2026-09-06). Data as JSON: /api/errors/f84688032b6da0ef. Report an issue: GitHub.