Skip to content

Commit ac93047

Browse files
committed
Update version to 2021.01.16, readying for PyPI/GH release, and minor syntax fixes.
1 parent 13b7a64 commit ac93047

8 files changed

Lines changed: 32 additions & 32 deletions

File tree

hindsight_gui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def do_run():
150150

151151
# Hindsight version info
152152
log.info(
153-
'\n' + '#' * 80 + '\n### Hindsight v{} (https://github.com/obsidianforensics/hindsight) ###\n'
153+
'\n' + '#' * 80 + '\n### Hindsight v{} (https://github.com/obsidianforensics/hindsight) ###\n'
154154
.format(pyhindsight.__version__) + '#' * 80)
155155

156156
if 'windows' in ui_selected_decrypts:

pyhindsight/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__author__ = "Ryan Benson"
2-
__version__ = "20201120"
2+
__version__ = "2021.01.16"
33
__email__ = "ryan@dfir.blog"

pyhindsight/analysis.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,15 +790,15 @@ def generate_excel(self, output_object):
790790
w.write_string(row_number, 2, item.url, gray_url_format) # URL
791791
except Exception as e:
792792
print(e, item.url, item.location)
793-
w.write_string(row_number, 3, str(item.name), gray_field_format) # cached status // Normal (data cached)
794-
w.write_string(row_number, 4, item.value, gray_value_format) # content-type (size) // image/jpeg (2035 bytes)
793+
w.write_string(row_number, 3, str(item.name), gray_field_format) # status // Normal (data cached)
794+
w.write_string(row_number, 4, item.value, gray_value_format) # type (size) // image/jpeg (35 bytes)
795795
w.write(row_number, 5, item.interpretation, gray_value_format) # cookie interpretation
796796
w.write(row_number, 6, item.profile, gray_value_format) # Profile
797797
w.write(row_number, 16, item.etag, gray_value_format) # ETag
798798
w.write(row_number, 17, item.last_modified, gray_value_format) # Last Modified
799799
w.write(row_number, 18, item.server_name, gray_value_format) # Server name
800-
w.write(row_number, 19, item.location, gray_value_format) # Cached data location // data_2 [1542523]
801-
w.write(row_number, 20, item.http_headers_str, gray_value_format) # Cached data location // data_2 [1542523]
800+
w.write(row_number, 19, item.location, gray_value_format) # data location // data_2 [1542523]
801+
w.write(row_number, 20, item.http_headers_str, gray_value_format) # headers
802802

803803
elif item.row_type.startswith("local storage"):
804804
w.write_string(row_number, 0, item.row_type, gray_type_format) # record_type

pyhindsight/browsers/chrome.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def get_history(self, path, history_file, version, row_type):
274274
while compatible_version not in list(query.keys()) and compatible_version > 0:
275275
compatible_version -= 1
276276

277-
if compatible_version is not 0:
277+
if compatible_version != 0:
278278
log.info(f' - Using SQL query for History items for Chrome {compatible_version}')
279279
try:
280280
# Copy and connect to copy of 'History' SQLite DB
@@ -344,7 +344,7 @@ def get_media_history(self, path, history_file, version, row_type):
344344
while compatible_version not in list(query.keys()) and compatible_version > 0:
345345
compatible_version -= 1
346346

347-
if compatible_version is not 0:
347+
if compatible_version != 0:
348348
log.info(f' - Using SQL query for Media History items for Chrome {compatible_version}')
349349
try:
350350
# Copy and connect to copy of 'Media History' SQLite DB
@@ -430,7 +430,7 @@ def get_downloads(self, path, database, version, row_type):
430430
while compatible_version not in list(query.keys()) and compatible_version > 0:
431431
compatible_version -= 1
432432

433-
if compatible_version is not 0:
433+
if compatible_version != 0:
434434
log.info(f' - Using SQL query for Download items for Chrome v{compatible_version}')
435435
try:
436436
# Copy and connect to copy of 'History' SQLite DB
@@ -517,13 +517,13 @@ def clean(x):
517517
if encrypted_value is not None:
518518
if len(encrypted_value) >= 2:
519519
# If running Chrome on Windows
520-
if sys.platform == 'win32' and self.available_decrypts['windows'] is 1:
520+
if sys.platform == 'win32' and self.available_decrypts['windows'] == 1:
521521
try:
522522
decrypted_value = win32crypt.CryptUnprotectData(encrypted_value, None, None, None, 0)[1]
523523
except:
524524
decrypted_value = "<encrypted>"
525525
# If running Chrome on OSX
526-
elif sys.platform == 'darwin' and self.available_decrypts['mac'] is 1:
526+
elif sys.platform == 'darwin' and self.available_decrypts['mac'] == 1:
527527
try:
528528
if not self.cached_key:
529529
my_pass = keyring.get_password('Chrome Safe Storage', 'Chrome')
@@ -538,7 +538,7 @@ def clean(x):
538538

539539
# If running Chromium on Linux.
540540
# Unlike Win/Mac, we can decrypt Linux cookies without the user's pw
541-
if decrypted_value is "<encrypted>" and self.available_decrypts['linux'] is 1:
541+
if decrypted_value == "<encrypted>" and self.available_decrypts['linux'] == 1:
542542
try:
543543
if not self.cached_key:
544544
my_pass = 'peanuts'
@@ -583,7 +583,7 @@ def get_cookies(self, path, database, version):
583583
while compatible_version not in list(query.keys()) and compatible_version > 0:
584584
compatible_version -= 1
585585

586-
if compatible_version is not 0:
586+
if compatible_version != 0:
587587
log.info(" - Using SQL query for Cookie items for Chrome v{}".format(compatible_version))
588588
try:
589589
# Copy and connect to copy of 'Cookies' SQLite DB
@@ -664,7 +664,7 @@ def get_login_data(self, path, database, version):
664664
while compatible_version not in list(query.keys()) and compatible_version > 0:
665665
compatible_version -= 1
666666

667-
if compatible_version is not 0:
667+
if compatible_version != 0:
668668
log.info(f' - Using SQL query for Login items for Chrome v{compatible_version}')
669669

670670
# Copy and connect to copy of 'Login Data' SQLite DB
@@ -708,7 +708,7 @@ def get_login_data(self, path, database, version):
708708
username_row.row_type = 'login (username)'
709709
results.append(username_row)
710710

711-
if row.get('password_value') is not None and self.available_decrypts['windows'] is 1:
711+
if row.get('password_value') is not None and self.available_decrypts['windows'] == 1:
712712
try:
713713
# Windows is all I've had time to test; Ubuntu uses built-in password manager
714714
password = win32crypt.CryptUnprotectData(
@@ -734,7 +734,7 @@ def get_login_data(self, path, database, version):
734734
while compatible_version not in list(query.keys()) and compatible_version > 0:
735735
compatible_version -= 1
736736

737-
if compatible_version is not 0:
737+
if compatible_version != 0:
738738
log.info(f' - Using SQL query for Login Stat items for Chrome v{compatible_version}')
739739

740740
# Copy and connect to copy of 'Login Data' SQLite DB
@@ -779,7 +779,7 @@ def get_autofill(self, path, database, version):
779779
while compatible_version not in list(query.keys()) and compatible_version > 0:
780780
compatible_version -= 1
781781

782-
if compatible_version is not 0:
782+
if compatible_version != 0:
783783
log.info(" - Using SQL query for Autofill items for Chrome v{}".format(compatible_version))
784784
try:
785785
# Copy and connect to copy of 'Web Data' SQLite DB
@@ -1420,7 +1420,7 @@ def expand_language_code(code):
14201420
prefs['profile']['content_settings']['exceptions']['sound'].items():
14211421
if pref_data.get('last_modified'):
14221422
interpretation = ''
1423-
if pref_data.get('setting') is 2:
1423+
if pref_data.get('setting') == 2:
14241424
interpretation = 'Muted site'
14251425
pref_item = Chrome.PreferenceItem(
14261426
self.profile_path, url=origin,

pyhindsight/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def get_ldb_records(ldb_path, prefix=''):
159159
try:
160160
db = ccl_leveldb.RawLevelDb(ldb_path)
161161
except Exception as e:
162-
log.warning(f' - Couldn\'t open {ldb_path} as LevelDB; {e}')
162+
log.warning(f' - Could not open {ldb_path} as LevelDB; {e}')
163163
return []
164164

165165
cleaned_records = []
@@ -177,6 +177,7 @@ def get_ldb_records(ldb_path, prefix=''):
177177

178178
cleaned_records.append(cleaned_record)
179179

180+
db.close()
180181
return cleaned_records
181182

182183

@@ -234,7 +235,7 @@ def read_int64(input_bytes, ptr):
234235
| | | | | | | | (_| \__ \ | (_| | | | | |_
235236
|_| |_|_|_| |_|\__,_|___/_|\__, |_| |_|\__|
236237
__/ |
237-
by @_RyanBenson |___/ v{}
238+
by @_RyanBenson |___/ v{}
238239
239240
################################################################################
240241
'''.format(__version__)

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
packages=find_packages(),
55
include_package_data=True,
66
scripts=['hindsight.py', 'hindsight_gui.py'],
7-
version='20200607',
7+
version='20210116',
88
description='Browser forensics for Google Chrome/Chromium',
99
url='https://github.com/obsidianforensics/hindsight',
1010
author='Ryan Benson',
@@ -15,7 +15,6 @@
1515
install_requires=[
1616
'bottle>=0.12.18',
1717
'keyring>=21.2.1',
18-
# 'plyvel>=1.2',
1918
'pycryptodomex>=3.9.7',
2019
# 'pypiwin32>=219',
2120
'pytz>=2020.1',

spec/file_version_info_cmd.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ VSVersionInfo(
66
ffi=FixedFileInfo(
77
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
88
# Set not needed items to zero 0.
9-
filevers=(2, 3, 0, 0),
10-
prodvers=(2, 3, 0, 0),
9+
filevers=(2021, 1, 16, 0),
10+
prodvers=(2021, 1, 16, 0),
1111
# Contains a bitmask that specifies the valid bits 'flags'r
1212
mask=0x0,
1313
# Contains a bitmask that specifies the Boolean attributes of the file.
@@ -33,10 +33,10 @@ VSVersionInfo(
3333
[StringStruct(u'Comments', u'Internet history forensics for Google Chrome/Chromium'),
3434
StringStruct(u'CompanyName', u'dfir.blog'),
3535
StringStruct(u'FileDescription', u'Hindsight'),
36-
StringStruct(u'LegalCopyright', u'Copyright© 2012 - 2019 Ryan Benson'),
36+
StringStruct(u'LegalCopyright', u'Copyright© 2012 - 2021 Ryan Benson'),
3737
StringStruct(u'ProductName', u'Hindsight'),
38-
StringStruct(u'FileVersion', u'2.3.0'),
39-
StringStruct(u'ProductVersion', u'2.3.0'),
38+
StringStruct(u'FileVersion', u'2021.01.16'),
39+
StringStruct(u'ProductVersion', u'2021.01.16'),
4040
StringStruct(u'InternalName', u'Hindsight'),
4141
StringStruct(u'OriginalFilename', u'hindsight.exe')])
4242
])

spec/file_version_info_gui.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ VSVersionInfo(
66
ffi=FixedFileInfo(
77
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
88
# Set not needed items to zero 0.
9-
filevers=(2, 3, 0, 0),
10-
prodvers=(2, 3, 0, 0),
9+
filevers=(2021, 1, 16, 0),
10+
prodvers=(2021, 1, 16, 0),
1111
# Contains a bitmask that specifies the valid bits 'flags'r
1212
mask=0x0,
1313
# Contains a bitmask that specifies the Boolean attributes of the file.
@@ -33,10 +33,10 @@ VSVersionInfo(
3333
[StringStruct(u'Comments', u'Internet history forensics for Google Chrome/Chromium'),
3434
StringStruct(u'CompanyName', u'dfir.blog'),
3535
StringStruct(u'FileDescription', u'Hindsight'),
36-
StringStruct(u'LegalCopyright', u'Copyright© 2012 - 2019 Ryan Benson'),
36+
StringStruct(u'LegalCopyright', u'Copyright© 2012 - 2021 Ryan Benson'),
3737
StringStruct(u'ProductName', u'Hindsight'),
38-
StringStruct(u'FileVersion', u'2.3.0'),
39-
StringStruct(u'ProductVersion', u'2.3.0'),
38+
StringStruct(u'FileVersion', u'2021.01.16'),
39+
StringStruct(u'ProductVersion', u'2021.01.16'),
4040
StringStruct(u'InternalName', u'Hindsight'),
4141
StringStruct(u'OriginalFilename', u'hindsight_gui.exe')])
4242
])

0 commit comments

Comments
 (0)