def read_chrome_cookies(cookies_db, tm_min=0, tm_max=10000000000000, host=None):
command = "SELECT name, host_key, value, creation_utc, expires_utc, last_access_utc, has_expires from cookies " \
+ "WHERE (creation_utc/10000000 > %s AND creation_utc/10000000 < %s);" % (tm_min, tm_max)
if host:
command = command[:-1] + " AND (host_key LIKE '%s');" % host
res = pull_from_db(cookies_db, command)
data = init_data("chrome_scanner Cookies", len(res)) + init_table_header("./templates/init_chrome_cookies_html.html")
exp_dict = {"0" : "No", "1" : "Yes"}
for row in res:
creation_date = dt.fromtimestamp(row[3]/10000000)
exp_date = dt.fromtimestamp(row[4]/10000000)
last_access_date = dt.fromtimestamp(row[5]/10000000)
exp_stat = exp_dict[str(row[6])]
line = "<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td>" % (row[1], row[0], row[2], creation_date) \
+ "<td>%s</td><td>%s</td><td>%s</td></tr>" % (exp_date, last_access_date, exp_stat)
data += line
data += close_table_html()
saveResult("chrome_cookies.html", data)
评论列表
文章目录