sqlmapproject/sqlmap · error · OperationalError

unexpected Firebird operation %d during login

Error message

unexpected Firebird operation %d during login

What it means

Error "unexpected Firebird operation %d during login" thrown in sqlmapproject/sqlmap.

Source

Thrown at extra/dbwire/firebird.py:853

    if enc_plugin in (b"ChaCha", b"ChaCha64"):
        k = hashlib.sha256(session_key).digest()
        wire.set_ciphers(_ChaCha20(k, nonce), _ChaCha20(k, nonce))
    elif enc_plugin == b"Arc4":
        wire.set_ciphers(_ARC4(session_key), _ARC4(session_key))
    else:
        raise NotSupportedError("unsupported Firebird wire-crypt plugin %r" % enc_plugin)
    _read_response(wire, user, password)  # first encrypted message
    return session_key

def _read_response(wire, user, password):
    # a bare op_response reader used during the login handshake (before a Connection exists)
    op = wire.recv_int()
    while op == _op_dummy:
        op = wire.recv_int()
    if op == _op_cont_auth:
        raise OperationalError("Firebird authentication failed")
    if op != _op_response:
        raise OperationalError("unexpected Firebird operation %d during login" % op)
    return _parse_response(wire)[2]

def _attach(connection, wire, user):
    dpb = bytearray([_isc_dpb_version1])
    dpb += bytearray([_isc_dpb_lc_ctype, 4]) + bytearray(b"UTF8")
    ub = user.encode("utf-8")
    dpb += bytearray([_isc_dpb_user_name, len(ub)]) + bytearray(ub)
    dpb += bytearray([_isc_dpb_process_id, 4]) + bytearray(struct.pack("<i", os.getpid() & 0x7fffffff))
    name = b"sqlmap"
    dpb += bytearray([_isc_dpb_process_name, len(name)]) + bytearray(name)
    wire.send(_pack_int(_op_attach) + _pack_int(0) + _pack_bytes(connection._filename) + _pack_bytes(bytes(dpb)))
    connection._db_handle = connection._response()[0]

    tpb = bytes(bytearray([_isc_tpb_version3, _isc_tpb_write, _isc_tpb_wait,
                           _isc_tpb_read_committed, _isc_tpb_rec_version]))
    wire.send(_pack_int(_op_transaction) + _pack_int(connection._db_handle) + _pack_bytes(tpb))
    connection._trans_handle = connection._response()[0]

View on GitHub (pinned to 0a35b20e39)

When it happens

Trigger: Thrown at extra/dbwire/firebird.py:853 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/3469abd355606aec. Report an issue: GitHub.