nblog / DeAliWangWang

阿里旺旺数据库解密 (WTFPL License)
7 stars 2 forks source link

如何使用生成的dbkey,打开im.sqlite读取里面的信息? #2

Open cmacro opened 1 year ago

cmacro commented 1 year ago

好,问一下如何使用生成的dbkey,打开im.sqlite读取里面的信息? 尝试用


def main():
    dbkey = generate_db_key()
    print(f"dbey:{dbkey}")
    con = sqlite3.connect('im.sqlite')
    con.execute("PRAGMA key='" + dbkey + "'")
    con.execute("PRAGMA cipher='AES-256-CBC'")

    cursor = con.cursor()
    cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
    tables = cursor.fetchall()
    for table_name in tables:
        print(table_name[0])
    con.close()

Exception has occurred: DatabaseError file is not a database

显示无效的文件,使用DB Browser for SQLite工具尝试SQLCipher3 和 SQLCipher4 都打不开

nblog commented 1 year ago

好,问一下如何使用生成的dbkey,打开im.sqlite读取里面的信息? 尝试用

def main():
    dbkey = generate_db_key()
    print(f"dbey:{dbkey}")
    con = sqlite3.connect('im.sqlite')
    con.execute("PRAGMA key='" + dbkey + "'")
    con.execute("PRAGMA cipher='AES-256-CBC'")

    cursor = con.cursor()
    cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
    tables = cursor.fetchall()
    for table_name in tables:
        print(table_name[0])
    con.close()

Exception has occurred: DatabaseError file is not a database

显示无效的文件,使用DB Browser for SQLite工具尝试SQLCipher3 和 SQLCipher4 都打不开

aes-ecb-128, page_size: 4096, DB Browser for SQLite 只有cbc-256