shadow1ng/fscan · error

service_auth_failed: %s

Error message

service_auth_failed: %s

What it means

Guard in doRedisAuth: the AUTH reply did not contain '+OK'. The response text is inspected for WRONGPASS/invalid password/ERR AUTH/NOAUTH to classify the failure as ErrorTypeAuth; otherwise it stays ErrorTypeUnknown, and the trimmed server response is appended for diagnosis.

Source

Thrown at plugins/services/redis.go:138

				ErrorType: ErrorTypeNetwork,
				Error:     readErr,
			}
		}

		responseStr := string(response[:n])
		if !strings.Contains(responseStr, "+OK") {
			_ = conn.Close()
			errType := ErrorTypeUnknown
			if strings.Contains(responseStr, "WRONGPASS") ||
				strings.Contains(responseStr, "invalid password") ||
				strings.Contains(responseStr, "ERR AUTH") ||
				strings.Contains(responseStr, "NOAUTH") {
				errType = ErrorTypeAuth
			}
			return &AuthResult{
				Success:   false,
				ErrorType: errType,
				Error:     fmt.Errorf(i18n.GetText("service_auth_failed")+": %s", strings.TrimSpace(responseStr)),
			}
		}
	}

	// 发送PING命令测试连接
	pingCmd := "PING\r\n"
	_ = conn.SetWriteDeadline(time.Now().Add(timeout))
	if _, pingWriteErr := conn.Write([]byte(pingCmd)); pingWriteErr != nil {
		_ = conn.Close()
		return &AuthResult{
			Success:   false,
			ErrorType: ErrorTypeNetwork,
			Error:     pingWriteErr,
		}
	}

	_ = conn.SetReadDeadline(time.Now().Add(timeout))
	response := make([]byte, 512)

View on GitHub (pinned to 95cc12e753)

Solutions

  1. Treat WRONGPASS replies as wrong credential and continue the dictionary
  2. For NOAUTH-class replies verify the Redis instance requires a password at all
  3. Inspect the appended raw response when the error type is unknown
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at plugins/services/redis.go:138 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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