Lucas Silva Chaves
Lucas Silva Chaves

Reputation: 15

SYSDBA user is blocked from access to Firebird 2.x database

I have a firebird database in a .fdb file, but the database do not have the SYSDBA user and I don't remember the credentials to login into the database. Are there any way that could reset the database credentials?

enter image description here

Upvotes: 0

Views: 1997

Answers (2)

Arioch 'The
Arioch 'The

Reputation: 16045

Like said by Mark, it is not that the database "does not have SYSDBA user" - databases in Firebird 2.x never have users - but that old trick was used to create SYSDBA named role in order to trigger names collision on login.

After scanning through 2007 Security presentation I have two suggestions for you.

  1. You can try some tool that opens Firebird databases without using Firebird itself to learn what username can pull you out of the deadlock.

One such tool is Database Explorer in the IBExpert. Full IBExpert is paid for non-USSR states and free IBExpert Personal probably does not have the tool. But I hope the tool works in IBExpert Trial. Another tool is IBSurgeon FirstAID. And probably there are more tools featuring data extraction from corrupt databases. You only need to find and read one specific row.

The query to create the blocking role is given on the 23rd page of the presentation.

INSERT INTO RDB$ROLES(RDB$ROLE_NAME, RDB$OWNER_NAME)
VALUES (‘SYSDBA’, ‘LOCKSMITH’);

So you would have to look into the said table, find the row with the said role, and learn the username that has authority over that role (in the example it was LOCKSMITH).

After that you connect to any other database on the same server and you create the user with the name you learnt. Then you use that name to login into the problematic database and to DROP ROLE SYSDBA; COMMIT;.

  1. You also can use Firebird Embedded. All server-coded security checks are bypassed in the Embedded edition of FB 2.x (but if DB designer added some ad hoc security checks in triggers - they will work). So you login into the problematic database using Firebird Embedded edition, any username and any password, and after that you drop the access blocking role.

Upvotes: 2

Gluttton
Gluttton

Reputation: 5978

In Firebird database doesn't contain password (until v3.0 as mentioned by @Arioch'The). The password is used only for server. Another words, you can copy database file from existed server to another (with known password) and open the database file.

Upvotes: 0

Related Questions