shadow1ng/fscan · error

ORA-%05d: %s

Error message

ORA-%05d: %s

What it means

Formatter in oracleRefuseError: the Oracle TNS refuse packet carried a message from which an ORA error code was extracted, so the failure is surfaced as the canonical Oracle error string 'ORA-nnnnn: message' for the refused connection (e.g. ORA-12514 listener does not know of service).

Source

Thrown at plugins/services/oracle_raw.go:1829

		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 {
			continue
		}
		idx += len(marker)
		for idx < len(upper) && (upper[idx] < '0' || upper[idx] > '9') {
			idx++
		}
		start := idx
		for idx < len(upper) && upper[idx] >= '0' && upper[idx] <= '9' {
			idx++
		}
		if start < idx {

View on GitHub (pinned to 95cc12e753)

Solutions

  1. Look up the specific ORA code: listener/service issues (ORA-12514), credentials (ORA-01017), or host blocking (ORA-12541)
  2. Verify service name and port in the connect descriptor
  3. Check that the listener is running and the service is registered
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at plugins/services/oracle_raw.go:1829 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/00bb309cdbe4298a. Report an issue: GitHub.