在Python中解密Chrome Linux BLOB加密的Cookie [英] Decrypt Chrome Linux BLOB encrypted cookies in Python

查看:103
本文介绍了在Python中解密Chrome Linux BLOB加密的Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ubuntu中有Chrome 33+,我看到Cookie是以BLOB结构加密的:



CREATE TABLE cookies(creation_utc INTEGER NOT NULL UNIQUE PRIMARY KEY,host_key TEXT NOT NULL,name TEXT NOT NULL,value TEXT NOT NULL,path TEXT NOT NULL,expires_utc INTEGER NOT NULL,secure INTEGER NOT NULL,httponly INTEGER NOT NULL,last_access_utc INTEGER NOT NULL,has_expires INTEGER NOT NULL DEFAULT 1,persistent INTEGER NOT NULL DEFAULT 1,priority INTEGER NOT NULL DEFAULT 1,encrypted_value BLOB DEFAULT'');



我想编写一个python脚本来解密cookie。我已经看到 Chrome 33 Beta的Cookie问题,但依赖于 CryptUnprotectData 这是一个Windows API。



首先我想知道如何加密Cookie。我已经阅读过3DES和AES,但是我没有找到一个可靠的来源来获取信息。



我将编写代码进行必要的加密和解密,如果我有关如何做的信息。



谢谢

解决方案

我已经发布了一个示例Python脚本此处,以解码OSX或Linux中的加密Cookie。


I have Chrome 33+ in Ubuntu and I see that the cookies are encrypted in a BLOB structure:

CREATE TABLE cookies (creation_utc INTEGER NOT NULL UNIQUE PRIMARY KEY,host_key TEXT NOT NULL,name TEXT NOT NULL,value TEXT NOT NULL,path TEXT NOT NULL,expires_utc INTEGER NOT NULL,secure INTEGER NOT NULL,httponly INTEGER NOT NULL,last_access_utc INTEGER NOT NULL, has_expires INTEGER NOT NULL DEFAULT 1, persistent INTEGER NOT NULL DEFAULT 1,priority INTEGER NOT NULL DEFAULT 1,encrypted_value BLOB DEFAULT '');

I would like to write a python script to decrypt the cookie. I've seen that there is Cookie issue with Chrome 33 Beta but relies in CryptUnprotectData that it's a Windows API.

First of all I would like to know how are the cookies encrypted. I've read 3DES and AES but I don't find a trusty source to get the info.

I will write the code to do the necessary encryption and decryption if I have info about how to do it.

Thank you

解决方案

I've posted an example Python script here for decoding the encrypted cookies in either OSX or Linux.

这篇关于在Python中解密Chrome Linux BLOB加密的Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆