23 package org.sleuthkit.autopsy.recentactivity;
25 import com.google.common.collect.ImmutableMap;
26 import com.google.gson.JsonArray;
27 import com.google.gson.JsonElement;
28 import com.google.gson.JsonIOException;
29 import com.google.gson.JsonObject;
30 import com.google.gson.JsonParser;
31 import com.google.gson.JsonSyntaxException;
32 import org.openide.util.NbBundle;
34 import java.util.logging.Level;
36 import java.io.FileNotFoundException;
37 import java.io.FileReader;
38 import java.io.IOException;
39 import java.util.Collection;
40 import java.util.List;
42 import java.util.HashMap;
43 import java.util.ArrayList;
44 import java.util.Arrays;
46 import org.apache.commons.io.FilenameUtils;
47 import org.apache.commons.lang3.StringUtils;
48 import org.openide.util.NbBundle.Messages;
60 import org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
62 import org.
sleuthkit.datamodel.ReadContentInputStream.ReadContentInputStreamException;
66 import org.
sleuthkit.datamodel.blackboardutils.WebBrowserArtifactsHelper;
71 class Chromium
extends Extract {
73 private static final String HISTORY_QUERY =
"SELECT urls.url, urls.title, urls.visit_count, urls.typed_count, " 74 +
"last_visit_time, urls.hidden, visits.visit_time, (SELECT urls.url FROM urls WHERE urls.id=visits.url) AS from_visit, visits.transition FROM urls, visits WHERE urls.id = visits.url";
75 private static final String COOKIE_QUERY =
"SELECT name, value, host_key, expires_utc,last_access_utc, creation_utc FROM cookies";
76 private static final String DOWNLOAD_QUERY =
"SELECT full_path, url, start_time, received_bytes FROM downloads";
77 private static final String DOWNLOAD_QUERY_V30 =
"SELECT current_path AS full_path, url, start_time, received_bytes FROM downloads, downloads_url_chains WHERE downloads.id=downloads_url_chains.id";
78 private static final String LOGIN_QUERY =
"SELECT origin_url, username_value, date_created, signon_realm from logins";
79 private static final String AUTOFILL_QUERY =
"SELECT name, value, count, date_created " 80 +
" FROM autofill, autofill_dates " 81 +
" WHERE autofill.pair_id = autofill_dates.pair_id";
82 private static final String AUTOFILL_QUERY_V8X =
"SELECT name, value, count, date_created, date_last_used from autofill";
83 private static final String WEBFORM_ADDRESS_QUERY =
"SELECT first_name, middle_name, last_name, address_line_1, address_line_2, city, state, zipcode, country_code, number, email, date_modified " 84 +
" FROM autofill_profiles, autofill_profile_names, autofill_profile_emails, autofill_profile_phones" 85 +
" WHERE autofill_profiles.guid = autofill_profile_names.guid AND autofill_profiles.guid = autofill_profile_emails.guid AND autofill_profiles.guid = autofill_profile_phones.guid";
87 private static final String WEBFORM_ADDRESS_QUERY_V8X =
"SELECT first_name, middle_name, last_name, full_name, street_address, city, state, zipcode, country_code, number, email, date_modified, use_date, use_count" 88 +
" FROM autofill_profiles, autofill_profile_names, autofill_profile_emails, autofill_profile_phones" 89 +
" WHERE autofill_profiles.guid = autofill_profile_names.guid AND autofill_profiles.guid = autofill_profile_emails.guid AND autofill_profiles.guid = autofill_profile_phones.guid";
90 private static final String FAVICON_QUERY =
"SELECT page_url, last_updated, last_requested FROM icon_mapping, favicon_bitmaps " 91 +
" WHERE icon_mapping.icon_id = favicon_bitmaps.icon_id";
92 private static final String LOCALSTATE_FILE_NAME =
"Local State";
93 private static final String EXTENSIONS_FILE_NAME =
"Secure Preferences";
94 private static final String HISTORY_FILE_NAME =
"History";
95 private static final String BOOKMARK_FILE_NAME =
"Bookmarks";
96 private static final String COOKIE_FILE_NAME =
"Cookies";
97 private static final String LOGIN_DATA_FILE_NAME =
"Login Data";
98 private static final String WEB_DATA_FILE_NAME =
"Web Data";
99 private static final String FAVICON_DATA_FILE_NAME =
"Favicons";
100 private static final String UC_BROWSER_NAME =
"UC Browser";
101 private static final String OPERA_BROWSER_NAME =
"Opera";
102 private static final String ENCRYPTED_FIELD_MESSAGE =
"The data was encrypted.";
103 private static final String GOOGLE_PROFILE_NAME =
"Profile";
104 private static final String GOOGLE_PROFILE =
"Google Chrome ";
105 private static final String FAVICON_ARTIFACT_NAME =
"TSK_FAVICON";
106 private static final String LOCAL_STATE_ARTIFACT_NAME =
"TSK_LOCAL_STATE";
107 private static final String EXTENSIONS_ARTIFACT_NAME =
"TSK_CHROME_EXTENSIONS";
109 private Boolean databaseEncrypted =
false;
110 private Boolean fieldEncrypted =
false;
112 private final Logger logger = Logger.getLogger(this.getClass().getName());
113 private Content dataSource;
114 private final IngestJobContext context;
116 private Map<String, String> userProfiles;
117 private Map<String, String> browserLocations;
119 private static final Map<String, String> BROWSERS_MAP = ImmutableMap.<String, String>builder()
120 .put(
"Microsoft Edge",
"Microsoft/Edge/User Data")
121 .put(
"Yandex",
"YandexBrowser/User Data")
122 .put(
"Opera",
"Opera Software/Opera Stable")
123 .put(
"SalamWeb",
"SalamWeb/User Data")
124 .put(
"UC Browser",
"UCBrowser/User Data%")
125 .put(
"Brave",
"BraveSoftware/Brave-Browser/User Data")
126 .put(
"Google Chrome",
"Chrome/User Data")
129 @Messages({
"# {0} - browserName",
130 "Progress_Message_Chrome_History=Chrome History Browser {0}",
131 "# {0} - browserName",
132 "Progress_Message_Chrome_Bookmarks=Chrome Bookmarks Browser {0}",
133 "# {0} - browserName",
134 "Progress_Message_Chrome_Cookies=Chrome Cookies Browser {0}",
135 "# {0} - browserName",
136 "Progress_Message_Chrome_Downloads=Chrome Downloads Browser {0}",
137 "Progress_Message_Chrome_Profiles=Chrome Profiles {0}",
138 "Progress_Message_Chrome_Extensions=Chrome Extensions {0}",
139 "Progress_Message_Chrome_Favicons=Chrome Downloads Favicons {0}",
140 "Progress_Message_Chrome_FormHistory=Chrome Form History",
141 "# {0} - browserName",
142 "Progress_Message_Chrome_AutoFill=Chrome Auto Fill Browser {0}",
143 "# {0} - browserName",
144 "Progress_Message_Chrome_Logins=Chrome Logins Browser {0}",
145 "Progress_Message_Chrome_Cache=Chrome Cache",})
147 Chromium(IngestJobContext context) {
148 super(NbBundle.getMessage(Chromium.class,
"Chrome.moduleName"), context);
149 this.context = context;
153 public void process(Content dataSource, DataSourceIngestModuleProgress progressBar) {
154 this.dataSource = dataSource;
156 long ingestJobId = context.getJobId();
158 userProfiles =
new HashMap<>();
159 browserLocations =
new HashMap<>();
160 for (Map.Entry<String, String> browser : BROWSERS_MAP.entrySet()) {
161 progressBar.progress(NbBundle.getMessage(
this.getClass(),
"Progress_Message_Chrome_Profiles", browser.getKey()));
162 getProfiles(browser.getKey(), browser.getValue(), ingestJobId);
163 if (context.dataSourceIngestIsCancelled()) {
167 for (Map.Entry<String, String> profile : userProfiles.entrySet()) {
168 String browserLocation = profile.getKey();
169 String browserName = browserLocations.get(browserLocation);
170 String userName = profile.getValue();
171 progressBar.progress(NbBundle.getMessage(
this.getClass(),
"Progress_Message_Chrome_Extensions", browserName));
172 this.getExtensions(browserName, browserLocation, userName, ingestJobId);
173 if (context.dataSourceIngestIsCancelled()) {
176 progressBar.progress(NbBundle.getMessage(
this.getClass(),
"Progress_Message_Chrome_History", browserName));
177 this.getHistory(browserName, browserLocation, userName, ingestJobId);
178 if (context.dataSourceIngestIsCancelled()) {
182 progressBar.progress(NbBundle.getMessage(
this.getClass(),
"Progress_Message_Chrome_Bookmarks", browserName));
183 this.getBookmark(browserName, browserLocation, userName, ingestJobId);
184 if (context.dataSourceIngestIsCancelled()) {
188 progressBar.progress(NbBundle.getMessage(
this.getClass(),
"Progress_Message_Chrome_Cookies", browserName));
189 this.getCookie(browserName, browserLocation, userName, ingestJobId);
190 if (context.dataSourceIngestIsCancelled()) {
194 progressBar.progress(NbBundle.getMessage(
this.getClass(),
"Progress_Message_Chrome_Logins", browserName));
195 this.getLogins(browserName, browserLocation, userName, ingestJobId);
196 if (context.dataSourceIngestIsCancelled()) {
200 progressBar.progress(NbBundle.getMessage(
this.getClass(),
"Progress_Message_Chrome_AutoFill", browserName));
201 this.getAutofill(browserName, browserLocation, userName, ingestJobId);
202 if (context.dataSourceIngestIsCancelled()) {
206 progressBar.progress(NbBundle.getMessage(
this.getClass(),
"Progress_Message_Chrome_Downloads", browserName));
207 this.getDownload(browserName, browserLocation, userName, ingestJobId);
208 if (context.dataSourceIngestIsCancelled()) {
212 progressBar.progress(NbBundle.getMessage(
this.getClass(),
"Progress_Message_Chrome_Favicons", browserName));
213 this.getFavicons(browserName, browserLocation, userName, ingestJobId);
214 if (context.dataSourceIngestIsCancelled()) {
219 progressBar.progress(Bundle.Progress_Message_Chrome_Cache());
220 ChromeCacheExtractor chromeCacheExtractor =
new ChromeCacheExtractor(dataSource, context, progressBar);
221 chromeCacheExtractor.processCaches();
231 private void getProfiles(String browser, String browserLocation,
long ingestJobId) {
232 FileManager fileManager = currentCase.getServices().getFileManager();
233 String browserName = browser;
234 List<AbstractFile> localStateFiles;
235 String localStateName = LOCALSTATE_FILE_NAME;
236 if (browserName.equals(UC_BROWSER_NAME)) {
237 localStateName = LOCALSTATE_FILE_NAME +
"%";
240 localStateFiles = fileManager.findFiles(dataSource, localStateName, browserLocation);
241 }
catch (TskCoreException ex) {
242 String msg = NbBundle.getMessage(this.getClass(),
"Chrome.getLocalState.errMsg.errGettingFiles");
243 logger.log(Level.SEVERE, msg, ex);
244 this.addErrorMessage(this.getDisplayName() +
": " + msg);
249 List<AbstractFile> allocatedLocalStateFiles =
new ArrayList<>();
250 for (AbstractFile localStateFile : localStateFiles) {
251 if (localStateFile.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.ALLOC)) {
252 allocatedLocalStateFiles.add(localStateFile);
257 if (allocatedLocalStateFiles.isEmpty()) {
258 String msg = NbBundle.getMessage(this.getClass(),
"Chrome.getLocalState.errMsg.couldntFindAnyFiles");
259 logger.log(Level.INFO, msg);
264 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
266 while (j < allocatedLocalStateFiles.size()) {
267 if (browser.contains(GOOGLE_PROFILE_NAME)) {
268 String parentPath = FilenameUtils.normalizeNoEndSeparator(allocatedLocalStateFiles.get(j).getParentPath());
269 browserName = GOOGLE_PROFILE +
" " + FilenameUtils.getBaseName(parentPath);
271 String temps = RAImageIngestModule.getRATempPath(currentCase, browserName, ingestJobId) + File.separator + allocatedLocalStateFiles.get(j).getName() + j;
272 final AbstractFile localStateFile = allocatedLocalStateFiles.get(j++);
273 if ((localStateFile.getSize() == 0) || (localStateFile.getName().toLowerCase().contains(
"-slack"))
274 || (localStateFile.getName().toLowerCase().contains(
"cache")) || (localStateFile.getName().toLowerCase().contains(
"media"))
275 || (localStateFile.getName().toLowerCase().contains(
"index"))) {
279 ContentUtils.writeToFile(localStateFile,
new File(temps), context::dataSourceIngestIsCancelled);
280 }
catch (ReadContentInputStreamException ex) {
281 logger.log(Level.WARNING, String.format(
"Error reading Chrome web Local State artifacts file '%s' (id=%d).",
282 localStateFile.getName(), localStateFile.getId()), ex);
283 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getLocalState.errMsg.errAnalyzingFile",
284 this.getDisplayName(), localStateFile.getName()));
286 }
catch (IOException ex) {
287 logger.log(Level.SEVERE, String.format(
"Error writing temp file '%s' for Chrome Local State artifacts file '%s' (id=%d).",
288 temps, localStateFile.getName(), localStateFile.getId()), ex);
289 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getLocalState.errMsg.errAnalyzingFile",
290 this.getDisplayName(), localStateFile.getName()));
294 if (context.dataSourceIngestIsCancelled()) {
298 FileReader tempReader;
300 tempReader =
new FileReader(temps);
301 }
catch (FileNotFoundException ex) {
302 logger.log(Level.WARNING,
"Error while trying to read into the LocalState file.", ex);
306 JsonElement jsonElement;
307 JsonObject jElement, jProfile, jInfoCache;
310 jsonElement = JsonParser.parseReader(tempReader);
311 jElement = jsonElement.getAsJsonObject();
312 if (jElement.has(
"profile")) {
313 jProfile = jElement.get(
"profile").getAsJsonObject();
314 jInfoCache = jProfile.get(
"info_cache").getAsJsonObject();
318 }
catch (JsonIOException | JsonSyntaxException | IllegalStateException ex) {
319 logger.log(Level.WARNING,
"Error parsing Json from LocalState.", ex);
320 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getlocalState.errMsg.errAnalyzingFile",
321 this.getDisplayName(), localStateFile.getName()));
325 BlackboardArtifact.Type localStateArtifactType;
328 localStateArtifactType = createArtifactType(LOCAL_STATE_ARTIFACT_NAME, NbBundle.getMessage(
this.getClass(),
"Chrome.getLocalState.displayName"));
329 }
catch (TskCoreException ex) {
330 logger.log(Level.SEVERE, String.format(
"Error creating artifact type for LocalState."), ex);
331 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getfavicon.errMsg.errCreateArtifact"));
335 Set<String> profileNames = jInfoCache.keySet();
336 for (String profileName : profileNames) {
337 JsonElement result = jInfoCache.get(profileName);
338 JsonObject profile = result.getAsJsonObject();
339 if (profile == null) {
342 JsonElement gaiaIdEl = profile.get(
"gaia_id");
344 if (gaiaIdEl != null) {
345 gaiaId = gaiaIdEl.getAsString();
350 JsonElement hostedDomainEl = profile.get(
"hosted_domain");
351 if (hostedDomainEl != null) {
352 hostedDomain = hostedDomainEl.getAsString();
357 JsonElement shortcutNameEl = profile.get(
"shortcut_name");
358 if (shortcutNameEl != null) {
359 shortcutName = shortcutNameEl.getAsString();
364 JsonElement nameEl = profile.get(
"name");
365 if (nameEl != null) {
366 name = nameEl.getAsString();
371 JsonElement userNameEl = profile.get(
"user_name");
372 if (userNameEl != null) {
373 userName = userNameEl.getAsString();
378 if (userName.contains(
"")) {
379 userProfiles.put(browserLocation +
"/" + profileName, name);
380 browserLocations.put(browserLocation +
"/" + profileName, browser);
382 userProfiles.put(browserLocation +
"/" + profileName, userName);
383 browserLocations.put(browserLocation +
"/" + profileName, browser);
386 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
387 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PATH,
388 RecentActivityExtracterModuleFactory.getModuleName(), profileName));
389 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USER_ID,
390 RecentActivityExtracterModuleFactory.getModuleName(), gaiaId));
391 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN,
392 RecentActivityExtracterModuleFactory.getModuleName(), hostedDomain));
393 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_SHORTCUT,
394 RecentActivityExtracterModuleFactory.getModuleName(), shortcutName));
395 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_NAME,
396 RecentActivityExtracterModuleFactory.getModuleName(), name));
397 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USER_NAME,
398 RecentActivityExtracterModuleFactory.getModuleName(), userName));
399 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME,
400 RecentActivityExtracterModuleFactory.getModuleName(), browserName));
403 bbartifacts.add(createArtifactWithAttributes(localStateArtifactType, localStateFile, bbattributes));
404 }
catch (TskCoreException ex) {
405 logger.log(Level.SEVERE, String.format(
"Failed to create bookmark artifact for file (%d)", localStateFile.getId()), ex);
410 if (!context.dataSourceIngestIsCancelled()) {
411 postArtifacts(bbartifacts);
417 if (!userProfiles.containsKey(
"Default")) {
418 userProfiles.put(browserLocation +
"/" +
"Default",
"Default");
419 browserLocations.put(browserLocation +
"/" +
"Default", browser);
421 if (!userProfiles.containsKey(
"Guest Profile")) {
422 userProfiles.put(browserLocation +
"/" +
"Guest Profile",
"Guest");
423 browserLocations.put(browserLocation +
"/" +
"Guest Profile", browser);
425 if (!userProfiles.containsKey(
"System Profile")) {
426 userProfiles.put(browserLocation +
"/" +
"System Profile",
"System");
427 browserLocations.put(browserLocation +
"/" +
"System Profile", browser);
438 private void getExtensions(String browser, String browserLocation, String userName,
long ingestJobId) {
439 FileManager fileManager = currentCase.getServices().getFileManager();
440 String browserName = browser;
441 List<AbstractFile> extensionFiles;
442 String extensionsName = EXTENSIONS_FILE_NAME;
443 if (browserName.equals(UC_BROWSER_NAME)) {
444 extensionsName = EXTENSIONS_FILE_NAME +
"%";
448 extensionFiles = fileManager.findFiles(dataSource, extensionsName, browserLocation);
449 }
catch (TskCoreException ex) {
450 String msg = NbBundle.getMessage(this.getClass(),
"Chrome.getExtensions.errMsg.errGettingFiles");
451 logger.log(Level.SEVERE, msg, ex);
452 this.addErrorMessage(this.getDisplayName() +
": " + msg);
457 List<AbstractFile> allocatedExtensionsFiles =
new ArrayList<>();
458 for (AbstractFile extensionFile : extensionFiles) {
459 if (extensionFile.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.ALLOC)) {
460 allocatedExtensionsFiles.add(extensionFile);
465 if (allocatedExtensionsFiles.isEmpty()) {
466 String msg = NbBundle.getMessage(this.getClass(),
"Chrome.getExtensions.errMsg.couldntFindAnyFiles");
467 logger.log(Level.INFO, msg);
472 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
474 while (j < allocatedExtensionsFiles.size()) {
475 if (browser.contains(GOOGLE_PROFILE_NAME)) {
476 String parentPath = FilenameUtils.normalizeNoEndSeparator(allocatedExtensionsFiles.get(j).getParentPath());
477 browserName = GOOGLE_PROFILE +
" " + FilenameUtils.getBaseName(parentPath);
479 String temps = RAImageIngestModule.getRATempPath(currentCase, browserName, ingestJobId) + File.separator + allocatedExtensionsFiles.get(j).getName() + j;
480 final AbstractFile extensionFile = allocatedExtensionsFiles.get(j++);
481 if ((extensionFile.getSize() == 0) || (extensionFile.getName().toLowerCase().contains(
"-slack"))
482 || (extensionFile.getName().toLowerCase().contains(
"cache")) || (extensionFile.getName().toLowerCase().contains(
"media"))
483 || (extensionFile.getName().toLowerCase().contains(
"index"))) {
487 ContentUtils.writeToFile(extensionFile,
new File(temps), context::dataSourceIngestIsCancelled);
488 }
catch (ReadContentInputStreamException ex) {
489 logger.log(Level.WARNING, String.format(
"Error reading Chrome web extension artifacts file '%s' (id=%d).",
490 extensionFile.getName(), extensionFile.getId()), ex);
491 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getExtensions.errMsg.errAnalyzingFile",
492 this.getDisplayName(), extensionFile.getName()));
494 }
catch (IOException ex) {
495 logger.log(Level.SEVERE, String.format(
"Error writing temp file '%s' for Chrome Extensions artifacts file '%s' (id=%d).",
496 temps, extensionFile.getName(), extensionFile.getId()), ex);
497 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getExtensions.errMsg.errAnalyzingFile",
498 this.getDisplayName(), extensionFile.getName()));
502 if (context.dataSourceIngestIsCancelled()) {
506 FileReader tempReader;
508 tempReader =
new FileReader(temps);
509 }
catch (FileNotFoundException ex) {
510 logger.log(Level.WARNING,
"Error while trying to read into the Secure Preferences file.", ex);
514 BlackboardArtifact.Type localStateArtifactType;
517 localStateArtifactType = createArtifactType(EXTENSIONS_ARTIFACT_NAME, NbBundle.getMessage(
this.getClass(),
"Chrome.getExtensions.displayName"));
518 }
catch (TskCoreException ex) {
519 logger.log(Level.SEVERE, String.format(
"Error creating artifact type for Secure Preferences."), ex);
520 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getExtensions.errMsg.errCreateArtifact"));
524 String profileName = FilenameUtils.getBaseName(StringUtils.chop(extensionFile.getParentPath()));
526 JsonElement jsonElement;
527 JsonObject jElement, jExtensions, jSettings;
530 jsonElement = JsonParser.parseReader(tempReader);
531 jElement = jsonElement.getAsJsonObject();
532 if (jElement.has(
"extensions")) {
533 logger.log(Level.WARNING, String.format(
"Processing Secure Preferences from %s", extensionFile.getParentPath()));
534 jExtensions = jElement.get(
"extensions").getAsJsonObject();
535 if (!browserName.equals(OPERA_BROWSER_NAME)) {
536 jSettings = jExtensions.get(
"settings").getAsJsonObject();
538 jSettings = jExtensions.get(
"opsettings").getAsJsonObject();
543 }
catch (JsonIOException | JsonSyntaxException | IllegalStateException ex) {
544 logger.log(Level.WARNING,
"Error parsing Json from Secure Preferences.", ex);
545 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getExtensoins.errMsg.errAnalyzingFile",
546 this.getDisplayName(), extensionFile.getName()));
550 Set<String> extensions = jSettings.keySet();
551 for (String extension : extensions) {
552 JsonElement result = jSettings.get(extension);
553 JsonObject ext = result.getAsJsonObject();
557 JsonElement flagEl = ext.get(
"state");
559 if (flagEl != null) {
560 if (flagEl.getAsInt() == 1) {
568 String apiGrantedPermissions =
"";
569 if (ext.has(
"active_permissions")) {
570 JsonObject permissions = ext.get(
"active_permissions").getAsJsonObject();
571 JsonArray apiPermissions = permissions.get(
"api").getAsJsonArray();
572 for (JsonElement apiPermission : apiPermissions) {
573 if (apiPermission.isJsonPrimitive()) {
574 String apigrantEl = apiPermission.getAsString();
575 if (apigrantEl != null) {
576 apiGrantedPermissions = apiGrantedPermissions +
", " + apigrantEl;
578 apiGrantedPermissions = apiGrantedPermissions +
"";
586 if (ext.has(
"manifest")) {
587 JsonObject manifest = ext.get(
"manifest").getAsJsonObject();
588 JsonElement descriptionEl = manifest.get(
"description");
589 if (descriptionEl != null) {
590 description = descriptionEl.getAsString();
594 JsonElement versionEl = manifest.get(
"version");
595 if (versionEl != null) {
596 version = versionEl.getAsString();
600 JsonElement extNameEl = manifest.get(
"name");
601 if (extNameEl != null) {
602 extName = extNameEl.getAsString();
611 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
612 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_ID,
613 RecentActivityExtracterModuleFactory.getModuleName(), extension));
614 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_NAME,
615 RecentActivityExtracterModuleFactory.getModuleName(), extName));
616 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DESCRIPTION,
617 RecentActivityExtracterModuleFactory.getModuleName(), description));
618 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_VERSION,
619 RecentActivityExtracterModuleFactory.getModuleName(), version));
620 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_FLAG,
621 RecentActivityExtracterModuleFactory.getModuleName(), flag));
622 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PERMISSIONS,
623 RecentActivityExtracterModuleFactory.getModuleName(), apiGrantedPermissions.replaceFirst(
", ",
"")));
624 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USER_NAME,
625 RecentActivityExtracterModuleFactory.getModuleName(), userName));
626 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME,
627 RecentActivityExtracterModuleFactory.getModuleName(), browserName));
630 bbartifacts.add(createArtifactWithAttributes(localStateArtifactType, extensionFile, bbattributes));
631 }
catch (TskCoreException ex) {
632 logger.log(Level.SEVERE, String.format(
"Failed to create Extension artifact for file (%d)", extensionFile.getId()), ex);
637 if (!context.dataSourceIngestIsCancelled()) {
638 postArtifacts(bbartifacts);
652 private void getHistory(String browser, String browserLocation, String userName,
long ingestJobId) {
653 FileManager fileManager = currentCase.getServices().getFileManager();
654 String browserName = browser;
655 List<AbstractFile> historyFiles;
656 String historyFileName = HISTORY_FILE_NAME;
657 if (browserName.equals(UC_BROWSER_NAME)) {
658 historyFileName = HISTORY_FILE_NAME +
"%";
661 historyFiles = fileManager.findFiles(dataSource, historyFileName, browserLocation);
662 }
catch (TskCoreException ex) {
663 String msg = NbBundle.getMessage(this.getClass(),
"Chrome.getHistory.errMsg.errGettingFiles");
664 logger.log(Level.SEVERE, msg, ex);
665 this.addErrorMessage(this.getDisplayName() +
": " + msg);
670 List<AbstractFile> allocatedHistoryFiles =
new ArrayList<>();
671 for (AbstractFile historyFile : historyFiles) {
672 if (historyFile.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.ALLOC)) {
673 allocatedHistoryFiles.add(historyFile);
678 if (allocatedHistoryFiles.isEmpty()) {
679 String msg = NbBundle.getMessage(this.getClass(),
"Chrome.getHistory.errMsg.couldntFindAnyFiles");
680 logger.log(Level.INFO, msg);
685 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
687 while (j < allocatedHistoryFiles.size()) {
688 if (browser.contains(GOOGLE_PROFILE_NAME)) {
689 String parentPath = FilenameUtils.normalizeNoEndSeparator(allocatedHistoryFiles.get(j).getParentPath());
690 browserName = GOOGLE_PROFILE +
" " + FilenameUtils.getBaseName(parentPath);
692 String temps = RAImageIngestModule.getRATempPath(currentCase, browserName, ingestJobId) + File.separator + allocatedHistoryFiles.get(j).getName() + j +
".db";
693 final AbstractFile historyFile = allocatedHistoryFiles.get(j++);
694 if ((historyFile.getSize() == 0) || (historyFile.getName().toLowerCase().contains(
"-slack"))
695 || (historyFile.getName().toLowerCase().contains(
"cache")) || (historyFile.getName().toLowerCase().contains(
"media"))
696 || (historyFile.getName().toLowerCase().contains(
"index"))) {
700 ContentUtils.writeToFile(historyFile,
new File(temps), context::dataSourceIngestIsCancelled);
701 }
catch (ReadContentInputStreamException ex) {
702 logger.log(Level.WARNING, String.format(
"Error reading Chrome web history artifacts file '%s' (id=%d).",
703 historyFile.getName(), historyFile.getId()), ex);
704 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getHistory.errMsg.errAnalyzingFile",
705 this.getDisplayName(), historyFile.getName()));
707 }
catch (IOException ex) {
708 logger.log(Level.SEVERE, String.format(
"Error writing temp sqlite db file '%s' for Chrome web history artifacts file '%s' (id=%d).",
709 temps, historyFile.getName(), historyFile.getId()), ex);
710 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getHistory.errMsg.errAnalyzingFile",
711 this.getDisplayName(), historyFile.getName()));
714 File dbFile =
new File(temps);
715 if (context.dataSourceIngestIsCancelled()) {
719 List<HashMap<String, Object>> tempList;
720 tempList = this.querySQLiteDb(temps, HISTORY_QUERY);
721 logger.log(Level.INFO,
"{0}- Now getting history from {1} with {2} artifacts identified.",
new Object[]{getDisplayName(), temps, tempList.size()});
722 for (HashMap<String, Object> result : tempList) {
723 String url = result.get(
"url") == null ?
"" : result.get(
"url").toString();
724 String extractedDomain = NetworkUtils.extractDomain(url);
727 Collection<BlackboardAttribute> bbattributes = createHistoryAttributes(
728 StringUtils.defaultString(url),
729 (Long.valueOf(result.get(
"last_visit_time").toString()) / 1000000) - Long.valueOf(
"11644473600"),
730 result.get(
"from_visit") == null ?
"" : result.get(
"from_visit").toString(),
731 result.get(
"title") == null ?
"" : result.get(
"title").toString(),
736 bbartifacts.add(createArtifactWithAttributes(BlackboardArtifact.Type.TSK_WEB_HISTORY, historyFile, bbattributes));
737 }
catch (TskCoreException ex) {
738 logger.log(Level.SEVERE, String.format(
"Failed to create history artifact for file (%d)", historyFile.getId()), ex);
744 if (!bbartifacts.isEmpty() && !context.dataSourceIngestIsCancelled()) {
745 postArtifacts(bbartifacts);
756 private void getBookmark(String browser, String browserLocation, String userName,
long ingestJobId) {
757 FileManager fileManager = currentCase.getServices().getFileManager();
758 List<AbstractFile> bookmarkFiles;
759 String browserName = browser;
760 String bookmarkFileName = BOOKMARK_FILE_NAME;
761 if (browserName.equals(UC_BROWSER_NAME)) {
762 bookmarkFileName = BOOKMARK_FILE_NAME +
"%";
765 bookmarkFiles = fileManager.findFiles(dataSource, bookmarkFileName, browserLocation);
766 }
catch (TskCoreException ex) {
767 String msg = NbBundle.getMessage(this.getClass(),
"Chrome.getBookmark.errMsg.errGettingFiles");
768 logger.log(Level.SEVERE, msg, ex);
769 this.addErrorMessage(this.getDisplayName() +
": " + msg);
773 if (bookmarkFiles.isEmpty()) {
774 logger.log(Level.INFO,
"Didn't find any Chrome bookmark files.");
779 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
781 while (j < bookmarkFiles.size()) {
782 if (browser.contains(GOOGLE_PROFILE_NAME)) {
783 String parentPath = FilenameUtils.normalizeNoEndSeparator(bookmarkFiles.get(j).getParentPath());
784 browserName = GOOGLE_PROFILE +
" " + FilenameUtils.getBaseName(parentPath);
787 AbstractFile bookmarkFile = bookmarkFiles.get(j++);
788 if ((bookmarkFile.getSize() == 0) || (bookmarkFile.getName().toLowerCase().contains(
"-slack"))
789 || (bookmarkFile.getName().toLowerCase().contains(
"extras")) || (bookmarkFile.getName().toLowerCase().contains(
"log"))
790 || (bookmarkFile.getName().toLowerCase().contains(
"backup")) || (bookmarkFile.getName().toLowerCase().contains(
"visualized"))
791 || (bookmarkFile.getName().toLowerCase().contains(
"bak")) || (bookmarkFile.getParentPath().toLowerCase().contains(
"backup"))) {
794 String temps = RAImageIngestModule.getRATempPath(currentCase, browserName, ingestJobId) + File.separator + bookmarkFile.getName() + j +
".db";
796 ContentUtils.writeToFile(bookmarkFile,
new File(temps), context::dataSourceIngestIsCancelled);
797 }
catch (ReadContentInputStreamException ex) {
798 logger.log(Level.WARNING, String.format(
"Error reading Chrome bookmark artifacts file '%s' (id=%d).",
799 bookmarkFile.getName(), bookmarkFile.getId()), ex);
800 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getBookmark.errMsg.errAnalyzingFile",
801 this.getDisplayName(), bookmarkFile.getName()));
803 }
catch (IOException ex) {
804 logger.log(Level.SEVERE, String.format(
"Error writing temp sqlite db file '%s' for Chrome bookmark artifacts file '%s' (id=%d).",
805 temps, bookmarkFile.getName(), bookmarkFile.getId()), ex);
806 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getBookmark.errMsg.errAnalyzingFile",
807 this.getDisplayName(), bookmarkFile.getName()));
811 logger.log(Level.INFO,
"{0}- Now getting Bookmarks from {1}",
new Object[]{getDisplayName(), temps});
812 File dbFile =
new File(temps);
813 if (context.dataSourceIngestIsCancelled()) {
818 FileReader tempReader;
820 tempReader =
new FileReader(temps);
821 }
catch (FileNotFoundException ex) {
822 logger.log(Level.WARNING,
"Error while trying to read into the Bookmarks for Chrome.", ex);
826 JsonElement jsonElement;
827 JsonObject jElement, jRoot;
830 jsonElement = JsonParser.parseReader(tempReader);
831 jElement = jsonElement.getAsJsonObject();
832 jRoot = jElement.get(
"roots").getAsJsonObject();
833 Set<String> bookmarkKeys = jRoot.keySet();
834 }
catch (JsonIOException | JsonSyntaxException | IllegalStateException ex) {
835 logger.log(Level.WARNING,
"Error parsing Json from Chrome Bookmark.", ex);
836 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getBookmark.errMsg.errAnalyzingFile3",
837 this.getDisplayName(), bookmarkFile.getName()));
841 Set<String> bookmarkKeys = jRoot.keySet();
842 for (String bookmarkKey : bookmarkKeys) {
843 JsonObject jBookmark = jRoot.get(bookmarkKey).getAsJsonObject();
844 JsonArray jBookmarkArray = jBookmark.getAsJsonArray(
"children");
845 for (JsonElement result : jBookmarkArray) {
846 JsonObject address = result.getAsJsonObject();
847 if (address == null) {
850 JsonElement urlEl = address.get(
"url");
853 url = urlEl.getAsString();
858 JsonElement nameEl = address.get(
"name");
859 if (nameEl != null) {
860 name = nameEl.getAsString();
865 JsonElement dateEl = address.get(
"date_added");
866 if (dateEl != null) {
867 date = dateEl.getAsLong();
869 date = Long.valueOf(0);
871 String domain = NetworkUtils.extractDomain(url);
872 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
874 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_URL,
875 RecentActivityExtracterModuleFactory.getModuleName(), url));
876 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_TITLE,
877 RecentActivityExtracterModuleFactory.getModuleName(), name));
878 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_CREATED,
879 RecentActivityExtracterModuleFactory.getModuleName(), (date / 1000000) - Long.valueOf(
"11644473600")));
880 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME,
881 RecentActivityExtracterModuleFactory.getModuleName(), browserName));
882 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN,
883 RecentActivityExtracterModuleFactory.getModuleName(), domain));
884 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USER_NAME,
885 RecentActivityExtracterModuleFactory.getModuleName(), userName));
886 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_COMMENT,
887 RecentActivityExtracterModuleFactory.getModuleName(), bookmarkKey));
891 bbartifacts.add(createArtifactWithAttributes(BlackboardArtifact.Type.TSK_WEB_BOOKMARK, bookmarkFile, bbattributes));
892 }
catch (TskCoreException ex) {
893 logger.log(Level.SEVERE, String.format(
"Failed to create bookmark artifact for file (%d)", bookmarkFile.getId()), ex);
899 if (!context.dataSourceIngestIsCancelled()) {
900 postArtifacts(bbartifacts);
914 private void getCookie(String browser, String browserLocation, String userName,
long ingestJobId) {
916 FileManager fileManager = currentCase.getServices().getFileManager();
917 List<AbstractFile> cookiesFiles;
918 String browserName = browser;
919 String cookieFileName = COOKIE_FILE_NAME;
920 if (browserName.equals(UC_BROWSER_NAME)) {
923 cookieFileName =
"%" + COOKIE_FILE_NAME +
"%";
926 cookiesFiles = fileManager.findFiles(dataSource, cookieFileName, browserLocation);
927 }
catch (TskCoreException ex) {
928 String msg = NbBundle.getMessage(this.getClass(),
"Chrome.getCookie.errMsg.errGettingFiles");
929 logger.log(Level.SEVERE, msg, ex);
930 this.addErrorMessage(this.getDisplayName() +
": " + msg);
934 if (cookiesFiles.isEmpty()) {
935 logger.log(Level.INFO,
"Didn't find any Chrome cookies files.");
940 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
942 while (j < cookiesFiles.size()) {
943 if (browser.contains(GOOGLE_PROFILE_NAME)) {
944 String parentPath = FilenameUtils.normalizeNoEndSeparator(cookiesFiles.get(j).getParentPath());
945 browserName = GOOGLE_PROFILE + FilenameUtils.getBaseName(parentPath);
948 AbstractFile cookiesFile = cookiesFiles.get(j++);
949 if ((cookiesFile.getSize() == 0) || (cookiesFile.getName().toLowerCase().contains(
"-slack"))) {
952 String temps = RAImageIngestModule.getRATempPath(currentCase, browserName, ingestJobId) + File.separator + cookiesFile.getName() + j +
".db";
954 ContentUtils.writeToFile(cookiesFile,
new File(temps), context::dataSourceIngestIsCancelled);
955 }
catch (ReadContentInputStreamException ex) {
956 logger.log(Level.WARNING, String.format(
"Error reading Chrome cookie artifacts file '%s' (id=%d).",
957 cookiesFile.getName(), cookiesFile.getId()), ex);
958 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getCookie.errMsg.errAnalyzeFile",
959 this.getDisplayName(), cookiesFile.getName()));
961 }
catch (IOException ex) {
962 logger.log(Level.SEVERE, String.format(
"Error writing temp sqlite db file '%s' for Chrome cookie artifacts file '%s' (id=%d).",
963 temps, cookiesFile.getName(), cookiesFile.getId()), ex);
964 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getCookie.errMsg.errAnalyzeFile",
965 this.getDisplayName(), cookiesFile.getName()));
968 File dbFile =
new File(temps);
969 if (context.dataSourceIngestIsCancelled()) {
974 List<HashMap<String, Object>> tempList = this.querySQLiteDb(temps, COOKIE_QUERY);
975 logger.log(Level.INFO,
"{0}- Now getting cookies from {1} with {2} artifacts identified.",
new Object[]{getDisplayName(), temps, tempList.size()});
976 for (HashMap<String, Object> result : tempList) {
977 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
978 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_URL,
979 RecentActivityExtracterModuleFactory.getModuleName(),
980 ((result.get(
"host_key").toString() != null) ? result.get(
"host_key").toString() :
"")));
981 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED,
982 RecentActivityExtracterModuleFactory.getModuleName(),
983 (Long.valueOf(result.get(
"last_access_utc").toString()) / 1000000) - Long.valueOf(
"11644473600")));
985 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_NAME,
986 RecentActivityExtracterModuleFactory.getModuleName(),
987 ((result.get(
"name").toString() != null) ? result.get(
"name").toString() :
"")));
988 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_VALUE,
989 RecentActivityExtracterModuleFactory.getModuleName(),
990 ((result.get(
"value").toString() != null) ? result.get(
"value").toString() :
"")));
991 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME,
992 RecentActivityExtracterModuleFactory.getModuleName(), browserName));
993 String domain = result.get(
"host_key").toString();
994 domain = domain.replaceFirst(
"^\\.+(?!$)",
"");
995 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN,
996 RecentActivityExtracterModuleFactory.getModuleName(), domain));
997 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USER_NAME,
998 RecentActivityExtracterModuleFactory.getModuleName(), userName));
1001 bbartifacts.add(createArtifactWithAttributes(BlackboardArtifact.Type.TSK_WEB_COOKIE, cookiesFile, bbattributes));
1002 }
catch (TskCoreException ex) {
1003 logger.log(Level.SEVERE, String.format(
"Failed to create cookie artifact for file (%d)", cookiesFile.getId()), ex);
1010 if (!bbartifacts.isEmpty() && !context.dataSourceIngestIsCancelled()) {
1011 postArtifacts(bbartifacts);
1022 private void getDownload(String browser, String browserLocation, String userName,
long ingestJobId) {
1023 FileManager fileManager = currentCase.getServices().getFileManager();
1024 List<AbstractFile> downloadFiles;
1025 String browserName = browser;
1026 String historyFileName = HISTORY_FILE_NAME;
1027 if (browserName.equals(UC_BROWSER_NAME)) {
1028 historyFileName = HISTORY_FILE_NAME +
"%";
1031 downloadFiles = fileManager.findFiles(dataSource, historyFileName, browserLocation);
1032 }
catch (TskCoreException ex) {
1033 String msg = NbBundle.getMessage(this.getClass(),
"Chrome.getDownload.errMsg.errGettingFiles");
1034 logger.log(Level.SEVERE, msg, ex);
1035 this.addErrorMessage(this.getDisplayName() +
": " + msg);
1039 if (downloadFiles.isEmpty()) {
1040 logger.log(Level.INFO,
"Didn't find any Chrome download files.");
1045 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
1047 while (j < downloadFiles.size()) {
1048 if (browser.contains(GOOGLE_PROFILE_NAME)) {
1049 String parentPath = FilenameUtils.normalizeNoEndSeparator(downloadFiles.get(j).getParentPath());
1050 browserName = GOOGLE_PROFILE + FilenameUtils.getBaseName(parentPath);
1053 AbstractFile downloadFile = downloadFiles.get(j++);
1054 if ((downloadFile.getSize() == 0) || (downloadFile.getName().toLowerCase().contains(
"-slack"))
1055 || (downloadFile.getName().toLowerCase().contains(
"cache")) || (downloadFile.getName().toLowerCase().contains(
"index"))) {
1059 String temps = RAImageIngestModule.getRATempPath(currentCase, browserName, ingestJobId) + File.separator + downloadFile.getName() + j +
".db";
1061 ContentUtils.writeToFile(downloadFile,
new File(temps), context::dataSourceIngestIsCancelled);
1062 }
catch (ReadContentInputStreamException ex) {
1063 logger.log(Level.WARNING, String.format(
"Error reading Chrome download artifacts file '%s' (id=%d).",
1064 downloadFile.getName(), downloadFile.getId()), ex);
1065 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getDownload.errMsg.errAnalyzeFiles1",
1066 this.getDisplayName(), downloadFile.getName()));
1068 }
catch (IOException ex) {
1069 logger.log(Level.SEVERE, String.format(
"Error writing temp sqlite db file '%s' for Chrome download artifacts file '%s' (id=%d).",
1070 temps, downloadFile.getName(), downloadFile.getId()), ex);
1071 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getDownload.errMsg.errAnalyzeFiles1",
1072 this.getDisplayName(), downloadFile.getName()));
1075 File dbFile =
new File(temps);
1076 if (context.dataSourceIngestIsCancelled()) {
1081 List<HashMap<String, Object>> tempList;
1083 if (isChromePreVersion30(temps)) {
1084 tempList = this.querySQLiteDb(temps, DOWNLOAD_QUERY);
1086 tempList = this.querySQLiteDb(temps, DOWNLOAD_QUERY_V30);
1089 logger.log(Level.INFO,
"{0}- Now getting downloads from {1} with {2} artifacts identified.",
new Object[]{getDisplayName(), temps, tempList.size()});
1090 for (HashMap<String, Object> result : tempList) {
1091 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
1092 String fullPath = result.get(
"full_path").toString();
1093 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PATH,
1094 RecentActivityExtracterModuleFactory.getModuleName(), fullPath));
1095 long pathID = Util.findID(dataSource, fullPath);
1097 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PATH_ID,
1098 NbBundle.getMessage(
this.getClass(),
1099 "Chrome.parentModuleName"), pathID));
1101 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_URL,
1102 RecentActivityExtracterModuleFactory.getModuleName(),
1103 ((result.get(
"url").toString() != null) ? result.get(
"url").toString() :
"")));
1105 Long time = (Long.valueOf(result.get(
"start_time").toString()) / 1000000) - Long.valueOf(
"11644473600");
1109 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED,
1110 RecentActivityExtracterModuleFactory.getModuleName(), time));
1111 String domain = NetworkUtils.extractDomain((result.get(
"url").toString() != null) ? result.get(
"url").toString() :
"");
1112 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN,
1113 RecentActivityExtracterModuleFactory.getModuleName(), domain));
1114 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USER_NAME,
1115 RecentActivityExtracterModuleFactory.getModuleName(), userName));
1116 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME,
1117 RecentActivityExtracterModuleFactory.getModuleName(), browserName));
1121 BlackboardArtifact webDownloadArtifact = createArtifactWithAttributes(BlackboardArtifact.Type.TSK_WEB_DOWNLOAD, downloadFile, bbattributes);
1122 bbartifacts.add(webDownloadArtifact);
1123 String normalizedFullPath = FilenameUtils.normalize(fullPath,
true);
1124 for (AbstractFile downloadedFile : currentCase.getSleuthkitCase().getFileManager().findFilesExactNameExactPath(dataSource, FilenameUtils.getName(normalizedFullPath), FilenameUtils.getPath(normalizedFullPath))) {
1125 bbartifacts.add(createAssociatedArtifact(downloadedFile, webDownloadArtifact));
1128 }
catch (TskCoreException ex) {
1129 logger.log(Level.SEVERE, String.format(
"Error creating associated object artifact for file '%s'", fullPath), ex);
1136 if (!bbartifacts.isEmpty() && !context.dataSourceIngestIsCancelled()) {
1137 postArtifacts(bbartifacts);
1148 private void getFavicons(String browser, String browserLocation, String userName,
long ingestJobId) {
1149 FileManager fileManager = currentCase.getServices().getFileManager();
1150 List<AbstractFile> faviconFiles;
1151 String browserName = browser;
1153 faviconFiles = fileManager.findFiles(dataSource, FAVICON_DATA_FILE_NAME, browserLocation);
1154 }
catch (TskCoreException ex) {
1155 String msg = NbBundle.getMessage(this.getClass(),
"Chrome.getFavicon.errMsg.errGettingFiles");
1156 logger.log(Level.SEVERE, msg, ex);
1157 this.addErrorMessage(this.getDisplayName() +
": " + msg);
1161 if (faviconFiles.isEmpty()) {
1162 logger.log(Level.INFO,
"Didn't find any Chrome favicon files.");
1167 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
1169 while (j < faviconFiles.size()) {
1170 if (browser.contains(GOOGLE_PROFILE_NAME)) {
1171 String parentPath = FilenameUtils.normalizeNoEndSeparator(faviconFiles.get(j).getParentPath());
1172 browserName = GOOGLE_PROFILE + FilenameUtils.getBaseName(parentPath);
1174 AbstractFile faviconFile = faviconFiles.get(j++);
1175 if ((faviconFile.getSize() == 0) || (faviconFile.getName().toLowerCase().contains(
"-slack"))
1176 || (faviconFile.getName().toLowerCase().contains(
"cache")) || (faviconFile.getName().toLowerCase().contains(
"index"))) {
1180 String temps = RAImageIngestModule.getRATempPath(currentCase, browserName, ingestJobId) + File.separator + faviconFile.getName() + j +
".db";
1182 ContentUtils.writeToFile(faviconFile,
new File(temps), context::dataSourceIngestIsCancelled);
1183 }
catch (ReadContentInputStreamException ex) {
1184 logger.log(Level.WARNING, String.format(
"Error reading Chrome favicons artifacts file '%s' (id=%d).",
1185 faviconFile.getName(), faviconFile.getId()), ex);
1186 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getFavicon.errMsg.errAnalyzeFiles1",
1187 this.getDisplayName(), faviconFile.getName()));
1189 }
catch (IOException ex) {
1190 logger.log(Level.SEVERE, String.format(
"Error writing temp sqlite db file '%s' for Chrome favicon artifacts file '%s' (id=%d).",
1191 temps, faviconFile.getName(), faviconFile.getId()), ex);
1192 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getfavicon.errMsg.errAnalyzeFiles1",
1193 this.getDisplayName(), faviconFile.getName()));
1196 File dbFile =
new File(temps);
1197 if (context.dataSourceIngestIsCancelled()) {
1202 BlackboardArtifact.Type faviconArtifactType;
1205 faviconArtifactType = createArtifactType(FAVICON_ARTIFACT_NAME, NbBundle.getMessage(
this.getClass(),
"Chrome.getFavicon.displayName"));
1206 }
catch (TskCoreException ex) {
1207 logger.log(Level.SEVERE, String.format(
"Error creating artifact type for Chrome favicon."), ex);
1208 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getfavicon.errMsg.errCreateArtifact"));
1213 List<HashMap<String, Object>> tempList;
1215 tempList = this.querySQLiteDb(temps, FAVICON_QUERY);
1217 logger.log(Level.INFO,
"{0}- Now getting favicons from {1} with {2} artifacts identified.",
new Object[]{getDisplayName(), temps, tempList.size()});
1218 for (HashMap<String, Object> result : tempList) {
1219 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
1220 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_URL,
1221 RecentActivityExtracterModuleFactory.getModuleName(),
1222 ((result.get(
"page_url").toString() != null) ? result.get(
"page_url").toString() :
"")));
1223 Long updatedTime = (Long.valueOf(result.get(
"last_updated").toString()) / 1000000) - Long.valueOf(
"11644473600");
1224 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_MODIFIED,
1225 RecentActivityExtracterModuleFactory.getModuleName(), updatedTime));
1226 Long requestedTime = (Long.valueOf(result.get(
"last_requested").toString()) / 1000000) - Long.valueOf(
"11644473600");
1227 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED,
1228 RecentActivityExtracterModuleFactory.getModuleName(), requestedTime));
1229 String domain = NetworkUtils.extractDomain((result.get(
"page_url").toString() != null) ? result.get(
"page_url").toString() :
"");
1230 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN,
1231 RecentActivityExtracterModuleFactory.getModuleName(), domain));
1232 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USER_NAME,
1233 RecentActivityExtracterModuleFactory.getModuleName(), userName));
1234 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME,
1235 RecentActivityExtracterModuleFactory.getModuleName(), browserName));
1238 bbartifacts.add(createArtifactWithAttributes(faviconArtifactType, faviconFile, bbattributes));
1239 }
catch (TskCoreException ex) {
1240 logger.log(Level.SEVERE, String.format(
"Failed to create cookie artifact for file (%d)", faviconFile.getId()), ex);
1248 if (!bbartifacts.isEmpty() && !context.dataSourceIngestIsCancelled()) {
1249 postArtifacts(bbartifacts);
1260 private void getLogins(String browser, String browserLocation, String userName,
long ingestJobId) {
1262 FileManager fileManager = currentCase.getServices().getFileManager();
1263 List<AbstractFile> loginDataFiles;
1264 String browserName = browser;
1265 String loginDataFileName = LOGIN_DATA_FILE_NAME;
1266 if (browserName.equals(UC_BROWSER_NAME)) {
1267 loginDataFileName = LOGIN_DATA_FILE_NAME +
"%";
1271 loginDataFiles = fileManager.findFiles(dataSource, loginDataFileName, browserLocation);
1272 }
catch (TskCoreException ex) {
1273 String msg = NbBundle.getMessage(this.getClass(),
"Chrome.getLogin.errMsg.errGettingFiles");
1274 logger.log(Level.SEVERE, msg, ex);
1275 this.addErrorMessage(this.getDisplayName() +
": " + msg);
1279 if (loginDataFiles.isEmpty()) {
1280 logger.log(Level.INFO,
"Didn't find any Chrome Login Data files.");
1285 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
1287 while (j < loginDataFiles.size()) {
1288 if (browser.contains(GOOGLE_PROFILE_NAME)) {
1289 String parentPath = FilenameUtils.normalizeNoEndSeparator(loginDataFiles.get(j).getParentPath());
1290 browserName = GOOGLE_PROFILE + FilenameUtils.getBaseName(parentPath);
1292 AbstractFile loginDataFile = loginDataFiles.get(j++);
1293 if ((loginDataFile.getSize() == 0) || (loginDataFile.getName().toLowerCase().contains(
"-slack"))) {
1296 String temps = RAImageIngestModule.getRATempPath(currentCase, browserName, ingestJobId) + File.separator + loginDataFile.getName() + j +
".db";
1298 ContentUtils.writeToFile(loginDataFile,
new File(temps), context::dataSourceIngestIsCancelled);
1299 }
catch (ReadContentInputStreamException ex) {
1300 logger.log(Level.WARNING, String.format(
"Error reading Chrome login artifacts file '%s' (id=%d).",
1301 loginDataFile.getName(), loginDataFile.getId()), ex);
1302 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getLogin.errMsg.errAnalyzingFiles",
1303 this.getDisplayName(), loginDataFile.getName()));
1305 }
catch (IOException ex) {
1306 logger.log(Level.SEVERE, String.format(
"Error writing temp sqlite db file '%s' for Chrome login artifacts file '%s' (id=%d).",
1307 temps, loginDataFile.getName(), loginDataFile.getId()), ex);
1308 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getLogin.errMsg.errAnalyzingFiles",
1309 this.getDisplayName(), loginDataFile.getName()));
1312 File dbFile =
new File(temps);
1313 if (context.dataSourceIngestIsCancelled()) {
1317 List<HashMap<String, Object>> tempList = this.querySQLiteDb(temps, LOGIN_QUERY);
1318 logger.log(Level.INFO,
"{0}- Now getting login information from {1} with {2} artifacts identified.",
new Object[]{getDisplayName(), temps, tempList.size()});
1319 for (HashMap<String, Object> result : tempList) {
1320 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
1322 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_URL,
1323 RecentActivityExtracterModuleFactory.getModuleName(),
1324 ((result.get(
"origin_url").toString() != null) ? result.get(
"origin_url").toString() :
"")));
1326 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_CREATED,
1327 RecentActivityExtracterModuleFactory.getModuleName(),
1328 (Long.valueOf(result.get(
"date_created").toString()) / 1000000) - Long.valueOf(
"11644473600")));
1330 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_URL_DECODED,
1331 RecentActivityExtracterModuleFactory.getModuleName(),
1332 (NetworkUtils.extractDomain((result.get(
"origin_url").toString() != null) ? result.get(
"origin_url").toString() :
""))));
1334 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USER_NAME,
1335 RecentActivityExtracterModuleFactory.getModuleName(),
1336 ((result.get(
"username_value").toString() != null) ? result.get(
"username_value").toString().replaceAll(
"'",
"''") :
"")));
1338 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_REALM,
1339 RecentActivityExtracterModuleFactory.getModuleName(),
1340 ((result.get(
"signon_realm") != null && result.get(
"signon_realm").toString() != null) ? result.get(
"signon_realm").toString() :
"")));
1342 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN,
1343 RecentActivityExtracterModuleFactory.getModuleName(),
1344 result.containsKey(
"signon_realm") ? NetworkUtils.extractDomain(result.get(
"signon_realm").toString()) :
""));
1346 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME,
1347 RecentActivityExtracterModuleFactory.getModuleName(), browserName));
1349 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USER_NAME,
1350 RecentActivityExtracterModuleFactory.getModuleName(), userName));
1353 bbartifacts.add(createArtifactWithAttributes(BlackboardArtifact.Type.TSK_SERVICE_ACCOUNT, loginDataFile, bbattributes));
1354 }
catch (TskCoreException ex) {
1355 logger.log(Level.SEVERE, String.format(
"Failed to create service account artifact for file (%d)", loginDataFile.getId()), ex);
1362 if (!bbartifacts.isEmpty() && !context.dataSourceIngestIsCancelled()) {
1363 postArtifacts(bbartifacts);
1375 private void getAutofill(String browser, String browserLocation, String userName,
long ingestJobId) {
1377 FileManager fileManager = currentCase.getServices().getFileManager();
1378 List<AbstractFile> webDataFiles;
1379 String browserName = browser;
1380 String webDataFileName = WEB_DATA_FILE_NAME;
1381 if (browserName.equals(UC_BROWSER_NAME)) {
1382 webDataFileName = WEB_DATA_FILE_NAME +
"%";
1386 webDataFiles = fileManager.findFiles(dataSource, webDataFileName, browserLocation);
1387 }
catch (TskCoreException ex) {
1388 String msg = NbBundle.getMessage(this.getClass(),
"Chrome.getAutofills.errMsg.errGettingFiles");
1389 logger.log(Level.SEVERE, msg, ex);
1390 this.addErrorMessage(this.getDisplayName() +
": " + msg);
1394 if (webDataFiles.isEmpty()) {
1395 logger.log(Level.INFO,
"Didn't find any Chrome Web Data files.");
1400 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
1402 while (j < webDataFiles.size()) {
1403 if (browser.contains(GOOGLE_PROFILE_NAME)) {
1404 String parentPath = FilenameUtils.normalizeNoEndSeparator(webDataFiles.get(j).getParentPath());
1405 browserName = GOOGLE_PROFILE + FilenameUtils.getBaseName(parentPath);
1407 databaseEncrypted =
false;
1408 AbstractFile webDataFile = webDataFiles.get(j++);
1409 if ((webDataFile.getSize() == 0) || (webDataFile.getName().toLowerCase().contains(
"-slack"))) {
1412 String tempFilePath = RAImageIngestModule.getRATempPath(currentCase, browserName, ingestJobId) + File.separator + webDataFile.getName() + j +
".db";
1414 ContentUtils.writeToFile(webDataFile,
new File(tempFilePath), context::dataSourceIngestIsCancelled);
1415 }
catch (ReadContentInputStreamException ex) {
1416 logger.log(Level.WARNING, String.format(
"Error reading Chrome Autofill artifacts file '%s' (id=%d).",
1417 webDataFile.getName(), webDataFile.getId()), ex);
1418 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getAutofill.errMsg.errAnalyzingFiles",
1419 this.getDisplayName(), webDataFile.getName()));
1421 }
catch (IOException ex) {
1422 logger.log(Level.SEVERE, String.format(
"Error writing temp sqlite db file '%s' for Chrome Web data file '%s' (id=%d).",
1423 tempFilePath, webDataFile.getName(), webDataFile.getId()), ex);
1424 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Chrome.getLogin.errMsg.errAnalyzingFiles",
1425 this.getDisplayName(), webDataFile.getName()));
1428 File dbFile =
new File(tempFilePath);
1429 if (context.dataSourceIngestIsCancelled()) {
1435 boolean isSchemaV8X = Util.checkColumn(
"date_created",
"autofill", tempFilePath);
1438 bbartifacts.addAll(getFormAutofillArtifacts(webDataFile, tempFilePath, isSchemaV8X, userName, browserName));
1441 getFormAddressArtifacts(webDataFile, tempFilePath, isSchemaV8X);
1442 if (databaseEncrypted) {
1443 String comment = String.format(
"%s Autofill Database Encryption Detected", browserName);
1444 Collection<BlackboardAttribute> bbattributes = Arrays.asList(
1445 new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_COMMENT,
1446 RecentActivityExtracterModuleFactory.getModuleName(), comment));
1449 webDataFile.newAnalysisResult(
1450 BlackboardArtifact.Type.TSK_ENCRYPTION_DETECTED, Score.SCORE_NOTABLE,
1451 null, null, comment, bbattributes).getAnalysisResult());
1453 }
catch (NoCurrentCaseException | TskCoreException | Blackboard.BlackboardException ex) {
1454 logger.log(Level.SEVERE, String.format(
"Error adding artifacts to the case database " 1455 +
"for chrome file %s [objId=%d]", webDataFile.getName(), webDataFile.getId()), ex);
1461 if (!bbartifacts.isEmpty() && !context.dataSourceIngestIsCancelled()) {
1462 postArtifacts(bbartifacts);
1476 private Collection<BlackboardArtifact> getFormAutofillArtifacts(AbstractFile webDataFile, String dbFilePath,
boolean isSchemaV8X, String userName, String browser) {
1478 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
1481 String autoFillquery = (isSchemaV8X) ? AUTOFILL_QUERY_V8X
1484 List<HashMap<String, Object>> autofills = this.querySQLiteDb(dbFilePath, autoFillquery);
1485 logger.log(Level.INFO,
"{0}- Now getting Autofill information from {1} with {2} artifacts identified.",
new Object[]{getDisplayName(), dbFilePath, autofills.size()});
1486 for (HashMap<String, Object> result : autofills) {
1487 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
1490 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_NAME,
1491 NbBundle.getMessage(
this.getClass(),
"Chrome.parentModuleName"),
1492 ((result.get(
"name").toString() != null) ? result.get(
"name").toString() :
"")));
1494 fieldEncrypted =
false;
1495 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_VALUE,
1496 RecentActivityExtracterModuleFactory.getModuleName(),
1497 processFields(result.get(
"value"))));
1499 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_COUNT,
1500 RecentActivityExtracterModuleFactory.getModuleName(),
1501 (Integer.valueOf(result.get(
"count").toString()))));
1503 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_CREATED,
1504 RecentActivityExtracterModuleFactory.getModuleName(),
1505 Long.valueOf(result.get(
"date_created").toString())));
1509 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED,
1510 RecentActivityExtracterModuleFactory.getModuleName(),
1511 Long.valueOf(result.get(
"date_last_used").toString())));
1514 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USER_NAME,
1515 RecentActivityExtracterModuleFactory.getModuleName(), userName));
1516 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME,
1517 RecentActivityExtracterModuleFactory.getModuleName(), browser));
1518 if (fieldEncrypted) {
1519 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_COMMENT,
1520 RecentActivityExtracterModuleFactory.getModuleName(), ENCRYPTED_FIELD_MESSAGE));
1525 bbartifacts.add(createArtifactWithAttributes(BlackboardArtifact.Type.TSK_WEB_FORM_AUTOFILL, webDataFile, bbattributes));
1526 }
catch (TskCoreException ex) {
1527 logger.log(Level.SEVERE, String.format(
"Failed to create web form autopfill artifact for file (%d)", webDataFile.getId()), ex);
1546 private void getFormAddressArtifacts(AbstractFile webDataFile, String dbFilePath,
boolean isSchemaV8X)
throws NoCurrentCaseException,
1547 TskCoreException, Blackboard.BlackboardException {
1549 String webformAddressQuery = (isSchemaV8X) ? WEBFORM_ADDRESS_QUERY_V8X
1550 : WEBFORM_ADDRESS_QUERY;
1553 WebBrowserArtifactsHelper helper =
new WebBrowserArtifactsHelper(
1554 Case.getCurrentCaseThrows().getSleuthkitCase(),
1555 NbBundle.getMessage(this.getClass(),
"Chrome.parentModuleName"),
1556 webDataFile, context.getJobId()
1560 List<HashMap<String, Object>> addresses = this.querySQLiteDb(dbFilePath, webformAddressQuery);
1561 logger.log(Level.INFO,
"{0}- Now getting Web form addresses from {1} with {2} artifacts identified.",
new Object[]{getDisplayName(), dbFilePath, addresses.size()});
1562 for (HashMap<String, Object> result : addresses) {
1564 fieldEncrypted =
false;
1566 String first_name = processFields(result.get(
"first_name"));
1567 String middle_name = processFields(result.get(
"middle_name"));
1568 String last_name = processFields(result.get(
"last_name"));
1571 String email_Addr = processFields(result.get(
"email"));
1572 String phone_number = processFields(result.get(
"number"));
1575 String city = processFields(result.get(
"city"));
1576 String state = processFields(result.get(
"state"));
1577 String zipcode = processFields(result.get(
"zipcode"));
1578 String country_code = processFields(result.get(
"country_code"));
1581 String full_name =
"";
1582 String street_address =
"";
1583 long date_modified = 0;
1589 full_name = processFields(result.get(
"full_name"));
1590 street_address = processFields(result.get(
"street_address"));
1591 date_modified = result.get(
"date_modified").toString() != null ? Long.valueOf(result.get(
"date_modified").toString()) : 0;
1592 use_count = result.get(
"use_count").toString() != null ? Integer.valueOf(result.get(
"use_count").toString()) : 0;
1593 use_date = result.get(
"use_date").toString() != null ? Long.valueOf(result.get(
"use_date").toString()) : 0;
1595 String address_line_1 = processFields(result.get(
"address_line_1"));
1596 String address_line_2 = processFields(result.get(
"address_line_2"));
1597 street_address = String.join(
" ", address_line_1, address_line_2);
1601 if (full_name == null || full_name.isEmpty()) {
1602 full_name = String.join(
" ", first_name, middle_name, last_name);
1605 String locationAddress = String.join(
", ", street_address, city, state, zipcode, country_code);
1607 List<BlackboardAttribute> otherAttributes =
new ArrayList<>();
1608 if (date_modified > 0) {
1609 otherAttributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_MODIFIED,
1610 RecentActivityExtracterModuleFactory.getModuleName(),
1612 if (fieldEncrypted) {
1613 otherAttributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_COMMENT,
1614 RecentActivityExtracterModuleFactory.getModuleName(), ENCRYPTED_FIELD_MESSAGE));
1619 helper.addWebFormAddress(
1620 full_name, email_Addr, phone_number,
1621 locationAddress, 0, use_date,
1622 use_count, otherAttributes);
1635 private String processFields(Object dataValue) {
1637 if (dataValue instanceof byte[]) {
1638 fieldEncrypted =
true;
1639 databaseEncrypted =
true;
1642 return dataValue.toString() != null ? dataValue.toString() :
"";
1646 private boolean isChromePreVersion30(String temps) {
1647 String query =
"PRAGMA table_info(downloads)";
1648 List<HashMap<String, Object>> columns = this.querySQLiteDb(temps, query);
1649 for (HashMap<String, Object> col : columns) {
1650 if (col.get(
"name").equals(
"url")) {
1659 "ExtractFavicon_Display_Name=Favicon" 1667 private BlackboardArtifact.Type createArtifactType(String artifactName, String displayName)
throws TskCoreException {
1668 BlackboardArtifact.Type faviconArtifactType;
1670 faviconArtifactType = tskCase.getBlackboard().getOrAddArtifactType(artifactName, displayName);
1671 }
catch (Blackboard.BlackboardException ex) {
1672 throw new TskCoreException(String.format(
"An exception was thrown while defining artifact type %s", artifactName), ex);
1674 return faviconArtifactType;