19 package org.sleuthkit.autopsy.centralrepository.datamodel;
21 import java.util.ArrayList;
22 import java.util.List;
23 import java.util.logging.Level;
24 import org.openide.util.Exceptions;
25 import org.openide.util.NbBundle.Messages;
47 @Messages({
"EamArtifactUtil.emailaddresses.text=Email Addresses"})
49 return Bundle.EamArtifactUtil_emailaddresses_text();
65 boolean addInstanceDetails,
boolean checkEnabled) {
67 List<CorrelationAttribute> eamArtifacts =
new ArrayList<>();
76 if ((checkEnabled && aType.isEnabled()) || !checkEnabled) {
78 if (eamArtifact != null) {
79 eamArtifacts.add(eamArtifact);
84 LOGGER.log(Level.SEVERE,
"Error getting defined correlation types.", ex);
89 if (!eamArtifacts.isEmpty() && addInstanceDetails) {
92 AbstractFile bbSourceFile = currentCase.
getSleuthkitCase().getAbstractFileById(bbArtifact.getObjectID());
93 if (null == bbSourceFile) {
102 bbSourceFile.getParentPath() + bbSourceFile.
getName(),
104 TskData.FileKnown.UNKNOWN,
110 eamArtifact.addInstance(eamInstance);
113 LOGGER.log(Level.SEVERE,
"Error creating artifact instance.", ex);
115 }
catch (IllegalStateException ex) {
116 LOGGER.log(Level.SEVERE,
"Case is closed.", ex);
136 int artifactTypeID = bbArtifact.getArtifactTypeID();
139 if(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID() == artifactTypeID){
141 BlackboardAttribute attribute = bbArtifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT));
142 if (attribute != null) {
148 && BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() == artifactTypeID) {
150 BlackboardAttribute setNameAttr = bbArtifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME));
151 if (setNameAttr != null
153 value = bbArtifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD)).getValueString();
156 && (BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK.getTypeID() == artifactTypeID
157 || BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_COOKIE.getTypeID() == artifactTypeID
158 || BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_DOWNLOAD.getTypeID() == artifactTypeID
159 || BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_HISTORY.getTypeID() == artifactTypeID)) {
162 value = bbArtifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DOMAIN)).getValueString();
164 && (BlackboardArtifact.ARTIFACT_TYPE.TSK_CONTACT.getTypeID() == artifactTypeID
165 || BlackboardArtifact.ARTIFACT_TYPE.TSK_CALLLOG.getTypeID() == artifactTypeID
166 || BlackboardArtifact.ARTIFACT_TYPE.TSK_MESSAGE.getTypeID() == artifactTypeID)) {
168 if (null != bbArtifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER))) {
169 value = bbArtifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER)).getValueString();
170 }
else if (null != bbArtifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_FROM))) {
171 value = bbArtifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_FROM)).getValueString();
172 }
else if (null != bbArtifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO))) {
173 value = bbArtifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO)).getValueString();
178 String newValue = value.replaceAll(
"\\D",
"");
179 if (value.startsWith(
"+")) {
180 newValue =
"+" + newValue;
187 if(value.length() <= 5){
193 && BlackboardArtifact.ARTIFACT_TYPE.TSK_DEVICE_ATTACHED.getTypeID() == artifactTypeID) {
195 value = bbArtifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DEVICE_ID)).getValueString();
198 }
catch (TskCoreException ex) {
199 LOGGER.log(Level.SEVERE,
"Error getting attribute while getting type from BlackboardArtifact.", ex);
226 if(! (content instanceof AbstractFile)){
230 final AbstractFile af = (AbstractFile) content;
232 if ((af.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)
233 || (af.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS)
234 || (af.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.SLACK)
235 || (af.getKnown() == TskData.FileKnown.KNOWN)
236 || (af.isDir() ==
true)
237 || (!af.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.ALLOC))) {
242 String md5 = af.getMd5Hash();
243 if (md5 == null || md5.isEmpty()) {
254 af.getParentPath() + af.
getName(),
256 TskData.FileKnown.BAD,
262 LOGGER.log(Level.SEVERE,
"Error making correlation attribute.", ex);
CorrelationAttribute.Type getCorrelationTypeById(int typeId)
static final long serialVersionUID
static CorrelationAttribute getCorrelationAttributeFromBlackboardArtifact(CorrelationAttribute.Type correlationType, BlackboardArtifact bbArtifact)
static final int PHONE_TYPE_ID
static final int FILES_TYPE_ID
static String getEmailAddressAttrString()
static final int EMAIL_TYPE_ID
void addInstance(CorrelationAttributeInstance artifactInstance)
static EamDb getInstance()
static CorrelationAttribute getEamArtifactFromContent(Content content, TskData.FileKnown knownStatus, String comment)
SleuthkitCase getSleuthkitCase()
static final Logger LOGGER
static CorrelationDataSource fromTSKDataSource(Content dataSource)
static final int DOMAIN_TYPE_ID
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
List< CorrelationAttribute.Type > getDefinedCorrelationTypes()
static final int USBID_TYPE_ID
static List< CorrelationAttribute > getCorrelationAttributeFromBlackboardArtifact(BlackboardArtifact bbArtifact, boolean addInstanceDetails, boolean checkEnabled)