def decrypt_cookie_db(self):
if self.platform == OperatingSystem.LINUX:
import keyring
from Crypto.Protocol.KDF import PBKDF2
salt = b'saltysalt'
length = 16
# If running Chrome on OSX
if sys.platform == 'darwin':
my_pass = keyring.get_password('Chrome Safe Storage', 'Chrome')
my_pass = my_pass.encode('utf8')
iterations = 1003
self.cookie_file = os.path.expanduser('~/Library/Application Support/Google/Chrome/Default/Cookies')
# If running Chromium on Linux
elif 'linux' in sys.platform:
my_pass = 'peanuts'.encode('utf8')
iterations = 1
self.cookie_file = os.path.expanduser('~/.config/chromium/Default/Cookies')
self.key = PBKDF2(my_pass, salt, length, iterations)
return self.linux_decrypt_value
elif self.platform == OperatingSystem.WINDOWS:
return self.windows_decrypt_value
评论列表
文章目录