Skip to content
This repository has been archived by the owner on Oct 5, 2019. It is now read-only.

adds other chrome profile directories to the collection list #154

Merged
merged 8 commits into from
Aug 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: objective-c
os: osx
install:
- sudo pip install tox
- sudo pip install -r requirements-dev.txt
script: make test
deploy:
provider: pypi
Expand Down
20 changes: 11 additions & 9 deletions osxcollector/osxcollector.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -1486,11 +1486,13 @@ def _collect_chrome(self, homedir):
"""Log the different files in a Chrome profile"""
global chrome_ignored_sqlite_keys

chrome_path = pathjoin(homedir.path, 'Library/Application Support/Google/Chrome/Default')
chrome_path = pathjoin(homedir.path, 'Library/Application Support/Google/Chrome')
if not os.path.isdir(chrome_path):
Logger.log_warning('Directory not found {0}'.format(chrome_path))
return

profile_paths = [pathjoin(chrome_path, subdir) for subdir in os.listdir(chrome_path) if os.path.isdir(os.path.join(chrome_path, subdir)) and os.path.isfile("{0}/{1}/History".format(chrome_path, subdir))]

sqlite_dbs = [
('history', 'History'),
('archived_history', 'Archived History'),
Expand All @@ -1499,8 +1501,6 @@ def _collect_chrome(self, homedir):
('top_sites', 'Top Sites'),
('web_data', 'Web Data')
]
self._log_sqlite_dbs_for_subsections(
sqlite_dbs, chrome_path, chrome_ignored_sqlite_keys)

directories_of_dbs = [
('databases', 'databases'),
Expand All @@ -1512,12 +1512,14 @@ def ignore_db_path(sqlite_db_path):
return sqlite_db_path.endswith('-journal') or os.path.isdir(
sqlite_db_path)

self._log_directories_of_dbs(
directories_of_dbs, chrome_path, chrome_ignored_sqlite_keys,
ignore_db_path)

with Logger.Extra('osxcollector_subsection', 'preferences'):
self._log_json_file(chrome_path, 'preferences')
for profile_path in profile_paths:
self._log_directories_of_dbs(
directories_of_dbs, profile_path, chrome_ignored_sqlite_keys,
ignore_db_path)
self._log_sqlite_dbs_for_subsections(
sqlite_dbs, profile_path, chrome_ignored_sqlite_keys)
with Logger.Extra('osxcollector_subsection', 'preferences'):
self._log_json_file(profile_path, 'preferences')

def _collect_kext(self):
"""Log the Kernel extensions"""
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-r requirements.txt
coverage==3.7.1
flake8==2.5.1
mock==1.0.1
pre-commit==0.8.2
pyflakes==0.9.1
testify==0.7.2
tox==2.0.2
xattr==0.7.8