mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
7673 Allow helpers to call correct Blackboard.postArtifacts() API
This commit is contained in:
parent
986d0fa0f8
commit
581d5fd4bc
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2015-2019 Basis Technology Corp.
|
* Copyright 2015-2021 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -56,7 +56,7 @@ public final class Blackboard implements Closeable {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public synchronized void indexArtifact(BlackboardArtifact artifact) throws BlackboardException {
|
public synchronized void indexArtifact(BlackboardArtifact artifact) throws BlackboardException {
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCase().getSleuthkitCase().getBlackboard().postArtifact(artifact, "");
|
Case.getCurrentCase().getSleuthkitCase().getBlackboard().postArtifact(artifact, "", null);
|
||||||
} catch (org.sleuthkit.datamodel.Blackboard.BlackboardException ex) {
|
} catch (org.sleuthkit.datamodel.Blackboard.BlackboardException ex) {
|
||||||
throw new BlackboardException(ex.getMessage(), ex);
|
throw new BlackboardException(ex.getMessage(), ex);
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ import org.sleuthkit.datamodel.SleuthkitCase;
|
|||||||
*/
|
*/
|
||||||
public final class IngestServices {
|
public final class IngestServices {
|
||||||
|
|
||||||
private static Logger logger = Logger.getLogger(IngestServices.class.getName());
|
private final static Logger logger = Logger.getLogger(IngestServices.class.getName());
|
||||||
private static IngestServices instance = null;
|
private static IngestServices instance = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -115,7 +115,7 @@ public final class IngestServices {
|
|||||||
public void fireModuleDataEvent(ModuleDataEvent moduleDataEvent) {
|
public void fireModuleDataEvent(ModuleDataEvent moduleDataEvent) {
|
||||||
try {
|
try {
|
||||||
Blackboard blackboard = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard();
|
Blackboard blackboard = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard();
|
||||||
blackboard.postArtifacts(moduleDataEvent.getArtifacts(), moduleDataEvent.getModuleName());
|
blackboard.postArtifacts(moduleDataEvent.getArtifacts(), moduleDataEvent.getModuleName(), null);
|
||||||
} catch (NoCurrentCaseException | Blackboard.BlackboardException ex) {
|
} catch (NoCurrentCaseException | Blackboard.BlackboardException ex) {
|
||||||
logger.log(Level.SEVERE, "Failed to post artifacts", ex);
|
logger.log(Level.SEVERE, "Failed to post artifacts", ex);
|
||||||
}
|
}
|
||||||
|
@ -333,7 +333,7 @@ public class ILeappAnalyzerIngestModule implements DataSourceIngestModule {
|
|||||||
* added to reports
|
* added to reports
|
||||||
*/
|
*/
|
||||||
private void addILeappReportToReports(Path iLeappOutputDir, Case currentCase) {
|
private void addILeappReportToReports(Path iLeappOutputDir, Case currentCase) {
|
||||||
List<String> allIndexFiles = new ArrayList<>();
|
List<String> allIndexFiles;
|
||||||
|
|
||||||
try (Stream<Path> walk = Files.walk(iLeappOutputDir)) {
|
try (Stream<Path> walk = Files.walk(iLeappOutputDir)) {
|
||||||
|
|
||||||
@ -402,7 +402,7 @@ public class ILeappAnalyzerIngestModule implements DataSourceIngestModule {
|
|||||||
String fileName = FilenameUtils.getName(ffp);
|
String fileName = FilenameUtils.getName(ffp);
|
||||||
String filePath = FilenameUtils.getPath(ffp);
|
String filePath = FilenameUtils.getPath(ffp);
|
||||||
|
|
||||||
List<AbstractFile> iLeappFiles = new ArrayList<>();
|
List<AbstractFile> iLeappFiles;
|
||||||
try {
|
try {
|
||||||
if (filePath.isEmpty()) {
|
if (filePath.isEmpty()) {
|
||||||
iLeappFiles = fileManager.findFiles(dataSource, fileName); //NON-NLS
|
iLeappFiles = fileManager.findFiles(dataSource, fileName); //NON-NLS
|
||||||
|
@ -194,7 +194,7 @@ public final class LeappFileProcessor {
|
|||||||
.put("call history.tsv", "calllog")
|
.put("call history.tsv", "calllog")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Blackboard blkBoard;
|
private final Blackboard blkBoard;
|
||||||
|
|
||||||
public LeappFileProcessor(String xmlFile, String moduleName, IngestJobContext context) throws IOException, IngestModuleException, NoCurrentCaseException {
|
public LeappFileProcessor(String xmlFile, String moduleName, IngestJobContext context) throws IOException, IngestModuleException, NoCurrentCaseException {
|
||||||
this.tsvFiles = new HashMap<>();
|
this.tsvFiles = new HashMap<>();
|
||||||
@ -351,10 +351,10 @@ public final class LeappFileProcessor {
|
|||||||
AbstractFile geoAbstractFile = null;
|
AbstractFile geoAbstractFile = null;
|
||||||
|
|
||||||
if (LeappFile == null || !LeappFile.exists() || fileName == null) {
|
if (LeappFile == null || !LeappFile.exists() || fileName == null) {
|
||||||
logger.log(Level.WARNING, String.format("Leap file: %s is null or does not exist", LeappFile == null ? LeappFile.toString() : "<null>"));
|
logger.log(Level.WARNING, String.format("Leap file: %s is null or does not exist", LeappFile != null ? LeappFile.toString() : "<null>"));
|
||||||
return;
|
return;
|
||||||
} else if (attrList == null || artifactType == null || dataSource == null) {
|
} else if (attrList == null || artifactType == null || dataSource == null) {
|
||||||
logger.log(Level.WARNING, String.format("attribute list, artifact type or dataSource not provided for %s", LeappFile == null ? LeappFile.toString() : "<null>"));
|
logger.log(Level.WARNING, String.format("attribute list, artifact type or dataSource not provided for %s", LeappFile.toString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,7 +435,7 @@ public final class LeappFileProcessor {
|
|||||||
Long dateTime = Long.valueOf(0);
|
Long dateTime = Long.valueOf(0);
|
||||||
Collection<BlackboardAttribute> otherAttributes = new ArrayList<>();
|
Collection<BlackboardAttribute> otherAttributes = new ArrayList<>();
|
||||||
String sourceFile = null;
|
String sourceFile = null;
|
||||||
AbstractFile absFile = null;
|
AbstractFile absFile;
|
||||||
String comment = "";
|
String comment = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -538,13 +538,10 @@ public final class LeappFileProcessor {
|
|||||||
if (absFile == null) {
|
if (absFile == null) {
|
||||||
absFile = (AbstractFile) dataSource;
|
absFile = (AbstractFile) dataSource;
|
||||||
}
|
}
|
||||||
if ((trackpointSegmentName == null) || (trackpointSegmentName == segmentName)) {
|
if ((trackpointSegmentName == null) || (trackpointSegmentName.equals(segmentName))) {
|
||||||
trackpointSegmentName = segmentName;
|
|
||||||
pointList.addPoint(new TrackPoint(latitude, longitude, altitude, segmentName, zeroValue, zeroValue, zeroValue, dateTime));
|
pointList.addPoint(new TrackPoint(latitude, longitude, altitude, segmentName, zeroValue, zeroValue, zeroValue, dateTime));
|
||||||
} else {
|
} else {
|
||||||
(new GeoArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), moduleName, comment, absFile, context.getJobId())).addTrack(segmentName, pointList, new ArrayList<>());
|
(new GeoArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(), moduleName, comment, absFile, context.getJobId())).addTrack(segmentName, pointList, new ArrayList<>());
|
||||||
trackpointSegmentName = segmentName;
|
|
||||||
pointList = new GeoTrackPoints();
|
|
||||||
pointList.addPoint(new TrackPoint(latitude, longitude, altitude, segmentName, zeroValue, zeroValue, zeroValue, dateTime));
|
pointList.addPoint(new TrackPoint(latitude, longitude, altitude, segmentName, zeroValue, zeroValue, zeroValue, dateTime));
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -575,7 +572,7 @@ public final class LeappFileProcessor {
|
|||||||
List<BlackboardAttribute> otherAttributes = new ArrayList<>();
|
List<BlackboardAttribute> otherAttributes = new ArrayList<>();
|
||||||
List<FileAttachment> fileAttachments = new ArrayList<>();
|
List<FileAttachment> fileAttachments = new ArrayList<>();
|
||||||
String sourceFile = null;
|
String sourceFile = null;
|
||||||
MessageAttachments messageAttachments = null;
|
MessageAttachments messageAttachments;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (BlackboardAttribute bba : bbattributes) {
|
for (BlackboardAttribute bba : bbattributes) {
|
||||||
@ -637,22 +634,23 @@ public final class LeappFileProcessor {
|
|||||||
if (absFile == null) {
|
if (absFile == null) {
|
||||||
absFile = (AbstractFile) dataSource;
|
absFile = (AbstractFile) dataSource;
|
||||||
}
|
}
|
||||||
CommunicationArtifactsHelper accountArtifact;
|
CommunicationArtifactsHelper accountHelper;
|
||||||
Account.Type accountType = getAccountType(fileName);
|
Account.Type accountType = getAccountType(fileName);
|
||||||
if (alternateId == null) {
|
if (alternateId == null) {
|
||||||
accountArtifact = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(),
|
accountHelper = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(),
|
||||||
moduleName, absFile, accountType, context.getJobId());
|
moduleName, absFile, accountType, context.getJobId());
|
||||||
} else {
|
} else {
|
||||||
accountArtifact = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(),
|
accountHelper = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(),
|
||||||
moduleName, absFile, accountType, accountType, alternateId, context.getJobId());
|
moduleName, absFile, accountType, accountType, alternateId, context.getJobId());
|
||||||
}
|
}
|
||||||
BlackboardArtifact messageArtifact = accountArtifact.addMessage(messageType, communicationDirection, senderId,
|
BlackboardArtifact messageArtifact = accountHelper.addMessage(messageType, communicationDirection, senderId,
|
||||||
receipentId, dateTime, messageStatus, subject,
|
receipentId, dateTime, messageStatus, subject,
|
||||||
messageText, threadId, otherAttributes);
|
messageText, threadId, otherAttributes);
|
||||||
if (!fileAttachments.isEmpty()) {
|
if (!fileAttachments.isEmpty()) {
|
||||||
messageAttachments = new MessageAttachments(fileAttachments, new ArrayList<>());
|
messageAttachments = new MessageAttachments(fileAttachments, new ArrayList<>());
|
||||||
accountArtifact.addAttachments(messageArtifact, messageAttachments);
|
accountHelper.addAttachments(messageArtifact, messageAttachments);
|
||||||
}
|
}
|
||||||
|
blkBoard.postArtifact(messageArtifact, moduleName, context.getJobId());
|
||||||
} catch (NoCurrentCaseException | TskCoreException | BlackboardException ex) {
|
} catch (NoCurrentCaseException | TskCoreException | BlackboardException ex) {
|
||||||
throw new IngestModuleException(Bundle.LeappFileProcessor_cannot_create_message_relationship() + ex.getLocalizedMessage(), ex); //NON-NLS
|
throw new IngestModuleException(Bundle.LeappFileProcessor_cannot_create_message_relationship() + ex.getLocalizedMessage(), ex); //NON-NLS
|
||||||
}
|
}
|
||||||
@ -714,15 +712,15 @@ public final class LeappFileProcessor {
|
|||||||
Account.Type accountType = getAccountType(fileName);
|
Account.Type accountType = getAccountType(fileName);
|
||||||
if (accountType != null) {
|
if (accountType != null) {
|
||||||
|
|
||||||
CommunicationArtifactsHelper accountArtifact;
|
CommunicationArtifactsHelper accountHelper;
|
||||||
if (alternateId == null) {
|
if (alternateId == null) {
|
||||||
accountArtifact = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(),
|
accountHelper = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(),
|
||||||
moduleName, absFile, accountType, context.getJobId());
|
moduleName, absFile, accountType, context.getJobId());
|
||||||
} else {
|
} else {
|
||||||
accountArtifact = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(),
|
accountHelper = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(),
|
||||||
moduleName, absFile, accountType, accountType, alternateId, context.getJobId());
|
moduleName, absFile, accountType, accountType, alternateId, context.getJobId());
|
||||||
}
|
}
|
||||||
BlackboardArtifact messageArtifact = accountArtifact.addContact(contactName, phoneNumber, homePhoneNumber, mobilePhoneNumber, emailAddr, otherAttributes);
|
BlackboardArtifact messageArtifact = accountHelper.addContact(contactName, phoneNumber, homePhoneNumber, mobilePhoneNumber, emailAddr, otherAttributes);
|
||||||
}
|
}
|
||||||
} catch (NoCurrentCaseException | TskCoreException | BlackboardException ex) {
|
} catch (NoCurrentCaseException | TskCoreException | BlackboardException ex) {
|
||||||
throw new IngestModuleException(Bundle.LeappFileProcessor_cannot_create_contact_relationship() + ex.getLocalizedMessage(), ex); //NON-NLS
|
throw new IngestModuleException(Bundle.LeappFileProcessor_cannot_create_contact_relationship() + ex.getLocalizedMessage(), ex); //NON-NLS
|
||||||
@ -784,7 +782,7 @@ public final class LeappFileProcessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (calleeId.isEmpty() && communicationDirection == CommunicationDirection.OUTGOING) {
|
if (calleeId.isEmpty() && communicationDirection == CommunicationDirection.OUTGOING && callerId != null) {
|
||||||
String[] calleeTempList = callerId.split(",", 0);
|
String[] calleeTempList = callerId.split(",", 0);
|
||||||
calleeId = Arrays.asList(calleeTempList);
|
calleeId = Arrays.asList(calleeTempList);
|
||||||
callerId = null;
|
callerId = null;
|
||||||
@ -794,15 +792,15 @@ public final class LeappFileProcessor {
|
|||||||
absFile = (AbstractFile) dataSource;
|
absFile = (AbstractFile) dataSource;
|
||||||
}
|
}
|
||||||
Account.Type accountType = getAccountType(fileName);
|
Account.Type accountType = getAccountType(fileName);
|
||||||
CommunicationArtifactsHelper accountArtifact;
|
CommunicationArtifactsHelper accountHelper;
|
||||||
if (accountType != null) {
|
if (accountType != null) {
|
||||||
accountArtifact = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(),
|
accountHelper = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(),
|
||||||
moduleName, absFile, accountType, context.getJobId());
|
moduleName, absFile, accountType, context.getJobId());
|
||||||
} else {
|
} else {
|
||||||
accountArtifact = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(),
|
accountHelper = new CommunicationArtifactsHelper(Case.getCurrentCaseThrows().getSleuthkitCase(),
|
||||||
moduleName, absFile, accountType, accountType, alternateId, context.getJobId());
|
moduleName, absFile, accountType, accountType, alternateId, context.getJobId());
|
||||||
}
|
}
|
||||||
BlackboardArtifact callLogArtifact = accountArtifact.addCalllog(communicationDirection, callerId, calleeId, startDateTime, endDateTime, mediaType, otherAttributes);
|
accountHelper.addCalllog(communicationDirection, callerId, calleeId, startDateTime, endDateTime, mediaType, otherAttributes);
|
||||||
} catch (NoCurrentCaseException | TskCoreException | BlackboardException ex) {
|
} catch (NoCurrentCaseException | TskCoreException | BlackboardException ex) {
|
||||||
throw new IngestModuleException(Bundle.LeappFileProcessor_cannot_create_calllog_relationship() + ex.getLocalizedMessage(), ex); //NON-NLS
|
throw new IngestModuleException(Bundle.LeappFileProcessor_cannot_create_calllog_relationship() + ex.getLocalizedMessage(), ex); //NON-NLS
|
||||||
}
|
}
|
||||||
@ -929,7 +927,7 @@ public final class LeappFileProcessor {
|
|||||||
|
|
||||||
String formattedValue = formatValueBasedOnAttrType(colAttr, value);
|
String formattedValue = formatValueBasedOnAttrType(colAttr, value);
|
||||||
|
|
||||||
BlackboardAttribute attr = (value == null) ? null : getAttribute(colAttr.getAttributeType(), formattedValue, fileName);
|
BlackboardAttribute attr = getAttribute(colAttr.getAttributeType(), formattedValue, fileName);
|
||||||
if (attr == null) {
|
if (attr == null) {
|
||||||
logger.log(Level.WARNING, String.format("Blackboard attribute could not be parsed column %s at line %d in file %s. Omitting row.", colAttr.getColumnName(), lineNum, fileName));
|
logger.log(Level.WARNING, String.format("Blackboard attribute could not be parsed column %s at line %d in file %s. Omitting row.", colAttr.getColumnName(), lineNum, fileName));
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
@ -999,7 +997,7 @@ public final class LeappFileProcessor {
|
|||||||
(v) -> new BlackboardAttribute(attrType, moduleName, Double.valueOf(v).longValue()));
|
(v) -> new BlackboardAttribute(attrType, moduleName, Double.valueOf(v).longValue()));
|
||||||
case DOUBLE:
|
case DOUBLE:
|
||||||
return parseAttrValue(value.trim(), attrType, fileName, true, false,
|
return parseAttrValue(value.trim(), attrType, fileName, true, false,
|
||||||
(v) -> new BlackboardAttribute(attrType, moduleName, (double) Double.valueOf(v)));
|
(v) -> new BlackboardAttribute(attrType, moduleName, Double.valueOf(v)));
|
||||||
case BYTE:
|
case BYTE:
|
||||||
return parseAttrValue(value.trim(), attrType, fileName, true, false,
|
return parseAttrValue(value.trim(), attrType, fileName, true, false,
|
||||||
(v) -> new BlackboardAttribute(attrType, moduleName, new byte[]{Byte.valueOf(v)}));
|
(v) -> new BlackboardAttribute(attrType, moduleName, new byte[]{Byte.valueOf(v)}));
|
||||||
@ -1050,20 +1048,20 @@ public final class LeappFileProcessor {
|
|||||||
private BlackboardAttribute parseAttrValue(String value, BlackboardAttribute.Type attrType, String fileName, boolean blankIsNull, boolean zeroIsNull, ParseExceptionFunction valueConverter) {
|
private BlackboardAttribute parseAttrValue(String value, BlackboardAttribute.Type attrType, String fileName, boolean blankIsNull, boolean zeroIsNull, ParseExceptionFunction valueConverter) {
|
||||||
// remove non-printable characters from tsv input
|
// remove non-printable characters from tsv input
|
||||||
// https://stackoverflow.com/a/6199346
|
// https://stackoverflow.com/a/6199346
|
||||||
value = value.replaceAll("\\p{C}", "");
|
String sanitizedValue = value.replaceAll("\\p{C}", "");
|
||||||
|
|
||||||
if (blankIsNull && StringUtils.isBlank(value)) {
|
if (blankIsNull && StringUtils.isBlank(sanitizedValue)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zeroIsNull && value.matches("^\\s*[0\\.]*\\s*$")) {
|
if (zeroIsNull && sanitizedValue.matches("^\\s*[0\\.]*\\s*$")) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return valueConverter.apply(value);
|
return valueConverter.apply(sanitizedValue);
|
||||||
} catch (NumberFormatException | ParseException ex) {
|
} catch (NumberFormatException | ParseException ex) {
|
||||||
logger.log(Level.WARNING, String.format("Unable to format '%s' as value type %s while converting to attributes from %s.", value, attrType.getValueType().getLabel(), fileName), ex);
|
logger.log(Level.WARNING, String.format("Unable to format '%s' as value type %s while converting to attributes from %s.", sanitizedValue, attrType.getValueType().getLabel(), fileName), ex);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1185,10 +1183,13 @@ public final class LeappFileProcessor {
|
|||||||
|
|
||||||
if (columnName == null) {
|
if (columnName == null) {
|
||||||
logger.log(Level.SEVERE, String.format("No column name provided for [%s]", getXmlAttrIdentifier(parentName, attributeName)));
|
logger.log(Level.SEVERE, String.format("No column name provided for [%s]", getXmlAttrIdentifier(parentName, attributeName)));
|
||||||
|
continue;
|
||||||
} else if (columnName.trim().length() != columnName.length()) {
|
} else if (columnName.trim().length() != columnName.length()) {
|
||||||
logger.log(Level.SEVERE, String.format("Column name '%s' starts or ends with whitespace for [%s]", columnName, getXmlAttrIdentifier(parentName, attributeName)));
|
logger.log(Level.SEVERE, String.format("Column name '%s' starts or ends with whitespace for [%s]", columnName, getXmlAttrIdentifier(parentName, attributeName)));
|
||||||
|
continue;
|
||||||
} else if (columnName.matches("[^ \\S]")) {
|
} else if (columnName.matches("[^ \\S]")) {
|
||||||
logger.log(Level.SEVERE, String.format("Column name '%s' contains invalid characters [%s]", columnName, getXmlAttrIdentifier(parentName, attributeName)));
|
logger.log(Level.SEVERE, String.format("Column name '%s' contains invalid characters [%s]", columnName, getXmlAttrIdentifier(parentName, attributeName)));
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
TsvColumn thisCol = new TsvColumn(
|
TsvColumn thisCol = new TsvColumn(
|
||||||
@ -1230,7 +1231,7 @@ public final class LeappFileProcessor {
|
|||||||
case ANALYSIS_RESULT:
|
case ANALYSIS_RESULT:
|
||||||
return dataSource.newAnalysisResult(artType, Score.SCORE_UNKNOWN, null, null, null, bbattributes).getAnalysisResult();
|
return dataSource.newAnalysisResult(artType, Score.SCORE_UNKNOWN, null, null, null, bbattributes).getAnalysisResult();
|
||||||
default:
|
default:
|
||||||
logger.log(Level.SEVERE, "Unknown category type: " + artType.getCategory().getDisplayName());
|
logger.log(Level.SEVERE, String.format("Unknown category type: %s", artType.getCategory().getDisplayName()));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} catch (TskException ex) {
|
} catch (TskException ex) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2018 Basis Technology Corp.
|
* Copyright 2018-2021 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -177,7 +177,7 @@ public class ObjectDetectectionFileIngestModule extends FileIngestModuleAdapter
|
|||||||
/*
|
/*
|
||||||
* Index the artifact for keyword search.
|
* Index the artifact for keyword search.
|
||||||
*/
|
*/
|
||||||
blackboard.postArtifact(artifact, MODULE_NAME);
|
blackboard.postArtifact(artifact, MODULE_NAME, jobId);
|
||||||
} catch (Blackboard.BlackboardException ex) {
|
} catch (Blackboard.BlackboardException ex) {
|
||||||
logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS
|
logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy
|
* Autopsy
|
||||||
*
|
*
|
||||||
* Copyright 2018 Basis Technology Corp.
|
* Copyright 2018-2021 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -390,7 +390,7 @@ class VolatilityProcessor {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// index the artifact for keyword search
|
// index the artifact for keyword search
|
||||||
blackboard.postArtifact(volArtifact, VOLATILITY);
|
blackboard.postArtifact(volArtifact, VOLATILITY, null);
|
||||||
} catch (Blackboard.BlackboardException ex) {
|
} catch (Blackboard.BlackboardException ex) {
|
||||||
errorMsgs.add(Bundle.VolatilityProcessor_errorMessage_failedToIndexArtifact(pluginName));
|
errorMsgs.add(Bundle.VolatilityProcessor_errorMessage_failedToIndexArtifact(pluginName));
|
||||||
/*
|
/*
|
||||||
|
@ -158,7 +158,7 @@ class ContactAnalyzer(general.AndroidComponentAnalyzer):
|
|||||||
phoneNumber, # phoneNumber,
|
phoneNumber, # phoneNumber,
|
||||||
None, # homePhoneNumber,
|
None, # homePhoneNumber,
|
||||||
None, # mobilePhoneNumber,
|
None, # mobilePhoneNumber,
|
||||||
emailAddr) # emailAddr
|
emailAddr, context.getJobId()) # emailAddr
|
||||||
|
|
||||||
except SQLException as ex:
|
except SQLException as ex:
|
||||||
self._logger.log(Level.WARNING, "Error processing query result for Android messages.", ex)
|
self._logger.log(Level.WARNING, "Error processing query result for Android messages.", ex)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2018 Basis Technology Corp.
|
* Copyright 2012-2021 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -426,7 +426,7 @@ class AdHocSearchChildFactory extends ChildFactory<KeyValue> {
|
|||||||
final String queryDisp = queryStr.length() > QUERY_DISPLAY_LEN ? queryStr.substring(0, QUERY_DISPLAY_LEN - 1) + " ..." : queryStr;
|
final String queryDisp = queryStr.length() > QUERY_DISPLAY_LEN ? queryStr.substring(0, QUERY_DISPLAY_LEN - 1) + " ..." : queryStr;
|
||||||
try {
|
try {
|
||||||
progress = ProgressHandle.createHandle(NbBundle.getMessage(this.getClass(), "KeywordSearchResultFactory.progress.saving", queryDisp), () -> BlackboardResultWriter.this.cancel(true));
|
progress = ProgressHandle.createHandle(NbBundle.getMessage(this.getClass(), "KeywordSearchResultFactory.progress.saving", queryDisp), () -> BlackboardResultWriter.this.cancel(true));
|
||||||
hits.process(progress, null, this, false, saveResults);
|
hits.process(progress, null, this, false, saveResults, null);
|
||||||
} finally {
|
} finally {
|
||||||
finalizeWorker();
|
finalizeWorker();
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2014 - 2017 Basis Technology Corp.
|
* Copyright 2014 - 2021 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -564,7 +564,7 @@ final class IngestSearchRunner {
|
|||||||
subProgresses[keywordsSearched].progress(keywordList.getName() + ": " + queryDisplayStr, unitProgress);
|
subProgresses[keywordsSearched].progress(keywordList.getName() + ": " + queryDisplayStr, unitProgress);
|
||||||
|
|
||||||
// Create blackboard artifacts
|
// Create blackboard artifacts
|
||||||
newResults.process(null, subProgresses[keywordsSearched], this, keywordList.getIngestMessages(), true);
|
newResults.process(null, subProgresses[keywordsSearched], this, keywordList.getIngestMessages(), true, job.getJobId());
|
||||||
|
|
||||||
} //if has results
|
} //if has results
|
||||||
|
|
||||||
|
@ -648,7 +648,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule {
|
|||||||
}
|
}
|
||||||
if (!bbartifacts.isEmpty()) {
|
if (!bbartifacts.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard().postArtifacts(bbartifacts, moduleName);
|
Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard().postArtifacts(bbartifacts, moduleName, jobId);
|
||||||
} catch (NoCurrentCaseException | Blackboard.BlackboardException ex) {
|
} catch (NoCurrentCaseException | Blackboard.BlackboardException ex) {
|
||||||
// Log error and return to continue processing
|
// Log error and return to continue processing
|
||||||
logger.log(Level.WARNING, String.format("Unable to post blackboard artifacts for file $s.", aFile.getParentPath() + aFile.getName()), ex); //NON-NLS
|
logger.log(Level.WARNING, String.format("Unable to post blackboard artifacts for file $s.", aFile.getParentPath() + aFile.getName()), ex); //NON-NLS
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2018 Basis Technology Corp.
|
* Copyright 2012-2021 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -35,7 +35,8 @@ import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
|||||||
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServices;;
|
import org.sleuthkit.autopsy.ingest.IngestServices;
|
||||||
|
;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.Blackboard;
|
import org.sleuthkit.datamodel.Blackboard;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
@ -64,7 +65,7 @@ class QueryResults {
|
|||||||
* and publishing an event to notify subscribers of the blackboard posts.
|
* and publishing an event to notify subscribers of the blackboard posts.
|
||||||
*
|
*
|
||||||
* The KeywordSearchQuery is used to do the blackboard posts.
|
* The KeywordSearchQuery is used to do the blackboard posts.
|
||||||
*
|
*
|
||||||
* @param query The query.
|
* @param query The query.
|
||||||
*/
|
*/
|
||||||
QueryResults(KeywordSearchQuery query) {
|
QueryResults(KeywordSearchQuery query) {
|
||||||
@ -141,9 +142,10 @@ class QueryResults {
|
|||||||
* messages inbox if there is a keyword hit in the text
|
* messages inbox if there is a keyword hit in the text
|
||||||
* exrtacted from the text source object.
|
* exrtacted from the text source object.
|
||||||
* @param saveResults Flag whether to save search results as KWS artifacts.
|
* @param saveResults Flag whether to save search results as KWS artifacts.
|
||||||
*
|
* @param ingestJobId The numeric identifier of the ingest job within which
|
||||||
|
* the artifacts are being created, may be null.
|
||||||
*/
|
*/
|
||||||
void process(ProgressHandle progress, ProgressContributor subProgress, SwingWorker<?, ?> worker, boolean notifyInbox, boolean saveResults) {
|
void process(ProgressHandle progress, ProgressContributor subProgress, SwingWorker<?, ?> worker, boolean notifyInbox, boolean saveResults, Long ingestJobId) {
|
||||||
/*
|
/*
|
||||||
* Initialize the progress indicator to the number of keywords that will
|
* Initialize the progress indicator to the number of keywords that will
|
||||||
* be processed.
|
* be processed.
|
||||||
@ -218,15 +220,15 @@ class QueryResults {
|
|||||||
} catch (TskCoreException | NoCurrentCaseException tskCoreException) {
|
} catch (TskCoreException | NoCurrentCaseException tskCoreException) {
|
||||||
logger.log(Level.SEVERE, "Failed to get text source object for keyword hit", tskCoreException); //NON-NLS
|
logger.log(Level.SEVERE, "Failed to get text source object for keyword hit", tskCoreException); //NON-NLS
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((content != null) && saveResults) {
|
if ((content != null) && saveResults) {
|
||||||
/*
|
/*
|
||||||
* Post an artifact for the hit to the blackboard.
|
* Post an artifact for the hit to the blackboard.
|
||||||
*/
|
*/
|
||||||
BlackboardArtifact artifact = query.createKeywordHitArtifact(content, keyword, hit, snippet, query.getKeywordList().getName());
|
BlackboardArtifact artifact = query.createKeywordHitArtifact(content, keyword, hit, snippet, query.getKeywordList().getName());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Send an ingest inbox message for the hit.
|
* Send an ingest inbox message for the hit.
|
||||||
*/
|
*/
|
||||||
if (null != artifact) {
|
if (null != artifact) {
|
||||||
hitArtifacts.add(artifact);
|
hitArtifacts.add(artifact);
|
||||||
@ -253,7 +255,7 @@ class QueryResults {
|
|||||||
SleuthkitCase tskCase = Case.getCurrentCaseThrows().getSleuthkitCase();
|
SleuthkitCase tskCase = Case.getCurrentCaseThrows().getSleuthkitCase();
|
||||||
Blackboard blackboard = tskCase.getBlackboard();
|
Blackboard blackboard = tskCase.getBlackboard();
|
||||||
|
|
||||||
blackboard.postArtifacts(hitArtifacts, MODULE_NAME);
|
blackboard.postArtifacts(hitArtifacts, MODULE_NAME, ingestJobId);
|
||||||
} catch (NoCurrentCaseException | Blackboard.BlackboardException ex) {
|
} catch (NoCurrentCaseException | Blackboard.BlackboardException ex) {
|
||||||
logger.log(Level.SEVERE, "Failed to post KWH artifact to blackboard.", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Failed to post KWH artifact to blackboard.", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
|
@ -54,8 +54,6 @@ import org.sleuthkit.autopsy.ingest.IngestJobContext;
|
|||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.Blackboard;
|
import org.sleuthkit.datamodel.Blackboard;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
|
||||||
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_WEB_BOOKMARK;
|
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||||
import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
|
import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
@ -939,7 +937,7 @@ class Chromium extends Extract {
|
|||||||
WebBrowserArtifactsHelper helper = new WebBrowserArtifactsHelper(
|
WebBrowserArtifactsHelper helper = new WebBrowserArtifactsHelper(
|
||||||
Case.getCurrentCaseThrows().getSleuthkitCase(),
|
Case.getCurrentCaseThrows().getSleuthkitCase(),
|
||||||
NbBundle.getMessage(this.getClass(), "Chrome.parentModuleName"),
|
NbBundle.getMessage(this.getClass(), "Chrome.parentModuleName"),
|
||||||
webDataFile
|
webDataFile, context.getJobId()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Get Web form addresses
|
// Get Web form addresses
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2020 Basis Technology Corp.
|
* Copyright 2012-2021 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -255,7 +255,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// index the artifact for keyword search
|
// index the artifact for keyword search
|
||||||
blackboard.postArtifact(artifact, EmailParserModuleFactory.getModuleName());
|
blackboard.postArtifact(artifact, EmailParserModuleFactory.getModuleName(), context.getJobId());
|
||||||
} catch (Blackboard.BlackboardException ex) {
|
} catch (Blackboard.BlackboardException ex) {
|
||||||
MessageNotifyUtil.Notify.error(Bundle.ThunderbirdMboxFileIngestModule_processPst_indexError_message(), artifact.getDisplayName());
|
MessageNotifyUtil.Notify.error(Bundle.ThunderbirdMboxFileIngestModule_processPst_indexError_message(), artifact.getDisplayName());
|
||||||
logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS
|
logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS
|
||||||
@ -786,7 +786,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// index the artifact for keyword search
|
// index the artifact for keyword search
|
||||||
blackboard.postArtifact(bbart, EmailParserModuleFactory.getModuleName());
|
blackboard.postArtifact(bbart, EmailParserModuleFactory.getModuleName(), context.getJobId());
|
||||||
} catch (Blackboard.BlackboardException ex) {
|
} catch (Blackboard.BlackboardException ex) {
|
||||||
logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bbart.getArtifactID(), ex); //NON-NLS
|
logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bbart.getArtifactID(), ex); //NON-NLS
|
||||||
MessageNotifyUtil.Notify.error(Bundle.ThunderbirdMboxFileIngestModule_addArtifact_indexError_message(), bbart.getDisplayName());
|
MessageNotifyUtil.Notify.error(Bundle.ThunderbirdMboxFileIngestModule_addArtifact_indexError_message(), bbart.getDisplayName());
|
||||||
|
@ -243,7 +243,7 @@ final class VcardParser {
|
|||||||
|
|
||||||
// Index the artifact for keyword search.
|
// Index the artifact for keyword search.
|
||||||
try {
|
try {
|
||||||
blackboard.postArtifact(artifact, EmailParserModuleFactory.getModuleName());
|
blackboard.postArtifact(artifact, EmailParserModuleFactory.getModuleName(), context.getJobId());
|
||||||
} catch (Blackboard.BlackboardException ex) {
|
} catch (Blackboard.BlackboardException ex) {
|
||||||
logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS
|
logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS
|
||||||
MessageNotifyUtil.Notify.error(Bundle.VcardParser_addContactArtifact_indexError(), artifact.getDisplayName());
|
MessageNotifyUtil.Notify.error(Bundle.VcardParser_addContactArtifact_indexError(), artifact.getDisplayName());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user