我得到了一个非常古老的桌面应用程序,可能是在带有嵌入式AbsoluteDB的Delphi C ++ Builder中编写的。
我需要使用Swing或Flex / Air创建新版本,但在此之前我需要检查数据库的确切模式。
不幸的是,数据库受密码保护。编写这个应用程序的程序员很久以前离开了公司。
无论如何都要恢复此密码?
答案 0 :(得分:4)
天真蛮力攻击
使用股票TABSDatabase
尝试蛮力攻击是不合理的:
摆脱每一次超负荷
我想出了这个工作裸Delphi课程:
type
TABSDBHack = class
private
FFilename: TFileName;
// 2 relevant contiguous headers of an Absolute Database file
FDBHeader: array [0..SIZEOFDBHEADER-1];
FCryptoHeader: array [0..SIZEOFCRYPTOHEADER-1];
// Mirror of the ControlBlock record from CryptoHeader
FControlBlock: array [0..SIZEOFCONTROLBLOCK-1] of Byte;
//
function GetEncrypted: Boolean;
function GetFileName: TFileName;
function GetPageSize: Word;
function GetPageCountInExtent: Word;
function GetCryptoAlgorithm: Byte;
protected
// Retrieving Data from stream into FDBHeader and FCryptoHeader
procedure ReadStream(F: TStream);
// Mainly FillChar(..., ...,#0) of the corresponding record
procedure ClearDBHeader;
procedure ClearCryptoHeader;
procedure ClearControlBlock;
// Probe the existence of 'ABS0LUTEDATABASE' as file signature
function CheckABSSignature: Boolean;
// Compute the CRC of FControlBlock record
function CRC32: Cardinal;
// Decrypt the persisted Control Block into FControlBlock
function InternalDecryptBuffer(const APassword: string):Boolean;
public
procedure Clear;
// Wrapping a ReadStream using a local TFileStream
procedure LoadFromFile(Filename: TFileName);
// Return True if the decrypted Control Block correspond to original plain one.
// Otherwise stated: The persisted CRC (in the Crypto Header) is equal to
// the value returned by the function CRC32
function CheckPassword(const APassword: string): Boolean;
property FileName: TFileName read GetFileName;
// Sample of plain Data peristed that can be retrieved
property PageSize: Word read GetPageSize;
property PageCountInExtent: Word read GetPageCountInExtent;
property Encrypted: Boolean read GetEncrypted;
property CryptoAlgorithm: Byte read GetCryptoAlgorithm;
end;
我直接从文件中检索了相关数据并探测了给定的密码。
声明:
我使用了绝对数据库版本6.0.7的Personnal Edition来开发它。
类别定义被清除了对分布式DCU中任何类型定义的任何引用,我无权根据它分发二进制文件。
据了解,它主要取决于DCU的分布,主要用于散列和解密方法。随着时间的推移和对绝对数据库内部的更多了解,编写其加密引擎的洁净室实现应该是可行的:它似乎基于 Delphi加密纲要一个免费软件作者:Hagen Reddmann。
探索的其他方向
<强>结论强>
是的!可以根据某些条款恢复密码。
在玩TABSDBHack时,成功的关键是找到一种减少搜索空间的方法(密码是字符串类型):它很容易,特别是弱密码。我强调,它有效。
来自Component Ace的人很聪明并且做得很好(设计密码系统等):你可以信赖绝对数据库,我强烈支持它。