渗透技巧——导出Chrome浏览器中保存的密码

来源:岁月联盟 编辑:猪蛋儿 时间:2020-02-16
same logon credentials as the user who encrypted the data.In addition,
the encryption and decryption must be done on the same computer. “
是否可以断定,无法在另一系统下导出Chrome浏览器中保存的密码呢?
答案是否定的
Chrome密码还原工具chromepass提供了一个特别的功能: Reading ChromePass passwords from external drive
chromepass下载地址:
http://www.nirsoft.net/utils/chromepass.html
说明如下:
“you can also read the passwords stored by Chrome Web browser from an
external profile in your current operating system or from another
external drive”
也就是说,使用chromepass能够导出当前系统下另一用户的Chrome密码
操作界面如下图

既然如此,如果获得了另一系统下的相关配置文件,能否导出Chrome浏览器中保存的密码呢?
当然可以
解密需要获得三部分内容:
1.加密密钥,位于%appdata%/Microsoft/Protect下对应sid文件夹下的文件
2.数据库文件Login Data
3.用户明文的密码,用于解密加密密钥
由于chromepass程序的设计问题,以上文件需要组成特定格式,子目录格式如下:
1./AppData/Local/Google/Chrome/User Data/Default/Login Data
2./AppData/Roaming/Microsoft/Protect{sid}}/下保存key文件
注:
{sid}必须同原系统的对应
eg.
/AppData/Local/Google/Chrome/User Data/Default/Login Data
/AppData/Roaming/Microsoft/Protect/S-1-5-21-3453529135-4164765056-1075703908-1001/329c4147-0011-4ad6-829d-e32dcbd1bbd7
如下图

使用chromepass选择该目录,填入用户明文密码,如下图

成功解密,如下图

0x05 开源工具
解密当前系统下Chrome浏览器中保存的密码,可供参考的工具:
1.命令行工具Chrome Password Dump,下载地址:
http://securityxploded.com/chrome-password-dump.php
2.powershell实现的工具:
https://raw.githubusercontent.com/EmpireProject/Empire/master/data/module_source/collection/Get-ChromeDump.ps1
3.python实现代码,可供参考的开源代码:
from os import getenv
import sqlite3
import win32crypt
import binascii
conn = sqlite3.connect(getenv("APPDATA") + "/../Local/Google/Chrome/User Data/Default/Login Data")
cursor = conn.cursor()
cursor.execute('SELECT action_url, username_value, password_value FROM logins')
for result in cursor.fetchall():
    password = win32crypt.CryptUnprotectData(result[2], None, None, None, 0)[1]
    if password:
        print 'Site: ' + result[0]
        print 'Username: ' + result[1]
        print 'Password: ' + password
    else:
        print "no password found"
0x06 小结
本文介绍了导出Chrome浏览器密码的原理和利用方法,成功解决一个实际问题: 通过加密密钥文件和用户明文密码,能够导出另一系统下Chrome浏览器中保存的密码
如果只获得了用户密码hash,能否导出呢?
 

上一页  [1] [2]