Skip to content

Commit a4e53e0

Browse files
committed
fix errors on chrome cookie extractor tutorial
1 parent 78f6490 commit a4e53e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ethical-hacking/chrome-cookie-extractor/chrome_cookie_extractor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def decrypt_data(data, key):
5858
def main():
5959
# local sqlite Chrome cookie database path
6060
db_path = os.path.join(os.environ["USERPROFILE"], "AppData", "Local",
61-
"Google", "Chrome", "User Data", "default", "Cookies")
61+
"Google", "Chrome", "User Data", "Default", "Network", "Cookies")
6262
# copy the file to current directory
6363
# as the database will be locked if chrome is currently open
6464
filename = "Cookies.db"
@@ -67,6 +67,8 @@ def main():
6767
shutil.copyfile(db_path, filename)
6868
# connect to the database
6969
db = sqlite3.connect(filename)
70+
# ignore decoding errors
71+
db.text_factory = lambda b: b.decode(errors="ignore")
7072
cursor = db.cursor()
7173
# get the cookies from `cookies` table
7274
cursor.execute("""

0 commit comments

Comments
 (0)