无法进口Win32Crypt,Pywin32,Pypiwin32,Win32或Win32API

发布于 2025-01-20 02:02:38 字数 1373 浏览 2 评论 0原文

我正在尝试解密我的谷歌浏览器的密码。我在设置密码的设备上,并登录到设置密码的用户。这是我正在使用的代码:

import os
import sqlite3 
import win32crypt
def get_chrome():
    data_path = os.path.expanduser('~') + r'{path/to/login-data}'
    c = sqlite3.connect(data_path)
    cursor = c.cursor()
    select_statment = 'SELECT origin_url, username_value, password_value FROM Logins'
    cursor.execute(select_statment)
    login_data = cursor.fetchall()
    cred = {}
    string = ''
    for url, user_name, pwd in login_data:
        pwd = win32crypt.CrypyUnprotectData(pwd)
        cred[url] = (user_name, pwd[1].decode('utf8'))
        string += '\n[+] URL:%s USERNAME:%s PASSWORD:%\n' % (url,user_name,pwd[1]. decode('utf8'))
        print(string)
if __name__=='__main__':
    get_chrome()

我在类似的帖子中尝试了许多建议,例如从 win32 导入(Can't import win32crypt),我也尝试更改为 pywin32、pypiwin32 和 win32api,但没有一个起作用,所有这些都给了我“ModuleNotFoundError: No”模块名为“xxxx””错误。我已经验证我有 pywin32 和 pypiwin32 库,都是最新的。似乎没有什么能让我导入 win32crypt。我还没有找到对我有用的文章。如何导入 win32crypt,或以不同方式解密这些密码?

我已在 win32 库中找到了 win32crypt 文件,并且还确认了 pywin32 和 pypiwin32 都存在。 pywin32 和 pypiwin32 存在 win32crypt.pyd 存在于 win32 lib

I am trying to decrypt passwords for my google chrome. I am on the device the passwords were set up on, and logged in to the user the passwords were set up on. This is the code I am using:

import os
import sqlite3 
import win32crypt
def get_chrome():
    data_path = os.path.expanduser('~') + r'{path/to/login-data}'
    c = sqlite3.connect(data_path)
    cursor = c.cursor()
    select_statment = 'SELECT origin_url, username_value, password_value FROM Logins'
    cursor.execute(select_statment)
    login_data = cursor.fetchall()
    cred = {}
    string = ''
    for url, user_name, pwd in login_data:
        pwd = win32crypt.CrypyUnprotectData(pwd)
        cred[url] = (user_name, pwd[1].decode('utf8'))
        string += '\n[+] URL:%s USERNAME:%s PASSWORD:%\n' % (url,user_name,pwd[1]. decode('utf8'))
        print(string)
if __name__=='__main__':
    get_chrome()

I have tried many suggestions in similiar posts, such as importing from win32 (Can't import win32crypt), which I also tried changing to pywin32, pypiwin32 and win32api, none of which worked, all giving me the "ModuleNotFoundError: No module named 'xxxx'" error. I've verified that I have pywin32 and pypiwin32 libraries, both up to date. Nothing seems to let me import win32crypt. I haven't found an article that has worked for me yet. How can I import win32crypt, or decrypt these passwords in a different manner?

I have located the win32crypt file in the win32 library and have also confirmed pywin32 and pypiwin32 both exist.
pywin32 and pypiwin32 exist
win32crypt.pyd exists in win32 lib

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文