shadow1ng/fscan · error

oracle connection refused

Error message

oracle connection refused

What it means

Raised by oracleRefuseError when the raw TNS response is shorter than the 12-byte fixed header, so a proper refusal reason cannot be parsed — the port answered but did not speak a valid Oracle TNS response.

Source

Thrown at plugins/services/oracle_raw.go:1818

func (s *oracleSession) hasError() bool {
	return s.summary != nil && s.summary.retCode != 0 && s.summary.retCode != 1403
}

func (s *oracleSession) oracleError() error {
	if s.summary == nil {
		return errors.New("oracle error")
	}
	msg := string(s.summary.errorMessage)
	if msg == "" {
		msg = fmt.Sprintf("ORA-%05d", s.summary.retCode)
	}
	return fmt.Errorf("%s", msg)
}

func oracleRefuseError(raw []byte) error {
	if len(raw) < 12 {
		return errors.New("oracle connection refused")
	}
	dataLen := int(binary.BigEndian.Uint16(raw[10:12]))
	if len(raw) < 12+dataLen {
		return errors.New("oracle connection refused")
	}
	msg := string(raw[12 : 12+dataLen])
	code := oracleExtractCode(msg)
	if code == 0 {
		return fmt.Errorf("oracle connection refused: %s", msg)
	}
	return fmt.Errorf("ORA-%05d: %s", code, msg)
}

func oracleExtractCode(msg string) int {
	upper := strings.ToUpper(msg)
	for _, marker := range []string{"ERR=", "CODE="} {
		idx := strings.Index(upper, marker)
		if idx < 0 {

View on GitHub (pinned to 95cc12e753)

Solutions

  1. Mark the service as not-oracle rather than retrying; the banner is not TNS
  2. Re-probe the service banner to identify the real protocol
  3. Check for a firewall/proxy mangling the response
Defensive patterns

Strategy: validation

When it happens

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

Common situations: See trigger scenarios.

Understand the failure class


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