19 package org.sleuthkit.autopsy.datamodel;
23 import com.google.common.annotations.Beta;
24 import com.google.common.cache.Cache;
25 import com.google.common.cache.CacheBuilder;
26 import java.beans.PropertyChangeEvent;
27 import java.beans.PropertyChangeListener;
28 import java.lang.ref.WeakReference;
29 import java.text.MessageFormat;
30 import java.util.ArrayList;
31 import java.util.Arrays;
32 import java.util.Collections;
33 import java.util.EnumSet;
34 import java.util.LinkedHashMap;
35 import java.util.List;
37 import java.util.MissingResourceException;
39 import java.util.concurrent.ExecutionException;
40 import java.util.concurrent.TimeUnit;
41 import java.util.logging.Level;
42 import java.util.stream.Collectors;
43 import java.util.stream.Stream;
44 import javax.swing.Action;
45 import javax.swing.SwingUtilities;
46 import org.apache.commons.lang3.StringUtils;
47 import org.apache.commons.lang3.tuple.Pair;
48 import org.openide.nodes.Node;
49 import org.openide.nodes.Sheet;
50 import org.openide.util.Lookup;
51 import org.openide.util.NbBundle;
52 import org.openide.util.NbBundle.Messages;
53 import org.openide.util.Utilities;
54 import org.openide.util.WeakListeners;
55 import org.openide.util.lookup.Lookups;
80 import org.
sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
82 import org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
101 import org.
sleuthkit.datamodel.BlackboardArtifact.Category;
134 private static final Cache<Long, Content>
contentCache = CacheBuilder.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES).build();
153 BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT.getTypeID()
169 private final PropertyChangeListener
listener =
new PropertyChangeListener() {
171 public void propertyChange(PropertyChangeEvent evt) {
172 String eventType = evt.getPropertyName();
175 if (event.getAddedTag().getArtifact().equals(artifact)) {
180 if (event.getDeletedTagInfo().getArtifactID() == artifact.getArtifactID()) {
185 if (event.getAddedTag().getContent().equals(srcContent)) {
190 if (event.getDeletedTagInfo().getContentID() == srcContent.getId()) {
195 if (event.getContentID() == srcContent.getId()) {
199 if (evt.getNewValue() == null) {
204 contentCache.invalidateAll();
215 String originalName = evt.getOldValue().toString();
216 translatedSourceName = evt.getNewValue().toString();
217 setDisplayName(translatedSourceName);
218 setShortDescription(originalName);
220 Bundle.BlackboardArtifactNode_createSheet_srcFile_origName(),
221 Bundle.BlackboardArtifactNode_createSheet_srcFile_origDisplayName(),
235 private final PropertyChangeListener
weakListener = WeakListeners.propertyChange(listener, null);
254 if (srcContent == null) {
255 throw new IllegalArgumentException(MessageFormat.format(
"Artifact missing source content (artifact objID={0})", artifact));
265 srcContent.getUniquePath();
266 }
catch (TskCoreException ex) {
267 logger.log(Level.WARNING, MessageFormat.format(
"Error getting the unique path of the source content (artifact objID={0})", artifact.getId()), ex);
271 setName(Long.toString(artifact.getArtifactID()));
272 setIconBaseWithExtension(iconPath != null && iconPath.charAt(0) ==
'/' ? iconPath.substring(1) : iconPath);
289 super(artifact,
createLookup(artifact, useAssociatedFileInLookup));
294 srcContent = artifact.getParent();
295 }
catch (TskCoreException ex) {
296 logger.log(Level.WARNING, MessageFormat.format(
"Error getting the parent of the artifact for (artifact objID={0})", artifact.getId()), ex);
299 if (srcContent != null) {
307 srcContent.getUniquePath();
308 }
catch (TskCoreException ex) {
309 logger.log(Level.WARNING, MessageFormat.format(
"Error getting the unique path of the source content (artifact objID={0})", artifact.getId()), ex);
312 throw new IllegalArgumentException(MessageFormat.format(
"Artifact missing source content (artifact objID={0})", artifact));
315 setName(Long.toString(artifact.getArtifactID()));
318 setIconBaseWithExtension(iconPath != null && iconPath.charAt(0) ==
'/' ? iconPath.substring(1) : iconPath);
341 private static BlackboardArtifact.Type
getType(BlackboardArtifact artifact) {
343 return artifact.getType();
344 }
catch (TskCoreException ex) {
345 logger.log(Level.WARNING, MessageFormat.format(
"Error getting the artifact type for artifact (artifact objID={0})", artifact.getId()), ex);
361 private static Lookup
createLookup(BlackboardArtifact artifact,
boolean useAssociatedFile) {
367 if (useAssociatedFile) {
370 long srcObjectID = artifact.getObjectID();
371 content = contentCache.get(srcObjectID, () -> artifact.getSleuthkitCase().getContentById(srcObjectID));
373 }
catch (ExecutionException ex) {
374 logger.log(Level.SEVERE, MessageFormat.format(
"Error getting source/associated content (artifact object ID={0})", artifact.getId()), ex);
386 if (artifact instanceof AnalysisResult) {
399 if (content == null) {
400 return Lookups.fixed(artifact, artifactItem);
402 return Lookups.fixed(artifact, artifactItem, content);
415 for (Content lookupContent : this.getLookup().lookupAll(Content.class)) {
425 if ((lookupContent != null) && (lookupContent.getId() != artifact.getId())) {
426 return lookupContent;
445 private static Content
getPathIdFile(BlackboardArtifact artifact)
throws ExecutionException {
447 BlackboardAttribute attribute = artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID));
448 if (attribute != null) {
449 return contentCache.get(attribute.getValueLong(), () -> artifact.getSleuthkitCase().getContentById(attribute.getValueLong()));
451 }
catch (TskCoreException ex) {
452 logger.log(Level.WARNING, MessageFormat.format(
"Error getting content for path id attrbiute for artifact: ", artifact.getId()), ex);
496 return Stream.of(items)
497 .filter(i -> i != null)
498 .collect(Collectors.toList());
504 List<List<Action>> actionsLists =
new ArrayList<>();
526 if (this.srcContent instanceof Report) {
531 int selectedFileCount = Utilities.actionsGlobalContext().lookupAll(AbstractFile.class).size();
532 int selectedArtifactCount = Utilities.actionsGlobalContext().lookupAll(
BlackboardArtifactItem.class).size();
538 if (parentFileNode != null) {
543 actionsLists.add(
getTagActions(parentFileNode != null, this.artifact, selectedFileCount, selectedArtifactCount));
549 actionsLists.add(Arrays.asList(super.getActions(context)));
551 return actionsLists.stream()
553 .filter((lst) -> lst != null && !lst.isEmpty())
555 .flatMap(lst -> Stream.concat(Stream.of((Action) null), lst.stream()))
558 .toArray(sz ->
new Action[sz]);
570 "BlackboardArtifactNode_getAssociatedTypeStr_webCache=Cached File",
571 "BlackboardArtifactNode_getAssociatedTypeStr_webDownload=Downloaded File",
572 "BlackboardArtifactNode_getAssociatedTypeStr_associated=Associated File",})
574 if (BlackboardArtifact.Type.TSK_WEB_CACHE.equals(
artifactType)) {
575 return Bundle.BlackboardArtifactNode_getAssociatedTypeStr_webCache();
576 }
else if (BlackboardArtifact.Type.TSK_WEB_DOWNLOAD.equals(
artifactType)) {
577 return Bundle.BlackboardArtifactNode_getAssociatedTypeStr_webDownload();
579 return Bundle.BlackboardArtifactNode_getAssociatedTypeStr_associated();
592 "BlackboardArtifactNode_getViewSrcContentAction_type_File=File",
593 "BlackboardArtifactNode_getViewSrcContentAction_type_DataArtifact=Data Artifact",
594 "BlackboardArtifactNode_getViewSrcContentAction_type_OSAccount=OS Account",
595 "BlackboardArtifactNode_getViewSrcContentAction_type_unknown=Item"
598 if (content instanceof AbstractFile) {
599 return Bundle.BlackboardArtifactNode_getViewSrcContentAction_type_File();
600 }
else if (content instanceof DataArtifact) {
601 return Bundle.BlackboardArtifactNode_getViewSrcContentAction_type_DataArtifact();
602 }
else if (content instanceof OsAccount) {
603 return Bundle.BlackboardArtifactNode_getViewSrcContentAction_type_OSAccount();
605 return Bundle.BlackboardArtifactNode_getViewSrcContentAction_type_unknown();
621 "BlackboardArtifactNode_getAssociatedFileActions_viewAssociatedFileAction=View {0} in Directory",
623 "BlackboardArtifactNode_getAssociatedFileActions_viewAssociatedFileInTimelineAction=View {0} in Timeline..."
627 AbstractFile associatedFile = findLinked(artifact);
628 if (associatedFile != null) {
629 return Arrays.asList(
631 Bundle.BlackboardArtifactNode_getAssociatedFileActions_viewAssociatedFileAction(
635 Bundle.BlackboardArtifactNode_getAssociatedFileActions_viewAssociatedFileInTimelineAction(
640 }
catch (TskCoreException ex) {
641 logger.log(Level.SEVERE, MessageFormat.format(
"Error getting linked file of artifact (artifact objID={0})", artifact.getId()), ex);
643 return Collections.emptyList();
655 "# {0} - contentType",
656 "BlackboardArtifactNode_getSrcContentAction_actionDisplayName=View Source {0} in Directory"
659 if (content instanceof DataArtifact) {
661 (BlackboardArtifact) content,
662 Bundle.BlackboardArtifactNode_getSrcContentAction_actionDisplayName(
664 }
else if (content instanceof OsAccount) {
667 Bundle.BlackboardArtifactNode_getSrcContentAction_actionDisplayName(
669 }
else if (content instanceof AbstractFile || artifact instanceof DataArtifact) {
671 Bundle.BlackboardArtifactNode_getSrcContentAction_actionDisplayName(
688 if (content instanceof File) {
689 return new FileNode((AbstractFile) content);
690 }
else if (content instanceof Directory) {
692 }
else if (content instanceof VirtualDirectory) {
694 }
else if (content instanceof LocalDirectory) {
696 }
else if (content instanceof LayoutFile) {
698 }
else if (content instanceof LocalFile || content instanceof DerivedFile) {
700 }
else if (content instanceof SlackFile) {
715 if ((srcContent instanceof AbstractFile)
717 .contains(
"." + ((AbstractFile) srcContent).getNameExtension().toLowerCase())) {
719 if (srcContent.getArtifacts(BlackboardArtifact.Type.TSK_ENCRYPTION_DETECTED.getTypeID()).size() > 0) {
722 }
catch (TskCoreException ex) {
723 logger.log(Level.WARNING,
"Unable to add unzip with password action to context menus", ex);
741 private List<Action>
getTagActions(
boolean hasSrcFile, BlackboardArtifact artifact,
int selectedFileCount,
int selectedArtifactCount) {
742 List<Action> actionsList =
new ArrayList<>();
745 if (hasSrcFile && !(artifact instanceof DataArtifact)) {
752 if (hasSrcFile && (!(artifact instanceof DataArtifact)) && (selectedFileCount == 1)) {
756 if (selectedArtifactCount == 1) {
772 "BlackboardArtifactNode_getSrcContentViewerActions_viewInNewWin=View Item in New Window",
773 "BlackboardArtifactNode_getSrcContentViewerActions_openInExtViewer=Open in External Viewer Ctrl+E"
776 List<Action> actionsList =
new ArrayList<>();
777 if (srcFileNode != null) {
778 actionsList.add(
new NewWindowViewAction(Bundle.BlackboardArtifactNode_getSrcContentViewerActions_viewInNewWin(), srcFileNode));
779 if (selectedFileCount == 1) {
780 actionsList.add(
new ExternalViewerAction(Bundle.BlackboardArtifactNode_getSrcContentViewerActions_openInExtViewer(), srcFileNode));
797 "# {0} - contentType",
798 "BlackboardArtifactNode_getTimelineSrcContentAction_actionDisplayName=View Source {0} in Timeline... "
801 if (srcContent instanceof AbstractFile) {
803 Bundle.BlackboardArtifactNode_getTimelineSrcContentAction_actionDisplayName(
805 }
else if (srcContent instanceof DataArtifact) {
809 Bundle.BlackboardArtifactNode_getTimelineSrcContentAction_actionDisplayName(
812 }
catch (TskCoreException ex) {
813 logger.log(Level.SEVERE, MessageFormat.format(
"Error getting source data artifact timestamp (artifact objID={0})", srcContent.getId()), ex);
829 "BlackboardArtifactNode_getTimelineArtifactAction_displayName=View Selected Item in Timeline... "
837 }
catch (TskCoreException ex) {
838 logger.log(Level.SEVERE, MessageFormat.format(
"Error getting artifact timestamp (artifact objID={0})", art.getId()), ex);
851 return srcContent.getName();
855 "BlackboardArtifactNode.createSheet.srcFile.name=Source Name",
856 "BlackboardArtifactNode.createSheet.srcFile.displayName=Source Name",
857 "BlackboardArtifactNode.createSheet.srcFile.origName=Original Name",
858 "BlackboardArtifactNode.createSheet.srcFile.origDisplayName=Original Name",
859 "BlackboardArtifactNode.createSheet.artifactType.displayName=Result Type",
860 "BlackboardArtifactNode.createSheet.artifactType.name=Result Type",
861 "BlackboardArtifactNode.createSheet.artifactDetails.displayName=Result Details",
862 "BlackboardArtifactNode.createSheet.artifactDetails.name=Result Details",
863 "BlackboardArtifactNode.createSheet.artifactMD5.displayName=MD5 Hash",
864 "BlackboardArtifactNode.createSheet.artifactMD5.name=MD5 Hash",
865 "BlackboardArtifactNode.createSheet.fileSize.name=Size",
866 "BlackboardArtifactNode.createSheet.fileSize.displayName=Size",
867 "BlackboardArtifactNode.createSheet.path.displayName=Path",
868 "BlackboardArtifactNode.createSheet.path.name=Path"
875 Sheet sheet = super.createSheet();
876 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
877 if (sheetSet == null) {
878 sheetSet = Sheet.createPropertiesSet();
889 Bundle.BlackboardArtifactNode_createSheet_srcFile_name(),
890 Bundle.BlackboardArtifactNode_createSheet_srcFile_displayName(),
894 GetSCOTask scoTask = null;
895 if (artifact instanceof AnalysisResult
896 && !(
artifactType.getTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID()
897 ||
artifactType.getTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID())) {
907 Bundle.BlackboardArtifactNode_createSheet_srcFile_name(),
908 Bundle.BlackboardArtifactNode_createSheet_srcFile_displayName(),
920 Bundle.BlackboardArtifactNode_createSheet_srcFile_origName(),
921 Bundle.BlackboardArtifactNode_createSheet_srcFile_origDisplayName(),
923 translatedSourceName != null ? srcContent.getName() :
""));
924 if (translatedSourceName == null) {
932 if (scoTask == null) {
941 if (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID()) {
943 BlackboardAttribute attribute = artifact.getAttribute(
new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT));
944 if (attribute != null) {
948 "BlackboardArtifactNode.createSheet.artifactType.name"),
950 "BlackboardArtifactNode.createSheet.artifactType.displayName"),
952 associatedArtifact.getDisplayName()));
955 "BlackboardArtifactNode.createSheet.artifactDetails.name"),
957 "BlackboardArtifactNode.createSheet.artifactDetails.displayName"),
959 associatedArtifact.getShortDescription()));
962 logger.log(Level.SEVERE, MessageFormat.format(
"Error getting associated artifact of TSK_INTERESTING_ARTIFACT_HIT artifact (objID={0}))", artifact.getId()), ex);
970 Map<String, Object> map =
new LinkedHashMap<>();
972 for (Map.Entry<String, Object> entry : map.entrySet()) {
982 if (customProperties != null) {
993 final int artifactTypeId = artifact.getArtifactTypeID();
994 if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_EXT_MISMATCH_DETECTED.getTypeID()) {
996 String actualMimeType =
"";
997 if (srcContent instanceof AbstractFile) {
998 AbstractFile file = (AbstractFile) srcContent;
999 ext = file.getNameExtension();
1000 actualMimeType = file.getMIMEType();
1001 if (actualMimeType == null) {
1002 actualMimeType =
"";
1008 "BlackboardArtifactNode.createSheet.ext.name"),
1010 "BlackboardArtifactNode.createSheet.ext.displayName"),
1015 "BlackboardArtifactNode.createSheet.mimeType.name"),
1017 "BlackboardArtifactNode.createSheet.mimeType.displayName"),
1027 String sourcePath =
"";
1029 sourcePath = srcContent.getUniquePath();
1030 }
catch (TskCoreException ex) {
1031 logger.log(Level.SEVERE, MessageFormat.format(
"Error getting unique path of source content (artifact objID={0})", artifact.getId()), ex);
1035 if (sourcePath.isEmpty() ==
false) {
1038 "BlackboardArtifactNode.createSheet.filePath.name"),
1040 "BlackboardArtifactNode.createSheet.filePath.displayName"),
1050 if (Arrays.asList(SHOW_FILE_METADATA).contains(artifactTypeId)) {
1051 AbstractFile file = srcContent instanceof AbstractFile ? (AbstractFile) srcContent : null;
1054 "ContentTagNode.createSheet.fileModifiedTime.name"),
1056 "ContentTagNode.createSheet.fileModifiedTime.displayName"),
1061 "ContentTagNode.createSheet.fileChangedTime.name"),
1063 "ContentTagNode.createSheet.fileChangedTime.displayName"),
1068 "ContentTagNode.createSheet.fileAccessedTime.name"),
1070 "ContentTagNode.createSheet.fileAccessedTime.displayName"),
1075 "ContentTagNode.createSheet.fileCreatedTime.name"),
1077 "ContentTagNode.createSheet.fileCreatedTime.displayName"),
1082 "ContentTagNode.createSheet.fileSize.name"),
1084 "ContentTagNode.createSheet.fileSize.displayName"),
1086 file == null ?
"" : file.getSize()));
1088 Bundle.BlackboardArtifactNode_createSheet_artifactMD5_name(),
1089 Bundle.BlackboardArtifactNode_createSheet_artifactMD5_displayName(),
1091 file == null ?
"" : StringUtils.defaultString(file.getMd5Hash())));
1094 String dataSourceStr =
"";
1096 Content dataSource = srcContent.getDataSource();
1097 if (dataSource != null) {
1098 dataSourceStr = dataSource.getName();
1102 }
catch (TskCoreException ex) {
1103 logger.log(Level.SEVERE, MessageFormat.format(
"Error getting source data source name (artifact objID={0})", artifact.getId()), ex);
1107 if (dataSourceStr.isEmpty() ==
false) {
1110 "BlackboardArtifactNode.createSheet.dataSrc.name"),
1112 "BlackboardArtifactNode.createSheet.dataSrc.displayName"),
1122 if (artifactTypeId == BlackboardArtifact.ARTIFACT_TYPE.TSK_METADATA_EXIF.getTypeID()) {
1125 if (srcContent instanceof AbstractFile) {
1126 AbstractFile af = (AbstractFile) srcContent;
1127 size = af.getSize();
1129 path = af.getUniquePath();
1130 }
catch (TskCoreException ex) {
1131 path = af.getParentPath();
1137 "BlackboardArtifactNode.createSheet.fileSize.name"),
1139 "BlackboardArtifactNode.createSheet.fileSize.displayName"),
1145 "BlackboardArtifactNode.createSheet.path.name"),
1147 "BlackboardArtifactNode.createSheet.path.displayName"),
1152 backgroundTasksPool.submit(scoTask);
1165 List<Tag> tags =
new ArrayList<>();
1170 logger.log(Level.SEVERE, MessageFormat.format(
"Error getting tags for artifact and its source content (artifact objID={0})", artifact.getId()), ex);
1199 for (Tag tag : tags) {
1200 if (!StringUtils.isBlank(tag.getComment())) {
1210 if (attributes != null && !attributes.isEmpty()) {
1212 if (attribute != null && !StringUtils.isBlank(attribute.getComment())) {
1229 String description = defaultDescription;
1234 }
else if (attribute != null) {
1235 description = Bundle.BlackboardArtifactNode_createSheet_count_noCorrelationValues_description();
1238 logger.log(Level.SEVERE, MessageFormat.format(
"Error querying central repository for other occurences count (artifact objID={0}, corrAttrType={1}, corrAttrValue={2})", artifact.getId(), attribute.
getCorrelationType(), attribute.
getCorrelationValue()), ex);
1240 logger.log(Level.SEVERE, MessageFormat.format(
"Error normalizing correlation attribute for central repository query (artifact objID={0}, corrAttrType={2}, corrAttrValue={3})", artifact.getId(), attribute.
getCorrelationType(), attribute.
getCorrelationValue()), ex);
1242 return Pair.of(count, description);
1259 String parentName = srcContent.getName();
1262 while ((parent = parent.getParent()) != null) {
1263 parentName = parent.getName();
1265 }
catch (TskCoreException ex) {
1266 logger.log(Level.SEVERE, MessageFormat.format(
"Error getting root ancestor name for source content (artifact objID={0})", artifact.getId()), ex);
1279 if (customProperties == null) {
1280 customProperties =
new ArrayList<>();
1282 customProperties.add(property);
1293 @SuppressWarnings(
"deprecation")
1296 for (BlackboardAttribute attribute : artifact.getAttributes()) {
1297 final int attributeTypeID = attribute.getAttributeType().getTypeID();
1298 if (attributeTypeID == ATTRIBUTE_TYPE.TSK_PATH_ID.getTypeID()
1299 || attributeTypeID == ATTRIBUTE_TYPE.TSK_TAGGED_ARTIFACT.getTypeID()
1300 || attributeTypeID == ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT.getTypeID()
1301 || attributeTypeID == ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID()
1302 || attributeTypeID == ATTRIBUTE_TYPE.TSK_KEYWORD_SEARCH_TYPE.getTypeID()
1303 || attribute.getValueType() == BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.JSON) {
1307 }
else if (artifact.getArtifactTypeID() == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID()) {
1309 }
else if (attribute.getAttributeType().getValueType() == BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME) {
1311 }
else if (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_TOOL_OUTPUT.getTypeID()
1312 && attributeTypeID == ATTRIBUTE_TYPE.TSK_TEXT.getTypeID()) {
1321 String value = attribute.getDisplayString();
1322 if (value.length() > 512) {
1323 value = value.substring(0, 512);
1325 map.put(attribute.getAttributeType().getDisplayName(), value);
1327 switch (attribute.getAttributeType().getValueType()) {
1329 map.put(attribute.getAttributeType().getDisplayName(), attribute.getValueInt());
1332 map.put(attribute.getAttributeType().getDisplayName(), attribute.getValueDouble());
1335 map.put(attribute.getAttributeType().getDisplayName(), attribute.getValueLong());
1338 map.put(attribute.getAttributeType().getDisplayName(), attribute.getDisplayString());
1344 }
catch (TskCoreException ex) {
1345 logger.log(Level.SEVERE, MessageFormat.format(
"Error getting artifact attributes (artifact objID={0})", artifact.getId()), ex);
1359 final int attributeTypeID = attribute.getAttributeType().getTypeID();
1360 if (attributeTypeID == ATTRIBUTE_TYPE.TSK_DATETIME_SENT.getTypeID()
1361 || attributeTypeID == ATTRIBUTE_TYPE.TSK_EMAIL_CONTENT_HTML.getTypeID()
1362 || attributeTypeID == ATTRIBUTE_TYPE.TSK_EMAIL_CONTENT_RTF.getTypeID()
1363 || attributeTypeID == ATTRIBUTE_TYPE.TSK_EMAIL_BCC.getTypeID()
1364 || attributeTypeID == ATTRIBUTE_TYPE.TSK_EMAIL_CC.getTypeID()
1365 || attributeTypeID == ATTRIBUTE_TYPE.TSK_HEADERS.getTypeID()) {
1369 }
else if (attributeTypeID == ATTRIBUTE_TYPE.TSK_EMAIL_CONTENT_PLAIN.getTypeID()) {
1370 String value = attribute.getDisplayString();
1371 if (value.length() > 160) {
1372 value = value.substring(0, 160) +
"...";
1374 map.put(attribute.getAttributeType().getDisplayName(), value);
1375 }
else if (attribute.getAttributeType().getValueType() == BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME) {
1378 map.put(attribute.getAttributeType().getDisplayName(), attribute.getDisplayString());
1384 return visitor.
visit(
this);
1394 return getClass().getName();
1398 public <T> T accept(ContentNodeVisitor<T> visitor) {
1399 return visitor.visit(
this);
1403 "BlackboardArtifactNode_analysisSheet_sourceType_name=Source Type",
1404 "BlackboardArtifactNode_analysisSheet_soureName_name=Source Name",
1405 "BlackboardArtifactNode_analysisSheet_score_name=Score",
1406 "BlackboardArtifactNode_analysisSheet_conclusion_name=Conclusion",
1407 "BlackboardArtifactNode_analysisSheet_configuration_name=Configuration",
1408 "BlackboardArtifactNode_analysisSheet_justifaction_name=Justification"
1419 Bundle.BlackboardArtifactNode_analysisSheet_soureName_name(),
1420 Bundle.BlackboardArtifactNode_analysisSheet_soureName_name(),
1427 Bundle.BlackboardArtifactNode_analysisSheet_sourceType_name(),
1428 Bundle.BlackboardArtifactNode_analysisSheet_sourceType_name(),
1433 Bundle.BlackboardArtifactNode_analysisSheet_score_name(),
1434 Bundle.BlackboardArtifactNode_analysisSheet_score_name(),
1436 result.getScore().getSignificance().getDisplayName()));
1439 Bundle.BlackboardArtifactNode_analysisSheet_conclusion_name(),
1440 Bundle.BlackboardArtifactNode_analysisSheet_conclusion_name(),
1442 result.getConclusion()));
1445 Bundle.BlackboardArtifactNode_analysisSheet_configuration_name(),
1446 Bundle.BlackboardArtifactNode_analysisSheet_configuration_name(),
1448 result.getConfiguration()));
1451 Bundle.BlackboardArtifactNode_analysisSheet_justifaction_name(),
1452 Bundle.BlackboardArtifactNode_analysisSheet_justifaction_name(),
1454 result.getJustification()));
1469 Bundle.BlackboardArtifactNode_createSheet_score_name(),
1470 Bundle.BlackboardArtifactNode_createSheet_score_displayName(),
1474 Bundle.BlackboardArtifactNode_createSheet_comment_name(),
1475 Bundle.BlackboardArtifactNode_createSheet_comment_displayName(),
1480 Bundle.BlackboardArtifactNode_createSheet_count_name(),
1481 Bundle.BlackboardArtifactNode_createSheet_count_displayName(),
1485 return new GetSCOTask(
new WeakReference<>(
this), weakListener);
1501 if (source instanceof BlackboardArtifact) {
1502 BlackboardArtifact srcArtifact = (BlackboardArtifact) source;
1504 return srcArtifact.getType().getDisplayName();
1505 }
catch (TskCoreException ex) {
1506 logger.log(Level.SEVERE,
"Failed to get custom artifact type id=" + source.getId(), ex);
1508 }
else if (srcContent instanceof Volume) {
1509 return TskData.ObjectType.VOL.toString();
1510 }
else if (srcContent instanceof AbstractFile) {
1511 return TskData.ObjectType.ABSTRACTFILE.toString();
1512 }
else if (srcContent instanceof Image) {
1513 return TskData.ObjectType.IMG.toString();
1514 }
else if (srcContent instanceof VolumeSystem) {
1515 return TskData.ObjectType.VS.toString();
1516 }
else if (srcContent instanceof OsAccount) {
1517 return TskData.ObjectType.OS_ACCOUNT.toString();
1518 }
else if (srcContent instanceof HostAddress) {
1519 return TskData.ObjectType.HOST_ADDRESS.toString();
1520 }
else if (srcContent instanceof Pool) {
1521 return TskData.ObjectType.POOL.toString();
1534 SwingUtilities.invokeLater(
new Runnable() {
1537 if (scoData.getScoreAndDescription() != null) {
1539 Bundle.BlackboardArtifactNode_createSheet_score_name(),
1540 Bundle.BlackboardArtifactNode_createSheet_score_displayName(),
1541 scoData.getScoreAndDescription().getRight(),
1542 scoData.getScoreAndDescription().getLeft()));
1544 if (scoData.getComment() != null) {
1546 Bundle.BlackboardArtifactNode_createSheet_comment_name(),
1547 Bundle.BlackboardArtifactNode_createSheet_comment_displayName(),
1550 if (scoData.getCountAndDescription() != null) {
1552 Bundle.BlackboardArtifactNode_createSheet_count_name(),
1553 Bundle.BlackboardArtifactNode_createSheet_count_displayName(),
1554 scoData.getCountAndDescription().getRight(),
1555 scoData.getCountAndDescription().getLeft()));
1565 if(srcContent instanceof BlackboardArtifact) {
1567 setDisplayName(((BlackboardArtifact)srcContent).getShortDescription());
1568 }
catch (TskCoreException ex) {
1571 logger.log(Level.WARNING,
"Failed to get short description for artifact id = " + srcContent.getId(), ex);
1572 setDisplayName(srcContent.getName());
1574 }
else if(srcContent instanceof OsAccount) {
1575 setDisplayName(((OsAccount)srcContent).getAddr().orElse(srcContent.getName()));
1577 setDisplayName(srcContent.getName());
1580 setShortDescription(getDisplayName());
1595 @NbBundle.Messages({
"BlackboardArtifactNode.createSheet.score.name=S",
1596 "BlackboardArtifactNode.createSheet.score.displayName=S",
1597 "BlackboardArtifactNode.createSheet.notableFile.description=Associated file recognized as notable.",
1598 "BlackboardArtifactNode.createSheet.interestingResult.description=Result has an interesting result associated with it.",
1599 "BlackboardArtifactNode.createSheet.taggedItem.description=Result or associated file has been tagged.",
1600 "BlackboardArtifactNode.createSheet.notableTaggedItem.description=Result or associated file tagged with notable tag.",
1601 "BlackboardArtifactNode.createSheet.noScore.description=No score"})
1605 sheetSet.put(
new NodeProperty<>(Bundle.BlackboardArtifactNode_createSheet_score_name(), Bundle.BlackboardArtifactNode_createSheet_score_displayName(), scoreAndDescription.getRight(), scoreAndDescription.getLeft()));
1617 @NbBundle.Messages({
1618 "BlackboardArtifactNode.createSheet.tags.displayName=Tags"}
1622 List<Tag> tags =
new ArrayList<>();
1627 logger.log(Level.SEVERE, MessageFormat.format(
"Error getting tags for artifact and source content (artifact objID={0})", artifact.getId()), ex);
1629 sheetSet.put(
new NodeProperty<>(
"Tags", Bundle.BlackboardArtifactNode_createSheet_tags_displayName(),
NO_DESCR, tags.stream().map(t -> t.getName().getDisplayName()).collect(Collectors.joining(
", "))));
1645 sheetSet.put(
new NodeProperty<>(
"Tags", Bundle.BlackboardArtifactNode_createSheet_tags_displayName(),
NO_DESCR, tags.stream().map(t -> t.getName().getDisplayName()).collect(Collectors.joining(
", "))));
1660 @NbBundle.Messages({
"BlackboardArtifactNode.createSheet.count.name=O",
1661 "BlackboardArtifactNode.createSheet.count.displayName=O",
1662 "BlackboardArtifactNode.createSheet.count.noCorrelationAttributes.description=No correlation properties found",
1663 "BlackboardArtifactNode.createSheet.count.noCorrelationValues.description=Unable to find other occurrences because no value exists for the available correlation property",
1664 "# {0} - occurrenceCount",
1665 "# {1} - attributeType",
1666 "BlackboardArtifactNode.createSheet.count.description=There were {0} datasource(s) found with occurrences of the correlation value of type {1}"})
1669 Pair<Long, String> countAndDescription =
getCountPropertyAndDescription(attribute, Bundle.BlackboardArtifactNode_createSheet_count_noCorrelationAttributes_description());
1670 sheetSet.put(
new NodeProperty<>(Bundle.BlackboardArtifactNode_createSheet_count_name(), Bundle.BlackboardArtifactNode_createSheet_count_displayName(), countAndDescription.getRight(), countAndDescription.getLeft()));
1687 @NbBundle.Messages({
"BlackboardArtifactNode.createSheet.comment.name=C",
1688 "BlackboardArtifactNode.createSheet.comment.displayName=C"})
1691 List<CorrelationAttributeInstance> attributes =
new ArrayList<>();
1692 attributes.add(attribute);
1694 sheetSet.put(
new NodeProperty<>(Bundle.BlackboardArtifactNode_createSheet_comment_name(), Bundle.BlackboardArtifactNode_createSheet_comment_displayName(),
NO_DESCR, status));
static final String VALUE_LOADING
static BlackboardArtifact.Type getType(BlackboardArtifact artifact)
final void addTagProperty(Sheet.Set sheetSet, List< Tag > tags)
void addTagProperty(Sheet.Set sheetSet)
void fillPropertyMap(Map< String, Object > map, BlackboardArtifact artifact)
List< Action > getAssociatedFileActions(BlackboardArtifact artifact, BlackboardArtifact.Type artifactType)
static List< String > getArchiveExtensions()
List< Action > getTagActions(boolean hasSrcFile, BlackboardArtifact artifact, int selectedFileCount, int selectedArtifactCount)
static boolean hasSupportedTimeStamp(BlackboardArtifact artifact)
void setName(String name)
final String sourceObjTypeName
static List< Action > getActions(File file, boolean isArtifactSource)
Action getViewSrcContentAction(BlackboardArtifact artifact, Content content)
List< Action > getNonNull(Action...items)
static String getPropertyName()
static synchronized AddBlackboardArtifactTagAction getInstance()
static String getFormattedTime(long epochTime)
static synchronized DeleteFileBlackboardArtifactTagAction getInstance()
void setDisplayNameBySourceContent()
BlackboardArtifactNode(BlackboardArtifact artifact, String iconPath)
final PropertyChangeListener weakListener
String getSourceObjType(Content source)
static final Integer[] SHOW_FILE_METADATA
static final Cache< Long, Content > contentCache
volatile String translatedSourceName
void updateSCOColumns(final SCOData scoData)
String getCorrelationValue()
static synchronized ExportCSVAction getInstance()
Action[] getActions(boolean context)
Type getCorrelationType()
void addNodeProperty(NodeProperty<?> property)
static synchronized DeleteFileContentTagAction getInstance()
static final Set< Case.Events > CASE_EVENTS_OF_INTEREST
final void addScorePropertyAndDescription(Sheet.Set sheetSet, List< Tag > tags)
TagsManager getTagsManager()
Action getTimelineArtifactAction(BlackboardArtifact art)
static TextTranslationService getInstance()
GetSCOTask updateSheetForAnalysisResult(AnalysisResult result, Sheet.Set sheetSet)
static boolean displayTranslatedFileNames()
BlackboardArtifactNode(BlackboardArtifact artifact, boolean useAssociatedFileInLookup)
static Content getPathIdFile(BlackboardArtifact artifact)
List< NodeProperty<?extends Object > > customProperties
final List< Tag > getAllTagsFromDatabase()
static Lookup createLookup(BlackboardArtifact artifact, boolean useAssociatedFile)
final BlackboardArtifact artifact
void addEmailMsgProperty(Map< String, Object > map, BlackboardAttribute attribute)
static String getIconFilePath(int typeID)
static boolean getHideSCOColumns()
final void addCommentProperty(Sheet.Set sheetSet, List< Tag > tags, CorrelationAttributeInstance attribute)
Pair< Score, String > getScorePropertyAndDescription(List< Tag > tags)
SleuthkitCase getSleuthkitCase()
Pair< Long, String > getCountPropertyAndDescription(CorrelationAttributeInstance attribute, String defaultDescription)
T visit(DataSourceFilesNode in)
String getContentTypeStr(Content content)
DataResultViewerTable.HasCommentStatus getCommentProperty(List< Tag > tags, List< CorrelationAttributeInstance > attributes)
synchronized boolean hasProvider()
final void addCountProperty(Sheet.Set sheetSet, CorrelationAttributeInstance attribute)
Long getCountCasesWithOtherInstances(CorrelationAttributeInstance instance)
List< Action > getSrcContentViewerActions(Node srcFileNode, int selectedFileCount)
BLACKBOARD_ARTIFACT_TAG_ADDED
static final Logger logger
Action getExtractWithPasswordAction(Content srcContent)
BlackboardArtifact getArtifact()
static synchronized ExternalViewerShortcutAction getInstance()
final BlackboardArtifact.Type artifactType
synchronized static Logger getLogger(String name)
GetSCOTask addSCOColumns(Sheet.Set sheetSet)
String getRootAncestorName()
static Case getCurrentCaseThrows()
Content getSourceContentFromLookup(BlackboardArtifact artifact)
Node getParentFileNode(Content content)
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
final PropertyChangeListener listener
static void removeEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
Action getTimelineSrcContentAction(Content srcContent)
static CentralRepository getInstance()
String getAssociatedTypeStr(BlackboardArtifact.Type artifactType)
BlackboardArtifactNode(BlackboardArtifact artifact)
static synchronized AddContentTagAction getInstance()
BLACKBOARD_ARTIFACT_TAG_DELETED
void unregisterListener()
static boolean isEnabled()
static final String NO_DESCR