shadow1ng/fscan · error
STOMP request send failed: %w
Error message
STOMP request send failed: %w
What it means
identifyService probes an ActiveMQ endpoint by sending a STOMP CONNECT frame and inspecting the reply. If conn.Write fails, the ScanResult carries 'STOMP request send failed' wrapping the underlying write error (note: this path uses a hardcoded English string, not i18n).
Source
Thrown at plugins/services/activemq.go:224
conn, err := session.DialTCP(ctx, "tcp", target, timeout)
if err != nil {
return &ScanResult{
Success: false,
Service: "activemq",
Error: err,
}
}
defer func() { _ = conn.Close() }()
stompConnect := "CONNECT\naccept-version:1.0,1.1,1.2\nhost:/\n\n\x00"
_ = conn.SetWriteDeadline(time.Now().Add(timeout))
if _, writeErr := conn.Write([]byte(stompConnect)); writeErr != nil {
return &ScanResult{
Success: false,
Service: "activemq",
Error: fmt.Errorf("STOMP request send failed: %w", writeErr),
}
}
_ = conn.SetReadDeadline(time.Now().Add(timeout))
response := make([]byte, 512)
n, err := conn.Read(response)
if err != nil {
return &ScanResult{
Success: false,
Service: "activemq",
Error: fmt.Errorf("failed to read response: %w", err),
}
}
if n == 0 {
return &ScanResult{
Success: false,
Service: "activemq",
Error: fmt.Errorf("%s", i18n.GetText("activemq_stomp_empty_response")),View on GitHub (pinned to 95cc12e753)
Solutions
- Increase the module timeout (session.Config.ModuleTimeout())
- Exclude non-ActiveMQ hosts or restrict the scan to known 61613 ports
- Check firewall rules that reset unexpected protocol traffic
- Treat it as a signal the service is not STOMP-capable
Defensive patterns
Strategy: try-catch
Validate before calling
conn, err := net.DialTimeout("tcp", target, timeout)
if err != nil { return fmt.Errorf("unreachable %s: %w", target, err) } Try / catch
res := plugin.identifyService(ctx, host, session)
if res.Error != nil && strings.Contains(res.Error.Error(), "STOMP request send failed") {
// host likely non-STOMP or aggressive; skip or retry
} Prevention
- Tune ModuleTimeout for the scan environment
- Throttle scans to avoid triggering RSTs from security devices
- Restrict identification to plausible ActiveMQ ports
- Check res.Error on every ScanResult before use
When it happens
Trigger: Write deadline expiry, connection reset by the peer, or a broken socket when the probe writes its CONNECT frame during service identification.
Common situations: Service-identification sweeps hitting hosts that close connections aggressively, firewalls RST-ing non-HTTP protocols, timeouts too small during mass scans, or the port being filtered mid-handshake.
Related errors
- activemq_stomp_send_failed: %w
- activemq_stomp_read_failed: %w
- %s
- failed to read response: %w
- mcs sendConnectInitial write error %v
AI-assisted analysis of shadow1ng/fscan@95cc12e753 (2026-09-06).
Data as JSON: /api/errors/58bac96c8a67a300.
Report an issue: GitHub.