23 package org.sleuthkit.autopsy.recentactivity;
26 import java.io.IOException;
27 import java.io.UnsupportedEncodingException;
28 import java.net.URLDecoder;
29 import java.util.ArrayList;
30 import java.util.Collection;
31 import java.util.HashMap;
32 import java.util.List;
33 import java.util.logging.Level;
35 import org.openide.util.NbBundle;
44 import org.
sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
46 import org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
48 import org.
sleuthkit.datamodel.ReadContentInputStream.ReadContentInputStreamException;
54 class Firefox
extends Extract {
56 private static final Logger logger = Logger.getLogger(Firefox.class.getName());
57 private static final String HISTORY_QUERY =
"SELECT moz_historyvisits.id,url,title,visit_count,(visit_date/1000000) AS visit_date,from_visit,(SELECT url FROM moz_places WHERE id=moz_historyvisits.from_visit) as ref FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id AND hidden = 0";
58 private static final String COOKIE_QUERY =
"SELECT name,value,host,expiry,(lastAccessed/1000000) AS lastAccessed,(creationTime/1000000) AS creationTime FROM moz_cookies";
59 private static final String COOKIE_QUERY_V3 =
"SELECT name,value,host,expiry,(lastAccessed/1000000) AS lastAccessed FROM moz_cookies";
60 private static final String BOOKMARK_QUERY =
"SELECT fk, moz_bookmarks.title, url, (moz_bookmarks.dateAdded/1000000) AS dateAdded FROM moz_bookmarks INNER JOIN moz_places ON moz_bookmarks.fk=moz_places.id";
61 private static final String DOWNLOAD_QUERY =
"SELECT target, source,(startTime/1000000) AS startTime, maxBytes FROM moz_downloads";
62 private static final String DOWNLOAD_QUERY_V24 =
"SELECT url, content AS target, (lastModified/1000000) AS lastModified FROM moz_places, moz_annos WHERE moz_places.id = moz_annos.place_id AND moz_annos.anno_attribute_id = 3";
63 private final IngestServices services = IngestServices.getInstance();
64 private Content dataSource;
65 private IngestJobContext context;
68 moduleName = NbBundle.getMessage(Firefox.class,
"Firefox.moduleName");
72 public void process(Content dataSource, IngestJobContext context) {
73 this.dataSource = dataSource;
74 this.context = context;
82 private void getHistory() {
83 FileManager fileManager = currentCase.getServices().getFileManager();
84 List<AbstractFile> historyFiles;
86 historyFiles = fileManager.findFiles(dataSource,
"places.sqlite",
"Firefox");
87 }
catch (TskCoreException ex) {
88 String msg = NbBundle.getMessage(this.getClass(),
"Firefox.getHistory.errMsg.errFetchingFiles");
89 logger.log(Level.WARNING, msg);
90 this.addErrorMessage(this.getName() +
": " + msg);
94 if (historyFiles.isEmpty()) {
95 String msg = NbBundle.getMessage(this.getClass(),
"Firefox.getHistory.errMsg.noFilesFound");
96 logger.log(Level.INFO, msg);
101 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
103 for (AbstractFile historyFile : historyFiles) {
104 if (historyFile.getSize() == 0) {
108 String fileName = historyFile.getName();
109 String temps = RAImageIngestModule.getRATempPath(currentCase,
"firefox") + File.separator + fileName + j +
".db";
111 ContentUtils.writeToFile(historyFile,
new File(temps), context::dataSourceIngestIsCancelled);
112 }
catch (ReadContentInputStreamException ex) {
113 logger.log(Level.WARNING, String.format(
"Error reading Firefox web history artifacts file '%s' (id=%d).",
114 fileName, historyFile.getId()), ex);
115 this.addErrorMessage(
116 NbBundle.getMessage(
this.getClass(),
"Firefox.getHistory.errMsg.errAnalyzeFile", this.getName(),
119 }
catch (IOException ex) {
120 logger.log(Level.SEVERE, String.format(
"Error writing temp sqlite db file '%s' for Firefox web history artifacts file '%s' (id=%d).",
121 temps, fileName, historyFile.getId()), ex);
122 this.addErrorMessage(
123 NbBundle.getMessage(
this.getClass(),
"Firefox.getHistory.errMsg.errAnalyzeFile", this.getName(),
127 File dbFile =
new File(temps);
128 if (context.dataSourceIngestIsCancelled()) {
132 List<HashMap<String, Object>> tempList = this.dbConnect(temps, HISTORY_QUERY);
133 logger.log(Level.INFO,
"{0} - Now getting history from {1} with {2} artifacts identified.",
new Object[]{moduleName, temps, tempList.size()});
134 for (HashMap<String, Object> result : tempList) {
135 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
136 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_URL,
137 NbBundle.getMessage(
this.getClass(),
138 "Firefox.parentModuleName.noSpace"),
139 ((result.get(
"url").toString() != null) ? result.get(
"url").toString() :
"")));
141 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED,
142 NbBundle.getMessage(
this.getClass(),
143 "Firefox.parentModuleName.noSpace"),
144 (Long.valueOf(result.get(
"visit_date").toString()))));
145 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_REFERRER,
146 NbBundle.getMessage(
this.getClass(),
147 "Firefox.parentModuleName.noSpace"),
148 ((result.get(
"ref").toString() != null) ? result.get(
"ref").toString() :
"")));
149 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_TITLE,
150 NbBundle.getMessage(
this.getClass(),
151 "Firefox.parentModuleName.noSpace"),
152 ((result.get(
"title").toString() != null) ? result.get(
"title").toString() :
"")));
153 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME,
154 NbBundle.getMessage(
this.getClass(),
155 "Firefox.parentModuleName.noSpace"),
156 NbBundle.getMessage(
this.getClass(),
"Firefox.moduleName")));
157 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN,
158 NbBundle.getMessage(
this.getClass(),
159 "Firefox.parentModuleName.noSpace"), (Util.extractDomain((result.get(
"url").toString() != null) ? result.get(
"url").toString() :
""))));
161 BlackboardArtifact bbart = this.addArtifact(ARTIFACT_TYPE.TSK_WEB_HISTORY, historyFile, bbattributes);
163 bbartifacts.add(bbart);
170 services.fireModuleDataEvent(
new ModuleDataEvent(
171 NbBundle.getMessage(
this.getClass(),
"Firefox.parentModuleName"),
172 BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY, bbartifacts));
178 private void getBookmark() {
180 FileManager fileManager = currentCase.getServices().getFileManager();
181 List<AbstractFile> bookmarkFiles;
183 bookmarkFiles = fileManager.findFiles(dataSource,
"places.sqlite",
"Firefox");
184 }
catch (TskCoreException ex) {
185 String msg = NbBundle.getMessage(this.getClass(),
"Firefox.getBookmark.errMsg.errFetchFiles");
186 logger.log(Level.WARNING, msg);
187 this.addErrorMessage(this.getName() +
": " + msg);
191 if (bookmarkFiles.isEmpty()) {
192 logger.log(Level.INFO,
"Didn't find any firefox bookmark files.");
197 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
199 for (AbstractFile bookmarkFile : bookmarkFiles) {
200 if (bookmarkFile.getSize() == 0) {
203 String fileName = bookmarkFile.getName();
204 String temps = RAImageIngestModule.getRATempPath(currentCase,
"firefox") + File.separator + fileName + j +
".db";
206 ContentUtils.writeToFile(bookmarkFile,
new File(temps), context::dataSourceIngestIsCancelled);
207 }
catch (ReadContentInputStreamException ex) {
208 logger.log(Level.WARNING, String.format(
"Error reading Firefox bookmark artifacts file '%s' (id=%d).",
209 fileName, bookmarkFile.getId()), ex);
210 this.addErrorMessage(
211 NbBundle.getMessage(
this.getClass(),
"Firefox.getHistory.errMsg.errAnalyzeFile", this.getName(),
214 }
catch (IOException ex) {
215 logger.log(Level.SEVERE, String.format(
"Error writing temp sqlite db file '%s' for Firefox bookmark artifacts file '%s' (id=%d).",
216 temps, fileName, bookmarkFile.getId()), ex);
217 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Firefox.getBookmark.errMsg.errAnalyzeFile",
218 this.getName(), fileName));
221 File dbFile =
new File(temps);
222 if (context.dataSourceIngestIsCancelled()) {
226 List<HashMap<String, Object>> tempList = this.dbConnect(temps, BOOKMARK_QUERY);
227 logger.log(Level.INFO,
"{0} - Now getting bookmarks from {1} with {2} artifacts identified.",
new Object[]{moduleName, temps, tempList.size()});
228 for (HashMap<String, Object> result : tempList) {
230 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
231 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_URL,
232 NbBundle.getMessage(
this.getClass(),
233 "Firefox.parentModuleName.noSpace"),
234 ((result.get(
"url").toString() != null) ? result.get(
"url").toString() :
"")));
235 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_TITLE,
236 NbBundle.getMessage(
this.getClass(),
237 "Firefox.parentModuleName.noSpace"),
238 ((result.get(
"title").toString() != null) ? result.get(
"title").toString() :
"")));
239 if (Long.valueOf(result.get(
"dateAdded").toString()) > 0) {
240 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_CREATED,
241 NbBundle.getMessage(
this.getClass(),
242 "Firefox.parentModuleName.noSpace"),
243 (Long.valueOf(result.get(
"dateAdded").toString()))));
245 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME,
246 NbBundle.getMessage(
this.getClass(),
247 "Firefox.parentModuleName.noSpace"),
248 NbBundle.getMessage(
this.getClass(),
"Firefox.moduleName")));
249 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN,
250 NbBundle.getMessage(
this.getClass(),
251 "Firefox.parentModuleName.noSpace"),
252 (Util.extractDomain((result.get(
"url").toString() != null) ? result.get(
"url").toString() :
""))));
254 BlackboardArtifact bbart = this.addArtifact(ARTIFACT_TYPE.TSK_WEB_BOOKMARK, bookmarkFile, bbattributes);
256 bbartifacts.add(bbart);
263 services.fireModuleDataEvent(
new ModuleDataEvent(
264 NbBundle.getMessage(
this.getClass(),
"Firefox.parentModuleName"),
265 BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK, bbartifacts));
271 private void getCookie() {
272 FileManager fileManager = currentCase.getServices().getFileManager();
273 List<AbstractFile> cookiesFiles;
275 cookiesFiles = fileManager.findFiles(dataSource,
"cookies.sqlite",
"Firefox");
276 }
catch (TskCoreException ex) {
277 String msg = NbBundle.getMessage(this.getClass(),
"Firefox.getCookie.errMsg.errFetchFile");
278 logger.log(Level.WARNING, msg);
279 this.addErrorMessage(this.getName() +
": " + msg);
283 if (cookiesFiles.isEmpty()) {
284 logger.log(Level.INFO,
"Didn't find any Firefox cookie files.");
289 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
291 for (AbstractFile cookiesFile : cookiesFiles) {
292 if (cookiesFile.getSize() == 0) {
295 String fileName = cookiesFile.getName();
296 String temps = RAImageIngestModule.getRATempPath(currentCase,
"firefox") + File.separator + fileName + j +
".db";
298 ContentUtils.writeToFile(cookiesFile,
new File(temps), context::dataSourceIngestIsCancelled);
299 }
catch (ReadContentInputStreamException ex) {
300 logger.log(Level.WARNING, String.format(
"Error reading Firefox cookie artifacts file '%s' (id=%d).",
301 fileName, cookiesFile.getId()), ex);
302 this.addErrorMessage(
303 NbBundle.getMessage(
this.getClass(),
"Firefox.getHistory.errMsg.errAnalyzeFile", this.getName(),
306 }
catch (IOException ex) {
307 logger.log(Level.SEVERE, String.format(
"Error writing temp sqlite db file '%s' for Firefox cookie artifacts file '%s' (id=%d).",
308 temps, fileName, cookiesFile.getId()), ex);
309 this.addErrorMessage(
310 NbBundle.getMessage(
this.getClass(),
"Firefox.getCookie.errMsg.errAnalyzeFile", this.getName(),
314 File dbFile =
new File(temps);
315 if (context.dataSourceIngestIsCancelled()) {
319 boolean checkColumn = Util.checkColumn(
"creationTime",
"moz_cookies", temps);
322 query = COOKIE_QUERY;
324 query = COOKIE_QUERY_V3;
327 List<HashMap<String, Object>> tempList = this.dbConnect(temps, query);
328 logger.log(Level.INFO,
"{0} - Now getting cookies from {1} with {2} artifacts identified.",
new Object[]{moduleName, temps, tempList.size()});
329 for (HashMap<String, Object> result : tempList) {
331 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
332 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_URL,
333 NbBundle.getMessage(
this.getClass(),
334 "Firefox.parentModuleName.noSpace"),
335 ((result.get(
"host").toString() != null) ? result.get(
"host").toString() :
"")));
336 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME,
337 NbBundle.getMessage(
this.getClass(),
338 "Firefox.parentModuleName.noSpace"),
339 (Long.valueOf(result.get(
"lastAccessed").toString()))));
340 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_NAME,
341 NbBundle.getMessage(
this.getClass(),
342 "Firefox.parentModuleName.noSpace"),
343 ((result.get(
"name").toString() != null) ? result.get(
"name").toString() :
"")));
344 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_VALUE,
345 NbBundle.getMessage(
this.getClass(),
346 "Firefox.parentModuleName.noSpace"),
347 ((result.get(
"value").toString() != null) ? result.get(
"value").toString() :
"")));
348 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME,
349 NbBundle.getMessage(
this.getClass(),
350 "Firefox.parentModuleName.noSpace"),
351 NbBundle.getMessage(
this.getClass(),
"Firefox.moduleName")));
353 if (checkColumn ==
true) {
354 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_CREATED,
355 NbBundle.getMessage(
this.getClass(),
356 "Firefox.parentModuleName.noSpace"),
357 (Long.valueOf(result.get(
"creationTime").toString()))));
359 String domain = Util.extractDomain(result.get(
"host").toString());
360 domain = domain.replaceFirst(
"^\\.+(?!$)",
"");
361 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN,
362 NbBundle.getMessage(
this.getClass(),
363 "Firefox.parentModuleName.noSpace"), domain));
365 BlackboardArtifact bbart = this.addArtifact(ARTIFACT_TYPE.TSK_WEB_COOKIE, cookiesFile, bbattributes);
367 bbartifacts.add(bbart);
374 services.fireModuleDataEvent(
new ModuleDataEvent(
375 NbBundle.getMessage(
this.getClass(),
"Firefox.parentModuleName"),
376 BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE, bbartifacts));
382 private void getDownload() {
383 getDownloadPreVersion24();
384 getDownloadVersion24();
392 private void getDownloadPreVersion24() {
394 FileManager fileManager = currentCase.getServices().getFileManager();
395 List<AbstractFile> downloadsFiles;
397 downloadsFiles = fileManager.findFiles(dataSource,
"downloads.sqlite",
"Firefox");
398 }
catch (TskCoreException ex) {
399 String msg = NbBundle.getMessage(this.getClass(),
"Firefox.getDlPre24.errMsg.errFetchFiles");
400 logger.log(Level.WARNING, msg);
401 this.addErrorMessage(this.getName() +
": " + msg);
405 if (downloadsFiles.isEmpty()) {
406 logger.log(Level.INFO,
"Didn't find any pre-version-24.0 Firefox download files.");
411 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
413 for (AbstractFile downloadsFile : downloadsFiles) {
414 if (downloadsFile.getSize() == 0) {
417 String fileName = downloadsFile.getName();
418 String temps = RAImageIngestModule.getRATempPath(currentCase,
"firefox") + File.separator + fileName + j +
".db";
421 ContentUtils.writeToFile(downloadsFile,
new File(temps), context::dataSourceIngestIsCancelled);
422 }
catch (ReadContentInputStreamException ex) {
423 logger.log(Level.WARNING, String.format(
"Error reading Firefox download artifacts file '%s' (id=%d).",
424 fileName, downloadsFile.getId()), ex);
425 this.addErrorMessage(
426 NbBundle.getMessage(
this.getClass(),
"Firefox.getHistory.errMsg.errAnalyzeFile", this.getName(),
429 }
catch (IOException ex) {
430 logger.log(Level.SEVERE, String.format(
"Error writing temp sqlite db file '%s' for Firefox download artifacts file '%s' (id=%d).",
431 temps, fileName, downloadsFile.getId()), ex);
432 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Firefox.getDlPre24.errMsg.errAnalyzeFiles",
433 this.getName(), fileName));
436 File dbFile =
new File(temps);
437 if (context.dataSourceIngestIsCancelled()) {
442 List<HashMap<String, Object>> tempList = this.dbConnect(temps, DOWNLOAD_QUERY);
443 logger.log(Level.INFO,
"{0}- Now getting downloads from {1} with {2} artifacts identified.",
new Object[]{moduleName, temps, tempList.size()});
444 for (HashMap<String, Object> result : tempList) {
446 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
448 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_URL,
449 NbBundle.getMessage(
this.getClass(),
450 "Firefox.parentModuleName.noSpace"),
451 ((result.get(
"source").toString() != null) ? result.get(
"source").toString() :
"")));
453 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED,
454 NbBundle.getMessage(
this.getClass(),
455 "Firefox.parentModuleName.noSpace"),
456 (Long.valueOf(result.get(
"startTime").toString()))));
458 String target = result.get(
"target").toString();
460 if (target != null) {
462 String decodedTarget = URLDecoder.decode(target.replaceAll(
"file:///",
""),
"UTF-8");
463 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PATH,
464 NbBundle.getMessage(
this.getClass(),
465 "Firefox.parentModuleName.noSpace"),
467 long pathID = Util.findID(dataSource, decodedTarget);
469 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PATH_ID,
470 NbBundle.getMessage(
this.getClass(),
471 "Firefox.parentModuleName.noSpace"),
474 }
catch (UnsupportedEncodingException ex) {
475 logger.log(Level.SEVERE,
"Error decoding Firefox download URL in " + temps, ex);
480 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME,
481 NbBundle.getMessage(
this.getClass(),
482 "Firefox.parentModuleName.noSpace"),
483 NbBundle.getMessage(
this.getClass(),
"Firefox.moduleName")));
484 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN,
485 NbBundle.getMessage(
this.getClass(),
486 "Firefox.parentModuleName.noSpace"),
487 (Util.extractDomain((result.get(
"source").toString() != null) ? result.get(
"source").toString() :
""))));
489 BlackboardArtifact bbart = this.addArtifact(ARTIFACT_TYPE.TSK_WEB_DOWNLOAD, downloadsFile, bbattributes);
491 bbartifacts.add(bbart);
495 this.addErrorMessage(
496 NbBundle.getMessage(
this.getClass(),
"Firefox.getDlPre24.errMsg.errParsingArtifacts",
497 this.getName(), errors));
504 services.fireModuleDataEvent(
new ModuleDataEvent(
505 NbBundle.getMessage(
this.getClass(),
"Firefox.parentModuleName"),
506 BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD, bbartifacts));
514 private void getDownloadVersion24() {
515 FileManager fileManager = currentCase.getServices().getFileManager();
516 List<AbstractFile> downloadsFiles;
518 downloadsFiles = fileManager.findFiles(dataSource,
"places.sqlite",
"Firefox");
519 }
catch (TskCoreException ex) {
520 String msg = NbBundle.getMessage(this.getClass(),
"Firefox.getDlV24.errMsg.errFetchFiles");
521 logger.log(Level.WARNING, msg);
522 this.addErrorMessage(this.getName() +
": " + msg);
526 if (downloadsFiles.isEmpty()) {
527 logger.log(Level.INFO,
"Didn't find any version-24.0 Firefox download files.");
532 Collection<BlackboardArtifact> bbartifacts =
new ArrayList<>();
534 for (AbstractFile downloadsFile : downloadsFiles) {
535 if (downloadsFile.getSize() == 0) {
538 String fileName = downloadsFile.getName();
539 String temps = RAImageIngestModule.getRATempPath(currentCase,
"firefox") + File.separator + fileName +
"-downloads" + j +
".db";
542 ContentUtils.writeToFile(downloadsFile,
new File(temps), context::dataSourceIngestIsCancelled);
543 }
catch (ReadContentInputStreamException ex) {
544 logger.log(Level.WARNING, String.format(
"Error reading Firefox download artifacts file '%s' (id=%d).",
545 fileName, downloadsFile.getId()), ex);
546 this.addErrorMessage(
547 NbBundle.getMessage(
this.getClass(),
"Firefox.getHistory.errMsg.errAnalyzeFile", this.getName(),
550 }
catch (IOException ex) {
551 logger.log(Level.SEVERE, String.format(
"Error writing temp sqlite db file '%s' for Firefox download artifacts file '%s' (id=%d).",
552 temps, fileName, downloadsFile.getId()), ex);
553 this.addErrorMessage(
554 NbBundle.getMessage(
this.getClass(),
"Firefox.getDlV24.errMsg.errAnalyzeFile", this.getName(),
558 File dbFile =
new File(temps);
559 if (context.dataSourceIngestIsCancelled()) {
564 List<HashMap<String, Object>> tempList = this.dbConnect(temps, DOWNLOAD_QUERY_V24);
566 logger.log(Level.INFO,
"{0} - Now getting downloads from {1} with {2} artifacts identified.",
new Object[]{moduleName, temps, tempList.size()});
567 for (HashMap<String, Object> result : tempList) {
569 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
571 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_URL,
572 NbBundle.getMessage(
this.getClass(),
573 "Firefox.parentModuleName.noSpace"),
574 ((result.get(
"url").toString() != null) ? result.get(
"url").toString() :
"")));
579 String target = result.get(
"target").toString();
580 if (target != null) {
582 String decodedTarget = URLDecoder.decode(target.replaceAll(
"file:///",
""),
"UTF-8");
583 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PATH,
584 NbBundle.getMessage(
this.getClass(),
585 "Firefox.parentModuleName.noSpace"),
587 long pathID = Util.findID(dataSource, decodedTarget);
589 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PATH_ID,
590 NbBundle.getMessage(
this.getClass(),
591 "Firefox.parentModuleName.noSpace"),
594 }
catch (UnsupportedEncodingException ex) {
595 logger.log(Level.SEVERE,
"Error decoding Firefox download URL in " + temps, ex);
599 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED,
600 NbBundle.getMessage(
this.getClass(),
601 "Firefox.parentModuleName.noSpace"),
602 Long.valueOf(result.get(
"lastModified").toString())));
603 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME,
604 NbBundle.getMessage(
this.getClass(),
605 "Firefox.parentModuleName.noSpace"),
606 NbBundle.getMessage(
this.getClass(),
"Firefox.moduleName")));
607 bbattributes.add(
new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN,
608 NbBundle.getMessage(
this.getClass(),
609 "Firefox.parentModuleName.noSpace"),
610 (Util.extractDomain((result.get(
"url").toString() != null) ? result.get(
"url").toString() :
""))));
612 BlackboardArtifact bbart = this.addArtifact(ARTIFACT_TYPE.TSK_WEB_DOWNLOAD, downloadsFile, bbattributes);
614 bbartifacts.add(bbart);
618 this.addErrorMessage(NbBundle.getMessage(
this.getClass(),
"Firefox.getDlV24.errMsg.errParsingArtifacts",
619 this.getName(), errors));
626 services.fireModuleDataEvent(
new ModuleDataEvent(
627 NbBundle.getMessage(
this.getClass(),
"Firefox.parentModuleName"),
628 BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD, bbartifacts));