19 package org.sleuthkit.autopsy.report;
21 import java.awt.Dimension;
22 import java.awt.Toolkit;
23 import java.awt.event.ActionEvent;
24 import java.awt.event.ActionListener;
25 import java.awt.event.WindowAdapter;
26 import java.awt.event.WindowEvent;
28 import java.io.IOException;
29 import java.sql.ResultSet;
30 import java.sql.SQLException;
31 import java.text.DateFormat;
32 import java.text.SimpleDateFormat;
33 import java.util.ArrayList;
34 import java.util.Arrays;
35 import java.util.Collection;
36 import java.util.Collections;
37 import java.util.Comparator;
38 import java.util.Date;
39 import java.util.HashMap;
40 import java.util.HashSet;
41 import java.util.Iterator;
42 import java.util.List;
44 import java.util.Map.Entry;
45 import java.util.Objects;
47 import java.util.TreeSet;
48 import java.util.concurrent.ExecutionException;
49 import java.util.logging.Level;
50 import javax.swing.JDialog;
51 import javax.swing.JFrame;
52 import javax.swing.SwingWorker;
53 import org.openide.filesystems.FileUtil;
54 import org.openide.util.NbBundle;
65 import org.
sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
68 import org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
72 import org.
sleuthkit.datamodel.SleuthkitCase.CaseDbQuery;
83 class ReportGenerator {
85 private static final Logger logger = Logger.getLogger(ReportGenerator.class.getName());
87 private Case currentCase = Case.getCurrentCase();
88 private SleuthkitCase skCase = currentCase.getSleuthkitCase();
90 private Map<TableReportModule, ReportProgressPanel> tableProgress;
91 private Map<GeneralReportModule, ReportProgressPanel> generalProgress;
92 private Map<FileReportModule, ReportProgressPanel> fileProgress;
93 private Map<Integer, List<Column>> columnHeaderMap;
95 private String reportPath;
96 private ReportGenerationPanel panel =
new ReportGenerationPanel();
98 static final String REPORTS_DIR =
"Reports";
100 private List<String> errorList;
108 private void displayReportErrors() {
109 if (!errorList.isEmpty()) {
110 String errorString =
"";
111 for (String error : errorList) {
112 errorString += error +
"\n";
114 MessageNotifyUtil.Notify.error(
115 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.notifyErr.errsDuringRptGen"), errorString);
120 ReportGenerator(Map<TableReportModule, Boolean> tableModuleStates, Map<GeneralReportModule, Boolean> generalModuleStates, Map<FileReportModule, Boolean> fileListModuleStates) {
122 DateFormat dateFormat =
new SimpleDateFormat(
"MM-dd-yyyy-HH-mm-ss");
123 Date date =
new Date();
124 String dateNoTime = dateFormat.format(date);
125 this.reportPath = currentCase.getReportDirectory() + File.separator + currentCase.getName() +
" " + dateNoTime + File.separator;
127 this.errorList =
new ArrayList<String>();
131 FileUtil.createFolder(
new File(this.reportPath));
132 }
catch (IOException ex) {
133 errorList.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.failedMakeRptFolder"));
134 logger.log(Level.SEVERE,
"Failed to make report folder, may be unable to generate reports.", ex);
139 generalProgress =
new HashMap<>();
140 tableProgress =
new HashMap<>();
141 fileProgress =
new HashMap<>();
142 setupProgressPanels(tableModuleStates, generalModuleStates, fileListModuleStates);
143 this.columnHeaderMap =
new HashMap<>();
157 private void setupProgressPanels(Map<TableReportModule, Boolean> tableModuleStates, Map<GeneralReportModule, Boolean> generalModuleStates, Map<FileReportModule, Boolean> fileListModuleStates) {
158 if (null != tableModuleStates) {
159 for (Entry<TableReportModule, Boolean> entry : tableModuleStates.entrySet()) {
160 if (entry.getValue()) {
161 TableReportModule module = entry.getKey();
162 String reportFilePath = module.getRelativeFilePath();
163 if (!reportFilePath.isEmpty()) {
164 tableProgress.put(module, panel.addReport(module.getName(), reportPath + reportFilePath));
166 tableProgress.put(module, panel.addReport(module.getName(), null));
172 if (null != generalModuleStates) {
173 for (Entry<GeneralReportModule, Boolean> entry : generalModuleStates.entrySet()) {
174 if (entry.getValue()) {
175 GeneralReportModule module = entry.getKey();
176 String reportFilePath = module.getRelativeFilePath();
177 if (!reportFilePath.isEmpty()) {
178 generalProgress.put(module, panel.addReport(module.getName(), reportPath + reportFilePath));
180 generalProgress.put(module, panel.addReport(module.getName(), null));
186 if (null != fileListModuleStates) {
187 for (Entry<FileReportModule, Boolean> entry : fileListModuleStates.entrySet()) {
188 if (entry.getValue()) {
189 FileReportModule module = entry.getKey();
190 String reportFilePath = module.getRelativeFilePath();
191 if (!reportFilePath.isEmpty()) {
192 fileProgress.put(module, panel.addReport(module.getName(), reportPath + reportFilePath));
194 fileProgress.put(module, panel.addReport(module.getName(), null));
205 public void displayProgressPanels() {
206 final JDialog dialog =
new JDialog(
new JFrame(),
true);
207 dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
208 dialog.setTitle(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.displayProgress.title.text"));
209 dialog.add(this.panel);
212 panel.addCloseAction(
new ActionListener() {
214 public void actionPerformed(ActionEvent e) {
219 dialog.addWindowListener(
new WindowAdapter() {
221 public void windowClosing(WindowEvent e) {
226 Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
227 int w = dialog.getSize().width;
228 int h = dialog.getSize().height;
231 dialog.setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
232 dialog.setVisible(
true);
238 public void generateGeneralReports() {
239 GeneralReportsWorker worker =
new GeneralReportsWorker();
251 public void generateTableReports(Map<BlackboardArtifact.Type, Boolean> artifactTypeSelections, Map<String, Boolean> tagNameSelections) {
252 if (!tableProgress.isEmpty() && null != artifactTypeSelections) {
253 TableReportsWorker worker =
new TableReportsWorker(artifactTypeSelections, tagNameSelections);
264 public void generateFileListReports(Map<FileReportDataTypes, Boolean> enabledInfo) {
265 if (!fileProgress.isEmpty() && null != enabledInfo) {
266 List<FileReportDataTypes> enabled =
new ArrayList<>();
267 for (Entry<FileReportDataTypes, Boolean> e : enabledInfo.entrySet()) {
269 enabled.add(e.getKey());
272 FileReportsWorker worker =
new FileReportsWorker(enabled);
284 for (Entry<GeneralReportModule, ReportProgressPanel> entry : generalProgress.entrySet()) {
297 }
catch (InterruptedException | ExecutionException ex) {
299 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errors.reportErrorTitle"),
300 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errors.reportErrorText") + ex.getLocalizedMessage(),
302 logger.log(Level.SEVERE,
"failed to generate reports", ex);
304 catch (java.util.concurrent.CancellationException ex) {
306 displayReportErrors();
318 private List<FileReportDataTypes> enabledInfo = Arrays.asList(FileReportDataTypes.values());
322 enabledInfo = enabled;
323 for (Entry<FileReportModule, ReportProgressPanel> entry : fileProgress.entrySet()) {
324 fileModules.add(entry.getKey());
330 for (FileReportModule module : fileModules) {
335 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.progress.queryingDb.text"));
339 List<AbstractFile> files =
getFiles();
340 int numFiles = files.size();
341 for (FileReportModule module : fileModules) {
342 module.startReport(reportPath);
343 module.startTable(enabledInfo);
344 fileProgress.get(module).setIndeterminate(
false);
345 fileProgress.get(module).setMaximumProgress(numFiles);
350 for (AbstractFile file : files) {
352 if (fileModules.isEmpty()) {
356 Iterator<FileReportModule> iter = fileModules.iterator();
357 while (iter.hasNext()) {
358 FileReportModule module = iter.next();
363 module.addRow(file, enabledInfo);
367 if ((i % 100) == 0) {
369 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.progress.processingFile.text",
376 for (FileReportModule module : fileModules) {
391 List<AbstractFile> absFiles;
394 absFiles = skCase.findAllFilesWhere(
"meta_type != " + TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getValue());
396 }
catch (TskCoreException ex) {
398 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errors.reportErrorTitle"),
399 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errors.reportErrorText") + ex.getLocalizedMessage(),
401 logger.log(Level.SEVERE,
"failed to generate reports. Unable to get all files in the image.", ex);
402 return Collections.<AbstractFile>emptyList();
410 }
catch (InterruptedException | ExecutionException ex) {
412 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errors.reportErrorTitle"),
413 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errors.reportErrorText") + ex.getLocalizedMessage(),
415 logger.log(Level.SEVERE,
"failed to generate reports", ex);
417 catch (java.util.concurrent.CancellationException ex) {
419 displayReportErrors();
435 private List<Content>
images =
new ArrayList<>();
437 TableReportsWorker(Map<BlackboardArtifact.Type, Boolean> artifactTypeSelections, Map<String, Boolean> tagNameSelections) {
439 for (Entry<TableReportModule, ReportProgressPanel> entry : tableProgress.entrySet()) {
440 tableModules.add(entry.getKey());
444 for (Entry<BlackboardArtifact.Type, Boolean> entry : artifactTypeSelections.entrySet()) {
445 if (entry.getValue()) {
451 if (null != tagNameSelections) {
452 for (Entry<String, Boolean> entry : tagNameSelections.entrySet()) {
453 if (entry.getValue() ==
true) {
454 tagNamesFilter.add(entry.getKey());
463 for (TableReportModule module : tableModules) {
466 module.startReport(reportPath);
484 for (TableReportModule module : tableModules) {
497 StringBuilder comment =
new StringBuilder();
498 if (!tagNamesFilter.isEmpty()) {
499 comment.append(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artifactTable.taggedResults.text"));
500 comment.append(makeCommaSeparatedList(tagNamesFilter));
506 removeCancelledTableReportModules();
507 if (tableModules.isEmpty()) {
511 for (TableReportModule module : tableModules) {
512 tableProgress.get(module).updateStatusLabel(
513 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.progress.processing",
514 type.getDisplayName()));
518 if (type.getTypeID() == ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID()) {
519 writeKeywordHits(tableModules, comment.toString(),
tagNamesFilter);
521 }
else if (type.getTypeID() == ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID()) {
522 writeHashsetHits(tableModules, comment.toString(),
tagNamesFilter);
526 List<ArtifactData> artifactList = getFilteredArtifacts(type, tagNamesFilter);
528 if (artifactList.isEmpty()) {
536 Set<BlackboardAttribute.Type> attrTypeSet =
new TreeSet<>((Type o1, Type o2) -> o1.getDisplayName().compareTo(o2.getDisplayName()));
538 List<BlackboardAttribute> attributes = data.getAttributes();
539 for (BlackboardAttribute attribute : attributes) {
540 attrTypeSet.add(attribute.getAttributeType());
546 List<Column> columns = getArtifactTableColumns(type.getTypeID(), attrTypeSet);
547 if (columns.isEmpty()) {
550 ReportGenerator.this.columnHeaderMap.put(type.getTypeID(), columns);
555 Collections.sort(artifactList);
556 List<String> columnHeaderNames =
new ArrayList<>();
557 for (
Column currColumn : columns) {
558 columnHeaderNames.add(currColumn.getColumnHeader());
561 for (TableReportModule module : tableModules) {
562 module.startDataType(type.getDisplayName(), comment.toString());
563 module.startTable(columnHeaderNames);
567 for (TableReportModule module : tableModules) {
571 List<String> rowData = artifactData.getRow();
572 if (rowData.isEmpty()) {
576 module.addRow(rowData);
580 for (TableReportModule module : tableModules) {
581 tableProgress.get(module).increment();
583 module.endDataType();
591 @SuppressWarnings(
"deprecation")
594 removeCancelledTableReportModules();
595 if (tableModules.isEmpty()) {
600 List<ContentTag> tags;
603 }
catch (TskCoreException ex) {
604 errorList.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.failedGetContentTags"));
605 logger.log(Level.SEVERE,
"failed to get content tags", ex);
610 for (TableReportModule module : tableModules) {
613 tableProgress.get(module).updateStatusLabel(
614 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.progress.processing",
615 ARTIFACT_TYPE.TSK_TAG_FILE.getDisplayName()));
616 ArrayList<String> columnHeaders =
new ArrayList<>(Arrays.asList(
617 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.htmlOutput.header.tag"),
618 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.htmlOutput.header.file"),
619 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.htmlOutput.header.comment"),
620 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.htmlOutput.header.timeModified"),
621 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.htmlOutput.header.timeChanged"),
622 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.htmlOutput.header.timeAccessed"),
623 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.htmlOutput.header.timeCreated"),
624 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.htmlOutput.header.size"),
625 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.htmlOutput.header.hash")));
627 StringBuilder comment =
new StringBuilder();
628 if (!tagNamesFilter.isEmpty()) {
630 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.makeContTagTab.taggedFiles.msg"));
631 comment.append(makeCommaSeparatedList(tagNamesFilter));
633 if (module instanceof ReportHTML) {
634 ReportHTML htmlReportModule = (ReportHTML) module;
635 htmlReportModule.startDataType(ARTIFACT_TYPE.TSK_TAG_FILE.getDisplayName(), comment.toString());
636 htmlReportModule.startContentTagsTable(columnHeaders);
638 module.startDataType(ARTIFACT_TYPE.TSK_TAG_FILE.getDisplayName(), comment.toString());
639 module.startTable(columnHeaders);
644 for (ContentTag tag : tags) {
652 fileName = tag.getContent().getUniquePath();
653 }
catch (TskCoreException ex) {
654 fileName = tag.getContent().getName();
657 ArrayList<String> rowData =
new ArrayList<>(Arrays.asList(tag.getName().getDisplayName(), fileName, tag.getComment()));
658 Content content = tag.getContent();
659 if (content instanceof AbstractFile) {
660 AbstractFile file = (AbstractFile) content;
663 rowData.add(file.getMtimeAsDate());
664 rowData.add(file.getCtimeAsDate());
665 rowData.add(file.getAtimeAsDate());
666 rowData.add(file.getCrtimeAsDate());
667 rowData.add(Long.toString(file.getSize()));
668 rowData.add(file.getMd5Hash());
670 for (TableReportModule module : tableModules) {
672 if (module instanceof ReportHTML) {
673 ReportHTML htmlReportModule = (ReportHTML) module;
674 htmlReportModule.addRowWithTaggedContentHyperlink(rowData, tag);
676 module.addRow(rowData);
685 for (TableReportModule module : tableModules) {
686 tableProgress.get(module).increment();
688 module.endDataType();
696 }
catch (InterruptedException | ExecutionException ex) {
698 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errors.reportErrorTitle"),
699 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errors.reportErrorText") + ex.getLocalizedMessage(),
701 logger.log(Level.SEVERE,
"failed to generate reports", ex.getCause());
702 logger.log(Level.SEVERE,
"failed to generate reports", ex);
704 catch (java.util.concurrent.CancellationException ex) {
706 displayReportErrors();
714 @SuppressWarnings(
"deprecation")
717 removeCancelledTableReportModules();
718 if (tableModules.isEmpty()) {
722 List<BlackboardArtifactTag> tags;
725 }
catch (TskCoreException ex) {
726 errorList.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.failedGetBBArtifactTags"));
727 logger.log(Level.SEVERE,
"failed to get blackboard artifact tags", ex);
733 for (TableReportModule module : tableModules) {
734 tableProgress.get(module).updateStatusLabel(
735 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.progress.processing",
736 ARTIFACT_TYPE.TSK_TAG_ARTIFACT.getDisplayName()));
737 StringBuilder comment =
new StringBuilder();
738 if (!tagNamesFilter.isEmpty()) {
740 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.makeBbArtTagTab.taggedRes.msg"));
741 comment.append(makeCommaSeparatedList(tagNamesFilter));
743 module.startDataType(ARTIFACT_TYPE.TSK_TAG_ARTIFACT.getDisplayName(), comment.toString());
744 module.startTable(
new ArrayList<>(Arrays.asList(
745 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.tagTable.header.resultType"),
746 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.tagTable.header.tag"),
747 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.tagTable.header.comment"),
748 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.tagTable.header.srcFile"))));
752 for (BlackboardArtifactTag tag : tags) {
758 for (TableReportModule module : tableModules) {
759 row =
new ArrayList<>(Arrays.asList(tag.getArtifact().getArtifactTypeName(), tag.getName().getDisplayName(), tag.getComment(), tag.getContent().getName()));
768 for (TableReportModule module : tableModules) {
769 tableProgress.get(module).increment();
771 module.endDataType();
783 return tagNamesFilter.isEmpty() || tagNamesFilter.contains(tagName);
786 void removeCancelledTableReportModules() {
787 Iterator<TableReportModule> iter = tableModules.iterator();
788 while (iter.hasNext()) {
789 TableReportModule module = iter.next();
800 for (TableReportModule module : tableModules) {
801 tableProgress.get(module).updateStatusLabel(
802 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.progress.createdThumb.text"));
804 if (module instanceof ReportHTML) {
805 ReportHTML htmlModule = (ReportHTML) module;
806 htmlModule.startDataType(
807 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.thumbnailTable.name"),
808 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.thumbnailTable.desc"));
809 List<String> emptyHeaders =
new ArrayList<>();
810 for (
int i = 0; i < ReportHTML.THUMBNAIL_COLUMNS; i++) {
811 emptyHeaders.add(
"");
813 htmlModule.startTable(emptyHeaders);
815 htmlModule.addThumbnailRows(images);
817 htmlModule.endTable();
818 htmlModule.endDataType();
833 }
catch (TskCoreException ex) {
835 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.errGetContentFromBBArtifact"));
836 logger.log(Level.WARNING,
"Error while getting content from a blackboard artifact to report on.", ex);
853 Content c = contentTag.getContent();
854 if (c instanceof AbstractFile ==
false) {
868 || file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS
869 || file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS) {
880 private Boolean failsTagFilter(HashSet<String> tagNames, HashSet<String> tagsNamesFilter) {
881 if (null == tagsNamesFilter || tagsNamesFilter.isEmpty()) {
885 HashSet<String> filteredTagNames =
new HashSet<>(tagNames);
886 filteredTagNames.retainAll(tagsNamesFilter);
887 return filteredTagNames.isEmpty();
899 private List<ArtifactData> getFilteredArtifacts(BlackboardArtifact.Type type, HashSet<String> tagNamesFilter) {
900 List<ArtifactData> artifacts =
new ArrayList<>();
902 for (BlackboardArtifact artifact : skCase.getBlackboardArtifacts(type.getTypeID())) {
903 List<BlackboardArtifactTag> tags = Case.getCurrentCase().getServices().getTagsManager().getBlackboardArtifactTagsByArtifact(artifact);
904 HashSet<String> uniqueTagNames =
new HashSet<>();
905 for (BlackboardArtifactTag tag : tags) {
906 uniqueTagNames.add(tag.getName().getDisplayName());
908 if (failsTagFilter(uniqueTagNames, tagNamesFilter)) {
912 artifacts.add(
new ArtifactData(artifact, skCase.getBlackboardAttributes(artifact), uniqueTagNames));
913 }
catch (TskCoreException ex) {
914 errorList.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.failedGetBBAttribs"));
915 logger.log(Level.SEVERE,
"Failed to get Blackboard Attributes when generating report.", ex);
918 }
catch (TskCoreException ex) {
919 errorList.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.failedGetBBArtifacts"));
920 logger.log(Level.SEVERE,
"Failed to get Blackboard Artifacts when generating report.", ex);
930 @SuppressWarnings(
"deprecation")
931 private
void writeKeywordHits(List<TableReportModule> tableModules, String comment, HashSet<String> tagNamesFilter) {
938 String orderByClause;
939 if (currentCase.getCaseType() == Case.CaseType.MULTI_USER_CASE) {
940 orderByClause =
"ORDER BY convert_to(att.value_text, 'SQL_ASCII') ASC NULLS FIRST";
942 orderByClause =
"ORDER BY list ASC";
944 String keywordListQuery
945 =
"SELECT att.value_text AS list " +
946 "FROM blackboard_attributes AS att, blackboard_artifacts AS art " +
947 "WHERE att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() +
" " +
948 "AND art.artifact_type_id = " + ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() +
" " +
949 "AND att.artifact_id = art.artifact_id " +
950 "GROUP BY list " + orderByClause;
952 try (CaseDbQuery dbQuery = skCase.executeQuery(keywordListQuery)) {
953 ResultSet listsRs = dbQuery.getResultSet();
954 List<String> lists =
new ArrayList<>();
955 while (listsRs.next()) {
956 String list = listsRs.getString(
"list");
957 if (list.isEmpty()) {
958 list = NbBundle.getMessage(this.getClass(),
"ReportGenerator.writeKwHits.userSrchs");
964 for (TableReportModule module : tableModules) {
965 module.startDataType(ARTIFACT_TYPE.TSK_KEYWORD_HIT.getDisplayName(), comment);
966 module.addSetIndex(lists);
967 tableProgress.get(module).updateStatusLabel(
968 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.progress.processing",
969 ARTIFACT_TYPE.TSK_KEYWORD_HIT.getDisplayName()));
971 }
catch (TskCoreException | SQLException ex) {
972 errorList.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.failedQueryKWLists"));
973 logger.log(Level.SEVERE,
"Failed to query keyword lists: ", ex);
977 if (currentCase.getCaseType() == Case.CaseType.MULTI_USER_CASE) {
978 orderByClause =
"ORDER BY convert_to(att3.value_text, 'SQL_ASCII') ASC NULLS FIRST, "
979 +
"convert_to(att1.value_text, 'SQL_ASCII') ASC NULLS FIRST, "
980 +
"convert_to(f.parent_path, 'SQL_ASCII') ASC NULLS FIRST, "
981 +
"convert_to(f.name, 'SQL_ASCII') ASC NULLS FIRST, "
982 +
"convert_to(att2.value_text, 'SQL_ASCII') ASC NULLS FIRST";
984 orderByClause =
"ORDER BY list ASC, keyword ASC, parent_path ASC, name ASC, preview ASC";
988 =
"SELECT art.artifact_id, art.obj_id, att1.value_text AS keyword, att2.value_text AS preview, att3.value_text AS list, f.name AS name, f.parent_path AS parent_path " +
989 "FROM blackboard_artifacts AS art, blackboard_attributes AS att1, blackboard_attributes AS att2, blackboard_attributes AS att3, tsk_files AS f " +
990 "WHERE (att1.artifact_id = art.artifact_id) " +
991 "AND (att2.artifact_id = art.artifact_id) " +
992 "AND (att3.artifact_id = art.artifact_id) " +
993 "AND (f.obj_id = art.obj_id) " +
994 "AND (att1.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID() +
") " +
995 "AND (att2.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW.getTypeID() +
") " +
996 "AND (att3.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() +
") " +
997 "AND (art.artifact_type_id = " + ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() +
") " +
1000 try (CaseDbQuery dbQuery = skCase.executeQuery(keywordsQuery)) {
1001 ResultSet resultSet = dbQuery.getResultSet();
1003 String currentKeyword =
"";
1004 String currentList =
"";
1005 while (resultSet.next()) {
1007 if (tableModules.isEmpty()) {
1010 Iterator<TableReportModule> iter = tableModules.iterator();
1011 while (iter.hasNext()) {
1012 TableReportModule module = iter.next();
1013 if (tableProgress.get(module).getStatus() == ReportStatus.CANCELED) {
1019 HashSet<String> uniqueTagNames = getUniqueTagNames(resultSet.getLong(
"artifact_id"));
1020 if (failsTagFilter(uniqueTagNames, tagNamesFilter)) {
1023 String tagsList = makeCommaSeparatedList(uniqueTagNames);
1025 Long objId = resultSet.getLong(
"obj_id");
1026 String keyword = resultSet.getString(
"keyword");
1027 String preview = resultSet.getString(
"preview");
1028 String list = resultSet.getString(
"list");
1029 String uniquePath =
"";
1032 AbstractFile f = skCase.getAbstractFileById(objId);
1034 uniquePath = skCase.getAbstractFileById(objId).getUniquePath();
1036 }
catch (TskCoreException ex) {
1038 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.failedGetAbstractFileByID"));
1039 logger.log(Level.WARNING,
"Failed to get Abstract File by ID.", ex);
1043 if ((!list.equals(currentList) && !list.isEmpty()) || (list.isEmpty() && !currentList.equals(
1044 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.writeKwHits.userSrchs")))) {
1045 if (!currentList.isEmpty()) {
1046 for (TableReportModule module : tableModules) {
1051 currentList = list.isEmpty() ? NbBundle
1052 .getMessage(this.getClass(),
"ReportGenerator.writeKwHits.userSrchs") : list;
1053 currentKeyword =
"";
1054 for (TableReportModule module : tableModules) {
1055 module.startSet(currentList);
1056 tableProgress.get(module).updateStatusLabel(
1057 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.progress.processingList",
1058 ARTIFACT_TYPE.TSK_KEYWORD_HIT.getDisplayName(), currentList));
1061 if (!keyword.equals(currentKeyword)) {
1062 if (!currentKeyword.equals(
"")) {
1063 for (TableReportModule module : tableModules) {
1067 currentKeyword = keyword;
1068 for (TableReportModule module : tableModules) {
1069 module.addSetElement(currentKeyword);
1070 List<String> columnHeaderNames =
new ArrayList<>();
1071 columnHeaderNames.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.preview"));
1072 columnHeaderNames.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.srcFile"));
1073 columnHeaderNames.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tags"));
1074 module.startTable(columnHeaderNames);
1078 String previewreplace = EscapeUtil.escapeHtml(preview);
1079 for (TableReportModule module : tableModules) {
1080 module.addRow(Arrays.asList(
new String[]{previewreplace.replaceAll(
"<!",
""), uniquePath, tagsList}));
1085 for (TableReportModule module : tableModules) {
1086 tableProgress.get(module).increment();
1087 module.endDataType();
1089 }
catch (TskCoreException | SQLException ex) {
1090 errorList.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.failedQueryKWs"));
1091 logger.log(Level.SEVERE,
"Failed to query keywords: ", ex);
1100 @SuppressWarnings(
"deprecation")
1101 private
void writeHashsetHits(List<TableReportModule> tableModules, String comment, HashSet<String> tagNamesFilter) {
1102 String orderByClause;
1103 if (currentCase.getCaseType() == Case.CaseType.MULTI_USER_CASE) {
1104 orderByClause =
"ORDER BY convert_to(att.value_text, 'SQL_ASCII') ASC NULLS FIRST";
1106 orderByClause =
"ORDER BY att.value_text ASC";
1108 String hashsetsQuery
1109 =
"SELECT att.value_text AS list " +
1110 "FROM blackboard_attributes AS att, blackboard_artifacts AS art " +
1111 "WHERE att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() +
" " +
1112 "AND art.artifact_type_id = " + ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID() +
" " +
1113 "AND att.artifact_id = art.artifact_id " +
1114 "GROUP BY list " + orderByClause;
1116 try (CaseDbQuery dbQuery = skCase.executeQuery(hashsetsQuery)) {
1118 ResultSet listsRs = dbQuery.getResultSet();
1119 List<String> lists =
new ArrayList<>();
1120 while (listsRs.next()) {
1121 lists.add(listsRs.getString(
"list"));
1124 for (TableReportModule module : tableModules) {
1125 module.startDataType(ARTIFACT_TYPE.TSK_HASHSET_HIT.getDisplayName(), comment);
1126 module.addSetIndex(lists);
1127 tableProgress.get(module).updateStatusLabel(
1128 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.progress.processing",
1129 ARTIFACT_TYPE.TSK_HASHSET_HIT.getDisplayName()));
1131 }
catch (TskCoreException | SQLException ex) {
1132 errorList.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.failedQueryHashsetLists"));
1133 logger.log(Level.SEVERE,
"Failed to query hashset lists: ", ex);
1137 if (currentCase.getCaseType() == Case.CaseType.MULTI_USER_CASE) {
1138 orderByClause =
"ORDER BY convert_to(att.value_text, 'SQL_ASCII') ASC NULLS FIRST, "
1139 +
"convert_to(f.parent_path, 'SQL_ASCII') ASC NULLS FIRST, "
1140 +
"convert_to(f.name, 'SQL_ASCII') ASC NULLS FIRST, "
1141 +
"size ASC NULLS FIRST";
1143 orderByClause =
"ORDER BY att.value_text ASC, f.parent_path ASC, f.name ASC, size ASC";
1145 String hashsetHitsQuery
1146 =
"SELECT art.artifact_id, art.obj_id, att.value_text AS setname, f.name AS name, f.size AS size, f.parent_path AS parent_path " +
1147 "FROM blackboard_artifacts AS art, blackboard_attributes AS att, tsk_files AS f " +
1148 "WHERE (att.artifact_id = art.artifact_id) " +
1149 "AND (f.obj_id = art.obj_id) " +
1150 "AND (att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() +
") " +
1151 "AND (art.artifact_type_id = " + ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID() +
") " +
1154 try (CaseDbQuery dbQuery = skCase.executeQuery(hashsetHitsQuery)) {
1156 ResultSet resultSet = dbQuery.getResultSet();
1157 String currentSet =
"";
1158 while (resultSet.next()) {
1160 if (tableModules.isEmpty()) {
1163 Iterator<TableReportModule> iter = tableModules.iterator();
1164 while (iter.hasNext()) {
1165 TableReportModule module = iter.next();
1166 if (tableProgress.get(module).getStatus() == ReportStatus.CANCELED) {
1172 HashSet<String> uniqueTagNames = getUniqueTagNames(resultSet.getLong(
"artifact_id"));
1173 if (failsTagFilter(uniqueTagNames, tagNamesFilter)) {
1176 String tagsList = makeCommaSeparatedList(uniqueTagNames);
1178 Long objId = resultSet.getLong(
"obj_id");
1179 String set = resultSet.getString(
"setname");
1180 String size = resultSet.getString(
"size");
1181 String uniquePath =
"";
1184 AbstractFile f = skCase.getAbstractFileById(objId);
1186 uniquePath = skCase.getAbstractFileById(objId).getUniquePath();
1188 }
catch (TskCoreException ex) {
1190 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.failedGetAbstractFileFromID"));
1191 logger.log(Level.WARNING,
"Failed to get Abstract File from ID.", ex);
1196 if (!set.equals(currentSet)) {
1197 if (!currentSet.isEmpty()) {
1198 for (TableReportModule module : tableModules) {
1204 for (TableReportModule module : tableModules) {
1205 module.startSet(currentSet);
1206 List<String> columnHeaderNames =
new ArrayList<>();
1207 columnHeaderNames.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.file"));
1208 columnHeaderNames.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.size"));
1209 columnHeaderNames.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tags"));
1210 module.startTable(columnHeaderNames);
1211 tableProgress.get(module).updateStatusLabel(
1212 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.progress.processingList",
1213 ARTIFACT_TYPE.TSK_HASHSET_HIT.getDisplayName(), currentSet));
1218 for (TableReportModule module : tableModules) {
1219 module.addRow(Arrays.asList(
new String[]{uniquePath, size, tagsList}));
1224 for (TableReportModule module : tableModules) {
1225 tableProgress.get(module).increment();
1226 module.endDataType();
1228 }
catch (TskCoreException | SQLException ex) {
1229 errorList.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.failedQueryHashsetHits"));
1230 logger.log(Level.SEVERE,
"Failed to query hashsets hits: ", ex);
1244 private List<Column> getArtifactTableColumns(
int artifactTypeId, Set<BlackboardAttribute.Type> attributeTypeSet) {
1245 ArrayList<Column> columns =
new ArrayList<>();
1249 if (ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID() == artifactTypeId) {
1250 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.url"),
1251 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_URL)));
1253 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.title"),
1254 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_TITLE)));
1256 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateCreated"),
1257 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_CREATED)));
1259 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.program"),
1260 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PROG_NAME)));
1262 }
else if (ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID() == artifactTypeId) {
1263 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.url"),
1264 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_URL)));
1266 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateTime"),
1267 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME)));
1269 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.name"),
1270 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_NAME)));
1272 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.value"),
1273 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_VALUE)));
1275 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.program"),
1276 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PROG_NAME)));
1278 }
else if (ARTIFACT_TYPE.TSK_WEB_HISTORY.getTypeID() == artifactTypeId) {
1279 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.url"),
1280 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_URL)));
1282 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateAccessed"),
1283 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED)));
1285 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.referrer"),
1286 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_REFERRER)));
1288 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.title"),
1289 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_TITLE)));
1291 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.program"),
1292 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PROG_NAME)));
1294 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.urlDomainDecoded"),
1295 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_URL_DECODED)));
1297 }
else if (ARTIFACT_TYPE.TSK_WEB_DOWNLOAD.getTypeID() == artifactTypeId) {
1298 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dest"),
1299 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PATH)));
1301 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.sourceUrl"),
1302 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_URL)));
1304 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateAccessed"),
1305 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED)));
1307 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.program"),
1308 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PROG_NAME)));
1310 }
else if (ARTIFACT_TYPE.TSK_RECENT_OBJECT.getTypeID() == artifactTypeId) {
1311 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.path"),
1312 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PATH)));
1314 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateTime"),
1315 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME)));
1317 }
else if (ARTIFACT_TYPE.TSK_INSTALLED_PROG.getTypeID() == artifactTypeId) {
1318 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.progName"),
1319 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PROG_NAME)));
1321 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.instDateTime"),
1322 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME)));
1324 }
else if (ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() == artifactTypeId) {
1325 columns.add(
new HeaderOnlyColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.preview")));
1327 }
else if (ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID() == artifactTypeId) {
1328 columns.add(
new SourceFileColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.file")));
1330 columns.add(
new HeaderOnlyColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.size")));
1332 }
else if (ARTIFACT_TYPE.TSK_DEVICE_ATTACHED.getTypeID() == artifactTypeId) {
1333 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.devMake"),
1334 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DEVICE_MAKE)));
1336 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.devModel"),
1337 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DEVICE_MODEL)));
1339 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.deviceId"),
1340 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DEVICE_ID)));
1342 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateTime"),
1343 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME)));
1345 }
else if (ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID() == artifactTypeId) {
1346 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.text"),
1347 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_TEXT)));
1349 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.domain"),
1350 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DOMAIN)));
1352 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateAccessed"),
1353 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED)));
1355 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.progName"),
1356 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PROG_NAME)));
1358 }
else if (ARTIFACT_TYPE.TSK_METADATA_EXIF.getTypeID() == artifactTypeId) {
1359 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateTaken"),
1360 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_CREATED)));
1362 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.devManufacturer"),
1363 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DEVICE_MAKE)));
1365 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.devModel"),
1366 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DEVICE_MODEL)));
1368 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.latitude"),
1369 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LATITUDE)));
1371 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.longitude"),
1372 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE)));
1374 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.altitude"),
1375 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE)));
1377 }
else if (ARTIFACT_TYPE.TSK_CONTACT.getTypeID() == artifactTypeId) {
1378 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.personName"),
1379 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_NAME)));
1381 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.phoneNumber"),
1382 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER)));
1384 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.phoneNumHome"),
1385 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_HOME)));
1387 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.phoneNumOffice"),
1388 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_OFFICE)));
1390 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.phoneNumMobile"),
1391 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_MOBILE)));
1393 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.email"),
1394 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_EMAIL)));
1396 }
else if (ARTIFACT_TYPE.TSK_MESSAGE.getTypeID() == artifactTypeId) {
1397 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.msgType"),
1398 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_MESSAGE_TYPE)));
1400 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.direction"),
1401 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DIRECTION)));
1403 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.readStatus"),
1404 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_READ_STATUS)));
1406 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateTime"),
1407 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME)));
1409 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.fromPhoneNum"),
1410 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_FROM)));
1412 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.fromEmail"),
1413 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_EMAIL_FROM)));
1415 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.toPhoneNum"),
1416 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO)));
1418 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.toEmail"),
1419 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_EMAIL_TO)));
1421 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.subject"),
1422 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_SUBJECT)));
1424 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.text"),
1425 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_TEXT)));
1427 }
else if (ARTIFACT_TYPE.TSK_CALLLOG.getTypeID() == artifactTypeId) {
1428 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.personName"),
1429 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_NAME)));
1431 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.fromPhoneNum"),
1432 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_FROM)));
1434 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.toPhoneNum"),
1435 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO)));
1437 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateTime"),
1438 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_START)));
1440 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.direction"),
1441 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DIRECTION)));
1443 }
else if (ARTIFACT_TYPE.TSK_CALENDAR_ENTRY.getTypeID() == artifactTypeId) {
1444 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.calendarEntryType"),
1445 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_CALENDAR_ENTRY_TYPE)));
1447 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.description"),
1448 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DESCRIPTION)));
1450 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.startDateTime"),
1451 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_START)));
1453 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.endDateTime"),
1454 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_END)));
1456 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.location"),
1457 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_LOCATION)));
1459 }
else if (ARTIFACT_TYPE.TSK_SPEED_DIAL_ENTRY.getTypeID() == artifactTypeId) {
1460 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.shortCut"),
1461 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_SHORTCUT)));
1463 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.personName"),
1464 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_NAME_PERSON)));
1466 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.phoneNumber"),
1467 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER)));
1469 }
else if (ARTIFACT_TYPE.TSK_BLUETOOTH_PAIRING.getTypeID() == artifactTypeId) {
1470 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.deviceName"),
1471 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DEVICE_NAME)));
1473 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.deviceAddress"),
1474 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DEVICE_ID)));
1476 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateTime"),
1477 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME)));
1479 }
else if (ARTIFACT_TYPE.TSK_GPS_TRACKPOINT.getTypeID() == artifactTypeId) {
1480 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.latitude"),
1481 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LATITUDE)));
1483 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.longitude"),
1484 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE)));
1486 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateTime"),
1487 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME)));
1489 }
else if (ARTIFACT_TYPE.TSK_GPS_BOOKMARK.getTypeID() == artifactTypeId) {
1490 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.latitude"),
1491 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LATITUDE)));
1493 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.longitude"),
1494 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE)));
1496 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.altitude"),
1497 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE)));
1499 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.name"),
1500 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_NAME)));
1502 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.locationAddress"),
1503 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_LOCATION)));
1505 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateTime"),
1506 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME)));
1508 }
else if (ARTIFACT_TYPE.TSK_GPS_LAST_KNOWN_LOCATION.getTypeID() == artifactTypeId) {
1509 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.latitude"),
1510 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LATITUDE)));
1512 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.longitude"),
1513 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE)));
1515 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.altitude"),
1516 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE)));
1518 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.name"),
1519 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_NAME)));
1521 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.locationAddress"),
1522 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_LOCATION)));
1524 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateTime"),
1525 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME)));
1527 }
else if (ARTIFACT_TYPE.TSK_GPS_SEARCH.getTypeID() == artifactTypeId) {
1528 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.latitude"),
1529 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LATITUDE)));
1531 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.longitude"),
1532 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE)));
1534 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.altitude"),
1535 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE)));
1537 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.name"),
1538 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_NAME)));
1540 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.locationAddress"),
1541 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_LOCATION)));
1543 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateTime"),
1544 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME)));
1546 }
else if (ARTIFACT_TYPE.TSK_SERVICE_ACCOUNT.getTypeID() == artifactTypeId) {
1547 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.category"),
1548 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_CATEGORY)));
1550 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.userId"),
1551 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_USER_ID)));
1553 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.password"),
1554 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PASSWORD)));
1556 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.personName"),
1557 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_NAME)));
1559 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.appName"),
1560 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PROG_NAME)));
1562 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.url"),
1563 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_URL)));
1565 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.appPath"),
1566 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PATH)));
1568 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.description"),
1569 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DESCRIPTION)));
1571 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.replytoAddress"),
1572 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_EMAIL_REPLYTO)));
1574 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.mailServer"),
1575 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_SERVER_NAME)));
1577 }
else if (ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED.getTypeID() == artifactTypeId) {
1578 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.name"),
1579 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_NAME)));
1581 }
else if (ARTIFACT_TYPE.TSK_EXT_MISMATCH_DETECTED.getTypeID() == artifactTypeId) {
1582 columns.add(
new HeaderOnlyColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.file")));
1584 columns.add(
new HeaderOnlyColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.extension.text")));
1586 columns.add(
new HeaderOnlyColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.mimeType.text")));
1588 columns.add(
new HeaderOnlyColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.path")));
1590 }
else if (ARTIFACT_TYPE.TSK_OS_INFO.getTypeID() == artifactTypeId) {
1591 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.processorArchitecture.text"),
1592 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PROCESSOR_ARCHITECTURE)));
1594 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.osName.text"),
1595 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PROG_NAME)));
1597 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.osInstallDate.text"),
1598 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME)));
1600 }
else if (ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID() == artifactTypeId) {
1601 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskEmailTo"),
1602 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_EMAIL_TO)));
1604 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskEmailFrom"),
1605 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_EMAIL_FROM)));
1607 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskSubject"),
1608 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_SUBJECT)));
1610 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskDateTimeSent"),
1611 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_SENT)));
1613 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskDateTimeRcvd"),
1614 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_RCVD)));
1616 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskPath"),
1617 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PATH)));
1619 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskEmailCc"),
1620 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_EMAIL_CC)));
1622 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskEmailBcc"),
1623 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_EMAIL_BCC)));
1625 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskMsgId"),
1626 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_MSG_ID)));
1628 }
else if (ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID() == artifactTypeId) {
1629 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskSetName"),
1630 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_SET_NAME)));
1632 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskInterestingFilesCategory"),
1633 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_CATEGORY)));
1635 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskPath"),
1636 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PATH)));
1638 }
else if (ARTIFACT_TYPE.TSK_GPS_ROUTE.getTypeID() == artifactTypeId) {
1639 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskGpsRouteCategory"),
1640 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_CATEGORY)));
1642 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateTime"),
1643 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME)));
1645 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.latitudeEnd"),
1646 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LATITUDE_END)));
1648 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.longitudeEnd"),
1649 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE_END)));
1651 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.latitudeStart"),
1652 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LATITUDE_START)));
1654 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.longitudeStart"),
1655 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE_START)));
1657 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.name"),
1658 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_NAME)));
1660 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.location"),
1661 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_LOCATION)));
1663 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.program"),
1664 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PROG_NAME)));
1666 }
else if (ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID() == artifactTypeId) {
1667 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tskSetName"),
1668 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_SET_NAME)));
1670 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.associatedArtifact"),
1671 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT)));
1673 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.program"),
1674 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PROG_NAME)));
1676 }
else if (ARTIFACT_TYPE.TSK_PROG_RUN.getTypeID() == artifactTypeId) {
1677 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.program"),
1678 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PROG_NAME)));
1680 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.associatedArtifact"),
1681 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT)));
1683 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.dateTime"),
1684 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME)));
1686 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.count"),
1687 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_COUNT)));
1689 }
else if (ARTIFACT_TYPE.TSK_OS_ACCOUNT.getTypeID() == artifactTypeId) {
1690 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.userName"),
1691 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_USER_NAME)));
1693 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.userId"),
1694 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_USER_ID)));
1696 }
else if (ARTIFACT_TYPE.TSK_REMOTE_DRIVE.getTypeID() == artifactTypeId) {
1697 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.localPath"),
1698 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_LOCAL_PATH)));
1700 columns.add(
new AttributeColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.remotePath"),
1701 new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_REMOTE_PATH)));
1705 for (BlackboardAttribute.Type type : attributeTypeSet) {
1706 columns.add(
new AttributeColumn(type.getDisplayName(), type));
1708 columns.add(
new SourceFileColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.srcFile")));
1709 columns.add(
new TaggedResultsColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tags")));
1717 for (Column column : columns) {
1718 attributeTypeSet = column.removeTypeFromSet(attributeTypeSet);
1721 for (BlackboardAttribute.Type type : attributeTypeSet) {
1722 columns.add(
new AttributeColumn(type.getDisplayName(), type));
1725 if (artifactTypeId == ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID()
1726 || artifactTypeId == ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID()
1727 || artifactTypeId == ARTIFACT_TYPE.TSK_WEB_HISTORY.getTypeID()
1728 || artifactTypeId == ARTIFACT_TYPE.TSK_WEB_DOWNLOAD.getTypeID()
1729 || artifactTypeId == ARTIFACT_TYPE.TSK_RECENT_OBJECT.getTypeID()
1730 || artifactTypeId == ARTIFACT_TYPE.TSK_INSTALLED_PROG.getTypeID()
1731 || artifactTypeId == ARTIFACT_TYPE.TSK_DEVICE_ATTACHED.getTypeID()
1732 || artifactTypeId == ARTIFACT_TYPE.TSK_WEB_SEARCH_QUERY.getTypeID()
1733 || artifactTypeId == ARTIFACT_TYPE.TSK_METADATA_EXIF.getTypeID()
1734 || artifactTypeId == ARTIFACT_TYPE.TSK_CONTACT.getTypeID()
1735 || artifactTypeId == ARTIFACT_TYPE.TSK_MESSAGE.getTypeID()
1736 || artifactTypeId == ARTIFACT_TYPE.TSK_CALLLOG.getTypeID()
1737 || artifactTypeId == ARTIFACT_TYPE.TSK_CALENDAR_ENTRY.getTypeID()
1738 || artifactTypeId == ARTIFACT_TYPE.TSK_SPEED_DIAL_ENTRY.getTypeID()
1739 || artifactTypeId == ARTIFACT_TYPE.TSK_BLUETOOTH_PAIRING.getTypeID()
1740 || artifactTypeId == ARTIFACT_TYPE.TSK_GPS_TRACKPOINT.getTypeID()
1741 || artifactTypeId == ARTIFACT_TYPE.TSK_GPS_BOOKMARK.getTypeID()
1742 || artifactTypeId == ARTIFACT_TYPE.TSK_GPS_LAST_KNOWN_LOCATION.getTypeID()
1743 || artifactTypeId == ARTIFACT_TYPE.TSK_GPS_SEARCH.getTypeID()
1744 || artifactTypeId == ARTIFACT_TYPE.TSK_SERVICE_ACCOUNT.getTypeID()
1745 || artifactTypeId == ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED.getTypeID()
1746 || artifactTypeId == ARTIFACT_TYPE.TSK_OS_INFO.getTypeID()) {
1747 columns.add(
new SourceFileColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.srcFile")));
1749 columns.add(
new TaggedResultsColumn(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.artTableColHdr.tags")));
1762 private String makeCommaSeparatedList(Collection<String> items) {
1764 for (Iterator<String> iterator = items.iterator(); iterator.hasNext();) {
1765 list += iterator.next() + (iterator.hasNext() ?
", " :
"");
1777 private String getFileUniquePath(Content content) {
1779 if (content != null) {
1780 return content.getUniquePath();
1784 }
catch (TskCoreException ex) {
1785 errorList.add(NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.failedGetAbstractFileByID"));
1786 logger.log(Level.WARNING,
"Failed to get Abstract File by ID.", ex);
1804 ArtifactData(BlackboardArtifact artifact, List<BlackboardAttribute> attrs, HashSet<String> tags) {
1806 this.attributes = attrs;
1810 }
catch (TskCoreException ex) {
1811 logger.log(Level.SEVERE,
"Could not get content from database");
1828 return artifact.getArtifactID();
1832 return artifact.getObjectID();
1853 List<String> thisRow =
getRow();
1854 List<String> otherRow = otherArtifactData.
getRow();
1855 for (
int i = 0; i < thisRow.size(); i++) {
1856 int compare = thisRow.get(i).compareTo(otherRow.get(i));
1872 if (rowData == null) {
1877 if (rowData.size() > 0) {
1879 for (
int i = 0; i < rowData.size(); i++) {
1880 if (rowData.get(i) == null) {
1886 return new ArrayList<>();
1888 }
catch (TskCoreException ex) {
1890 NbBundle.getMessage(
this.getClass(),
"ReportGenerator.errList.coreExceptionWhileGenRptRow"));
1891 logger.log(Level.WARNING,
"Core exception while generating row data for artifact report.", ex);
1892 rowData = Collections.<String>emptyList();
1909 List<String> orderedRowData =
new ArrayList<>();
1910 if (ARTIFACT_TYPE.TSK_EXT_MISMATCH_DETECTED.getTypeID() ==
getArtifact().getArtifactTypeID()) {
1911 if (content != null && content instanceof AbstractFile) {
1912 AbstractFile file = (AbstractFile) content;
1913 orderedRowData.add(file.getName());
1914 orderedRowData.add(file.getNameExtension());
1915 String mimeType = file.getMIMEType();
1916 if (mimeType == null) {
1917 orderedRowData.add(
"");
1919 orderedRowData.add(mimeType);
1921 orderedRowData.add(file.getUniquePath());
1924 orderedRowData.add(null);
1925 orderedRowData.add(null);
1926 orderedRowData.add(null);
1927 orderedRowData.add(null);
1929 orderedRowData.add(makeCommaSeparatedList(
getTags()));
1931 }
else if (ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID() ==
getArtifact().getArtifactTypeID()) {
1932 String[] attributeDataArray =
new String[3];
1935 for (BlackboardAttribute attr : attributes) {
1936 if (attr.getAttributeType().equals(
new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_SET_NAME))) {
1937 attributeDataArray[0] = attr.getDisplayString();
1938 }
else if (attr.getAttributeType().equals(
new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_CATEGORY))) {
1939 attributeDataArray[1] = attr.getDisplayString();
1940 }
else if (attr.getAttributeType().equals(
new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PATH))) {
1941 String pathToShow = attr.getDisplayString();
1942 if (pathToShow.isEmpty()) {
1943 pathToShow = getFileUniquePath(content);
1945 attributeDataArray[2] = pathToShow;
1948 orderedRowData.addAll(Arrays.asList(attributeDataArray));
1949 orderedRowData.add(makeCommaSeparatedList(
getTags()));
1952 if (ReportGenerator.this.columnHeaderMap.containsKey(
this.artifact.getArtifactTypeID())) {
1954 for (
Column currColumn : ReportGenerator.this.columnHeaderMap.get(
this.artifact.getArtifactTypeID())) {
1955 String cellData = currColumn.getCellData(
this);
1956 orderedRowData.add(cellData);
1961 return orderedRowData;
1975 @SuppressWarnings(
"deprecation")
1976 private HashSet<String> getUniqueTagNames(
long artifactId) throws TskCoreException {
1977 HashSet<String> uniqueTagNames =
new HashSet<>();
1979 String query =
"SELECT display_name, artifact_id FROM tag_names AS tn, blackboard_artifact_tags AS bat " +
1980 "WHERE tn.tag_name_id = bat.tag_name_id AND bat.artifact_id = " + artifactId;
1982 try (CaseDbQuery dbQuery = skCase.executeQuery(query)) {
1983 ResultSet tagNameRows = dbQuery.getResultSet();
1984 while (tagNameRows.next()) {
1985 uniqueTagNames.add(tagNameRows.getString(
"display_name"));
1987 }
catch (TskCoreException | SQLException ex) {
1988 throw new TskCoreException(
"Error getting tag names for artifact: ", ex);
1991 return uniqueTagNames;
2001 Set<BlackboardAttribute.Type>
removeTypeFromSet(Set<BlackboardAttribute.Type> types);
2016 this.columnHeader = Objects.requireNonNull(columnHeader);
2027 List<BlackboardAttribute> attributes = artData.
getAttributes();
2028 for (BlackboardAttribute attribute : attributes) {
2029 if (attribute.getAttributeType().equals(this.
attributeType)) {
2030 if (attribute.getAttributeType().getValueType() != BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME) {
2031 return attribute.getDisplayString();
2062 return getFileUniquePath(artData.
getContent());
2091 return makeCommaSeparatedList(artData.
getTags());
2116 throw new UnsupportedOperationException(
"Cannot get cell data of unspecified column");
String getCellData(ArtifactData artData)
List< BlackboardArtifact.Type > artifactTypes
static String getStringTime(long epochSeconds, TimeZone tzone)
List< FileReportModule > fileModules
void checkIfTagHasImage(ContentTag contentTag)
static boolean thumbnailSupported(Content content)
void generateReport(String baseReportDir, ReportProgressPanel progressPanel)
Set< BlackboardAttribute.Type > removeTypeFromSet(Set< BlackboardAttribute.Type > types)
HashSet< String > getTags()
List< BlackboardAttribute > getAttributes()
Set< BlackboardAttribute.Type > removeTypeFromSet(Set< Type > types)
BlackboardAttribute.Type attributeType
int compareTo(ArtifactData otherArtifactData)
List< TableReportModule > tableModules
BlackboardArtifact getArtifact()
void setIndeterminate(boolean indeterminate)
Set< BlackboardAttribute.Type > removeTypeFromSet(Set< Type > types)
List< String > getOrderedRowDataAsStrings()
TagsManager getTagsManager()
void checkIfFileIsImage(AbstractFile file)
boolean passesTagNamesFilter(String tagName)
String getCellData(ArtifactData artData)
String getCellData(ArtifactData artData)
void makeContentTagsTables()
void setMaximumProgress(int max)
SleuthkitCase getSleuthkitCase()
void checkIfTagHasImage(BlackboardArtifactTag artifactTag)
String getCellData(ArtifactData artData)
Set< BlackboardAttribute.Type > removeTypeFromSet(Set< Type > types)
void makeThumbnailTable()
static Case getCurrentCase()
static void show(String title, String message, MessageType type, ActionListener actionListener)
void updateStatusLabel(String statusMessage)
BlackboardArtifact artifact
List< BlackboardAttribute > attributes
List< AbstractFile > getFiles()
void makeBlackboardArtifactTagsTables()
void makeBlackboardArtifactTables()
String getCellData(ArtifactData artData)
HashSet< String > tagNamesFilter
Set< BlackboardAttribute.Type > removeTypeFromSet(Set< Type > types)