mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 16:36:15 +00:00
Merge branch 'master' into zipmodule
This commit is contained in:
commit
d24ee5dc12
@ -198,9 +198,6 @@ public final class ExifParserFileIngestModule implements IngestModuleAbstractFil
|
|||||||
public void complete() {
|
public void complete() {
|
||||||
logger.log(Level.INFO, "completed exif parsing " + this.toString());
|
logger.log(Level.INFO, "completed exif parsing " + this.toString());
|
||||||
|
|
||||||
final IngestMessage msg = IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Complete");
|
|
||||||
services.postMessage(msg);
|
|
||||||
|
|
||||||
//module specific cleanup due to completion here
|
//module specific cleanup due to completion here
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,13 +232,11 @@ public final class ExifParserFileIngestModule implements IngestModuleAbstractFil
|
|||||||
public void init(IngestModuleInit initContext) {
|
public void init(IngestModuleInit initContext) {
|
||||||
services = IngestServices.getDefault();
|
services = IngestServices.getDefault();
|
||||||
logger.log(Level.INFO, "init() " + this.toString());
|
logger.log(Level.INFO, "init() " + this.toString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
logger.log(Level.INFO, "stop()");
|
logger.log(Level.INFO, "stop()");
|
||||||
services.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Stopped"));
|
|
||||||
|
|
||||||
//module specific cleanup due to interruption here
|
//module specific cleanup due to interruption here
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011 Basis Technology Corp.
|
* Copyright 2011-2013 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");
|
||||||
@ -23,20 +23,18 @@ import java.util.Collections;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
|
||||||
import org.netbeans.api.options.OptionsDisplayer;
|
|
||||||
import org.netbeans.spi.options.OptionsPanelController;
|
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServices;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
import org.sleuthkit.autopsy.ingest.IngestMessage;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile;
|
import org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestModuleInit;
|
import org.sleuthkit.autopsy.ingest.IngestModuleInit;
|
||||||
|
import org.sleuthkit.autopsy.ingest.IngestServices;
|
||||||
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
||||||
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||||
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.AbstractFile;
|
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
import org.sleuthkit.datamodel.ContentVisitor;
|
import org.sleuthkit.datamodel.ContentVisitor;
|
||||||
import org.sleuthkit.datamodel.File;
|
import org.sleuthkit.datamodel.File;
|
||||||
@ -58,7 +56,7 @@ public class HashDbIngestModule implements IngestModuleAbstractFile {
|
|||||||
private IngestServices services;
|
private IngestServices services;
|
||||||
private SleuthkitCase skCase;
|
private SleuthkitCase skCase;
|
||||||
private static int messageId = 0;
|
private static int messageId = 0;
|
||||||
private int count;
|
private int knownBadCount;
|
||||||
// Whether or not to do hash lookups (only set to true if there are dbs set)
|
// Whether or not to do hash lookups (only set to true if there are dbs set)
|
||||||
private boolean nsrlIsSet;
|
private boolean nsrlIsSet;
|
||||||
private boolean knownBadIsSet;
|
private boolean knownBadIsSet;
|
||||||
@ -67,13 +65,13 @@ public class HashDbIngestModule implements IngestModuleAbstractFile {
|
|||||||
private int nsrlPointer;
|
private int nsrlPointer;
|
||||||
static long calctime = 0;
|
static long calctime = 0;
|
||||||
static long lookuptime = 0;
|
static long lookuptime = 0;
|
||||||
private Map<Integer, HashDb> knownBadSets = new HashMap<Integer, HashDb>();
|
private Map<Integer, HashDb> knownBadSets = new HashMap<>();
|
||||||
private HashDbManagementPanel panel;
|
private HashDbManagementPanel panel;
|
||||||
|
|
||||||
private final Hash hasher = new Hash();
|
private final Hash hasher = new Hash();
|
||||||
|
|
||||||
private HashDbIngestModule() {
|
private HashDbIngestModule() {
|
||||||
count = 0;
|
knownBadCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized HashDbIngestModule getDefault() {
|
public static synchronized HashDbIngestModule getDefault() {
|
||||||
@ -86,7 +84,6 @@ public class HashDbIngestModule implements IngestModuleAbstractFile {
|
|||||||
@Override
|
@Override
|
||||||
public void init(IngestModuleInit initContext) {
|
public void init(IngestModuleInit initContext) {
|
||||||
services = IngestServices.getDefault();
|
services = IngestServices.getDefault();
|
||||||
this.services.postMessage(IngestMessage.createMessage(++messageId, IngestMessage.MessageType.INFO, this, "Started"));
|
|
||||||
this.skCase = Case.getCurrentCase().getSleuthkitCase();
|
this.skCase = Case.getCurrentCase().getSleuthkitCase();
|
||||||
try {
|
try {
|
||||||
HashDbXML hdbxml = HashDbXML.getCurrent();
|
HashDbXML hdbxml = HashDbXML.getCurrent();
|
||||||
@ -121,36 +118,39 @@ public class HashDbIngestModule implements IngestModuleAbstractFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (TskException ex) {
|
} catch (TskException ex) {
|
||||||
logger.log(Level.WARNING, "Setting NSRL and Known database failed", ex);
|
logger.log(Level.SEVERE, "Setting NSRL and Known database failed", ex);
|
||||||
|
this.services.postMessage(IngestMessage.createErrorMessage(++messageId, this, "Error Configuring Hash Databases", "Setting NSRL and Known database failed."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void complete() {
|
public void complete() {
|
||||||
StringBuilder detailsSb = new StringBuilder();
|
if ((knownBadIsSet) || (nsrlIsSet)) {
|
||||||
//details
|
StringBuilder detailsSb = new StringBuilder();
|
||||||
detailsSb.append("<table border='0' cellpadding='4' width='280'>");
|
//details
|
||||||
|
detailsSb.append("<table border='0' cellpadding='4' width='280'>");
|
||||||
|
|
||||||
detailsSb.append("<tr>");
|
detailsSb.append("<tr>");
|
||||||
detailsSb.append("<th>Number of notable files found:</th>");
|
detailsSb.append("<th>Number of notable files found:</th>");
|
||||||
detailsSb.append("<td>").append(count).append("</td>");
|
detailsSb.append("<td>").append(knownBadCount).append("</td>");
|
||||||
detailsSb.append("</tr>");
|
detailsSb.append("</tr>");
|
||||||
|
|
||||||
detailsSb.append("<tr>");
|
detailsSb.append("<tr>");
|
||||||
detailsSb.append("<th>Notable databases used:</th>");
|
detailsSb.append("<th>Notable databases used:</th>");
|
||||||
detailsSb.append("<td>Calc Time: ").append(calctime).append(" Lookup Time: ").append(lookuptime).append("</td>");
|
detailsSb.append("<td>Calc Time: ").append(calctime).append(" Lookup Time: ").append(lookuptime).append("</td>");
|
||||||
detailsSb.append("</tr>");
|
detailsSb.append("</tr>");
|
||||||
|
|
||||||
for (HashDb db : knownBadSets.values()) {
|
for (HashDb db : knownBadSets.values()) {
|
||||||
detailsSb.append("<tr><th>");
|
detailsSb.append("<tr><th>");
|
||||||
detailsSb.append(db.getName());
|
detailsSb.append(db.getName());
|
||||||
detailsSb.append("</th><td>");
|
detailsSb.append("</th><td>");
|
||||||
detailsSb.append(db.getDatabasePaths().get(0)); // TODO: support multiple database paths
|
detailsSb.append(db.getDatabasePaths().get(0)); // TODO: support multiple database paths
|
||||||
detailsSb.append("</td></tr>");
|
detailsSb.append("</td></tr>");
|
||||||
|
}
|
||||||
|
|
||||||
|
detailsSb.append("</table>");
|
||||||
|
services.postMessage(IngestMessage.createMessage(++messageId, IngestMessage.MessageType.INFO, this, "Hash Lookup Results", detailsSb.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
detailsSb.append("</table>");
|
|
||||||
services.postMessage(IngestMessage.createMessage(++messageId, IngestMessage.MessageType.INFO, this, "Hash Ingest Complete", detailsSb.toString()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -159,7 +159,7 @@ public class HashDbIngestModule implements IngestModuleAbstractFile {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
//manager.postMessage(IngestMessage.createMessage(++messageId, IngestMessage.MessageType.INFO, this, "STOP"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -312,70 +312,89 @@ public class HashDbIngestModule implements IngestModuleAbstractFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ProcessResult process(FsContent fsContent) {
|
private ProcessResult process(FsContent fsContent) {
|
||||||
|
// bail out if we have no hashes set
|
||||||
ProcessResult ret = ProcessResult.OK;
|
if ((nsrlIsSet == false) && (knownBadIsSet == false) && (calcHashesIsSet == false)) {
|
||||||
boolean processFile = true;
|
return ProcessResult.OK;
|
||||||
if (fsContent.getKnown().equals(TskData.FileKnown.BAD)) {
|
|
||||||
processFile = false;
|
|
||||||
}
|
}
|
||||||
if (processFile && (nsrlIsSet || knownBadIsSet)) {
|
|
||||||
String name = fsContent.getName();
|
// calc hash value
|
||||||
|
String name = fsContent.getName();
|
||||||
|
String md5Hash = fsContent.getMd5Hash();
|
||||||
|
if (md5Hash == null || md5Hash.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
String md5Hash = fsContent.getMd5Hash();
|
long calcstart = System.currentTimeMillis();
|
||||||
if (md5Hash == null || md5Hash.isEmpty()) {
|
md5Hash = hasher.calculateMd5(fsContent);
|
||||||
long calcstart = System.currentTimeMillis();
|
calctime += (System.currentTimeMillis() - calcstart);
|
||||||
md5Hash = hasher.calculateMd5(fsContent);
|
} catch (IOException ex) {
|
||||||
calctime += (System.currentTimeMillis() - calcstart);
|
logger.log(Level.WARNING, "Error calculating hash of file " + name, ex);
|
||||||
}
|
services.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestModule.this, "Read Error: " + name,
|
||||||
TskData.FileKnown status = TskData.FileKnown.UKNOWN;
|
"Error encountered while calculating the hash value for " + name + "."));
|
||||||
boolean foundBad = false;
|
return ProcessResult.ERROR;
|
||||||
for (Map.Entry<Integer, HashDb> entry : knownBadSets.entrySet()) {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// look up in known bad first
|
||||||
|
TskData.FileKnown status = TskData.FileKnown.UKNOWN;
|
||||||
|
boolean foundBad = false;
|
||||||
|
ProcessResult ret = ProcessResult.OK;
|
||||||
|
|
||||||
|
if (knownBadIsSet) {
|
||||||
|
for (Map.Entry<Integer, HashDb> entry : knownBadSets.entrySet()) {
|
||||||
|
|
||||||
|
try {
|
||||||
long lookupstart = System.currentTimeMillis();
|
long lookupstart = System.currentTimeMillis();
|
||||||
status = skCase.knownBadLookupMd5(md5Hash, entry.getKey());
|
status = skCase.knownBadLookupMd5(md5Hash, entry.getKey());
|
||||||
lookuptime += (System.currentTimeMillis() - lookupstart);
|
lookuptime += (System.currentTimeMillis() - lookupstart);
|
||||||
if (status.equals(TskData.FileKnown.BAD)) {
|
} catch (TskException ex) {
|
||||||
foundBad = true;
|
logger.log(Level.WARNING, "Couldn't lookup known bad hash for file " + name + " - see sleuthkit log for details", ex);
|
||||||
count += 1;
|
services.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestModule.this, "Hash Lookup Error: " + name,
|
||||||
skCase.setKnown(fsContent, status);
|
"Error encountered while looking up known bad hash value for " + name + "."));
|
||||||
String hashSetName = entry.getValue().getName();
|
ret = ProcessResult.ERROR;
|
||||||
processBadFile(fsContent, md5Hash, hashSetName, entry.getValue().getShowInboxMessages());
|
}
|
||||||
|
|
||||||
|
if (status.equals(TskData.FileKnown.BAD)) {
|
||||||
|
foundBad = true;
|
||||||
|
knownBadCount += 1;
|
||||||
|
try {
|
||||||
|
skCase.setKnown(fsContent, TskData.FileKnown.BAD);
|
||||||
|
} catch (TskException ex) {
|
||||||
|
logger.log(Level.WARNING, "Couldn't set known bad state for file " + name + " - see sleuthkit log for details", ex);
|
||||||
|
services.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestModule.this, "Hash Lookup Error: " + name,
|
||||||
|
"Error encountered while setting known bad state for " + name + "."));
|
||||||
|
ret = ProcessResult.ERROR;
|
||||||
}
|
}
|
||||||
|
String hashSetName = entry.getValue().getName();
|
||||||
|
processBadFile(fsContent, md5Hash, hashSetName, entry.getValue().getShowInboxMessages());
|
||||||
}
|
}
|
||||||
if (!foundBad && nsrlIsSet) {
|
|
||||||
long lookupstart = System.currentTimeMillis();
|
|
||||||
status = skCase.nsrlLookupMd5(md5Hash);
|
|
||||||
lookuptime += (System.currentTimeMillis() - lookupstart);
|
|
||||||
if (status.equals(TskData.FileKnown.KNOWN)) {
|
|
||||||
skCase.setKnown(fsContent, status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (TskException ex) {
|
|
||||||
logger.log(Level.WARNING, "Couldn't analyze file " + name + " - see sleuthkit log for details", ex);
|
|
||||||
services.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestModule.this, "Hash Lookup Error: " + name,
|
|
||||||
"Error encountered while updating the hash values for " + name + "."));
|
|
||||||
ret = ProcessResult.ERROR;
|
|
||||||
} catch (IOException ex) {
|
|
||||||
logger.log(Level.WARNING, "Error reading file " + name, ex);
|
|
||||||
services.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestModule.this, "Read Error: " + name,
|
|
||||||
"Error encountered while calculating the hash value for " + name + "."));
|
|
||||||
ret = ProcessResult.ERROR;
|
|
||||||
}
|
|
||||||
} else if (processFile && calcHashesIsSet) {
|
|
||||||
String name = fsContent.getName();
|
|
||||||
try {
|
|
||||||
String md5Hash = fsContent.getMd5Hash();
|
|
||||||
if (md5Hash == null || md5Hash.isEmpty()) {
|
|
||||||
long calcstart = System.currentTimeMillis();
|
|
||||||
hasher.calculateMd5(fsContent);
|
|
||||||
calctime += (System.currentTimeMillis() - calcstart);
|
|
||||||
}
|
|
||||||
ret = ProcessResult.OK;
|
|
||||||
} catch (IOException ex) {
|
|
||||||
logger.log(Level.WARNING, "Error reading file " + name, ex);
|
|
||||||
services.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestModule.this, "Read Error: " + name,
|
|
||||||
"Error encountered while calculating the hash value for " + name + " without databases."));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// only do NSRL if we didn't find a known bad
|
||||||
|
if (!foundBad && nsrlIsSet) {
|
||||||
|
try {
|
||||||
|
long lookupstart = System.currentTimeMillis();
|
||||||
|
status = skCase.nsrlLookupMd5(md5Hash);
|
||||||
|
lookuptime += (System.currentTimeMillis() - lookupstart);
|
||||||
|
} catch (TskException ex) {
|
||||||
|
logger.log(Level.WARNING, "Couldn't lookup NSRL hash for file " + name + " - see sleuthkit log for details", ex);
|
||||||
|
services.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestModule.this, "Hash Lookup Error: " + name,
|
||||||
|
"Error encountered while looking up NSRL hash value for " + name + "."));
|
||||||
|
ret = ProcessResult.ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status.equals(TskData.FileKnown.KNOWN)) {
|
||||||
|
try {
|
||||||
|
skCase.setKnown(fsContent, TskData.FileKnown.KNOWN);
|
||||||
|
} catch (TskException ex) {
|
||||||
|
logger.log(Level.WARNING, "Couldn't set known state for file " + name + " - see sleuthkit log for details", ex);
|
||||||
|
services.postMessage(IngestMessage.createErrorMessage(++messageId, HashDbIngestModule.this, "Hash Lookup Error: " + name,
|
||||||
|
"Error encountered while setting known (NSRL) state for " + name + "."));
|
||||||
|
ret = ProcessResult.ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,6 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
|
|||||||
finalSearcher.execute();
|
finalSearcher.execute();
|
||||||
} else {
|
} else {
|
||||||
finalSearcherDone = true;
|
finalSearcherDone = true;
|
||||||
services.postMessage(IngestMessage.createMessage(++messageID, MessageType.INFO, this, "Completed"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//log number of files / chunks in index
|
//log number of files / chunks in index
|
||||||
@ -438,8 +437,6 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
|
|||||||
|
|
||||||
commitTimer.start();
|
commitTimer.start();
|
||||||
searchTimer.start();
|
searchTimer.start();
|
||||||
|
|
||||||
services.postMessage(IngestMessage.createMessage(++messageID, MessageType.INFO, this, "Started"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -551,7 +548,7 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
|
|||||||
msg.append("<br />Skipped files: ").append(skipped).append("<br />");
|
msg.append("<br />Skipped files: ").append(skipped).append("<br />");
|
||||||
String indexStats = msg.toString();
|
String indexStats = msg.toString();
|
||||||
logger.log(Level.INFO, "Keyword Indexing Completed: " + indexStats);
|
logger.log(Level.INFO, "Keyword Indexing Completed: " + indexStats);
|
||||||
services.postMessage(IngestMessage.createMessage(++messageID, MessageType.INFO, this, "Keyword Indexing Completed", indexStats));
|
services.postMessage(IngestMessage.createMessage(++messageID, MessageType.INFO, this, "Keyword Indexing Results", indexStats));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1180,8 +1177,6 @@ public final class KeywordSearchIngestModule implements IngestModuleAbstractFile
|
|||||||
logger.log(Level.INFO, "The final searcher in this ingest done.");
|
logger.log(Level.INFO, "The final searcher in this ingest done.");
|
||||||
finalSearcherDone = true;
|
finalSearcherDone = true;
|
||||||
|
|
||||||
services.postMessage(IngestMessage.createMessage(++messageID, MessageType.INFO, KeywordSearchIngestModule.instance, "Completed"));
|
|
||||||
|
|
||||||
//run module cleanup
|
//run module cleanup
|
||||||
cleanup();
|
cleanup();
|
||||||
} else {
|
} else {
|
||||||
|
@ -406,7 +406,7 @@ public class Chrome extends Extract implements IngestModuleImage {
|
|||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_NAME.getTypeID(), "Recent Activity", ((result.get("title").toString() != null) ? result.get("title").toString() : "")));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_NAME.getTypeID(), "Recent Activity", ((result.get("title").toString() != null) ? result.get("title").toString() : "")));
|
||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID(), "Recent Activity", "Chrome"));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID(), "Recent Activity", "Chrome"));
|
||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(), "Recent Activity", (Util.extractDomain((result.get("origin_url").toString() != null) ? result.get("url").toString() : ""))));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(), "Recent Activity", (Util.extractDomain((result.get("origin_url").toString() != null) ? result.get("url").toString() : ""))));
|
||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USERNAME.getTypeID(), "Recent Activity", ((result.get("username_value").toString() != null) ? result.get("username_value").toString().replaceAll("'", "''") : "")));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USER_NAME.getTypeID(), "Recent Activity", ((result.get("username_value").toString() != null) ? result.get("username_value").toString().replaceAll("'", "''") : "")));
|
||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(), "Recent Activity", result.get("signon_realm").toString()));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(), "Recent Activity", result.get("signon_realm").toString()));
|
||||||
this.addArtifact(ARTIFACT_TYPE.TSK_WEB_HISTORY, signonFiles.get(j), bbattributes);
|
this.addArtifact(ARTIFACT_TYPE.TSK_WEB_HISTORY, signonFiles.get(j), bbattributes);
|
||||||
|
|
||||||
|
@ -500,7 +500,7 @@ public class ExtractIE extends Extract implements IngestModuleImage {
|
|||||||
|
|
||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID(), "RecentActivity", "Internet Explorer"));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_PROG_NAME.getTypeID(), "RecentActivity", "Internet Explorer"));
|
||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(), "RecentActivity", domain));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_DOMAIN.getTypeID(), "RecentActivity", domain));
|
||||||
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USERNAME.getTypeID(), "RecentActivity", user));
|
bbattributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_USER_NAME.getTypeID(), "RecentActivity", user));
|
||||||
bbart.addAttributes(bbattributes);
|
bbart.addAttributes(bbattributes);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
logger.log(Level.SEVERE, "Error writing Internet Explorer web history artifact to the blackboard.", ex);
|
logger.log(Level.SEVERE, "Error writing Internet Explorer web history artifact to the blackboard.", ex);
|
||||||
|
@ -44,7 +44,6 @@ public final class RAImageIngestModule implements IngestModuleImage {
|
|||||||
private static RAImageIngestModule defaultInstance = null;
|
private static RAImageIngestModule defaultInstance = null;
|
||||||
private IngestServices services;
|
private IngestServices services;
|
||||||
private static int messageId = 0;
|
private static int messageId = 0;
|
||||||
private ArrayList<String> errors = new ArrayList<String>();
|
|
||||||
private StringBuilder subCompleted = new StringBuilder();
|
private StringBuilder subCompleted = new StringBuilder();
|
||||||
private ArrayList<Extract> modules;
|
private ArrayList<Extract> modules;
|
||||||
final public static String MODULE_VERSION = "1.0";
|
final public static String MODULE_VERSION = "1.0";
|
||||||
@ -66,12 +65,15 @@ public final class RAImageIngestModule implements IngestModuleImage {
|
|||||||
@Override
|
@Override
|
||||||
public void process(Image image, IngestImageWorkerController controller) {
|
public void process(Image image, IngestImageWorkerController controller) {
|
||||||
services.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Started " + image.getName()));
|
services.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Started " + image.getName()));
|
||||||
|
|
||||||
controller.switchToDeterminate(modules.size());
|
controller.switchToDeterminate(modules.size());
|
||||||
controller.progress(0);
|
controller.progress(0);
|
||||||
|
ArrayList<String> errors = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < modules.size(); i++) {
|
for (int i = 0; i < modules.size(); i++) {
|
||||||
Extract module = modules.get(i);
|
Extract module = modules.get(i);
|
||||||
if (controller.isCancelled()) {
|
if (controller.isCancelled()) {
|
||||||
logger.log(Level.INFO, "Recent Activity has been canceled, quitting before " + module.getName());
|
logger.log(Level.INFO, "Recent Activity has been canceled, quitting before {0}", module.getName());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -83,47 +85,45 @@ public final class RAImageIngestModule implements IngestModuleImage {
|
|||||||
controller.progress(i + 1);
|
controller.progress(i + 1);
|
||||||
errors.addAll(module.getErrorMessages());
|
errors.addAll(module.getErrorMessages());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create the final message for inbox
|
||||||
|
StringBuilder errorMessage = new StringBuilder();
|
||||||
|
String errorMsgSubject;
|
||||||
|
if (!errors.isEmpty()) {
|
||||||
|
errorMessage.append("Errors encountered during analysis: <ul>\n");
|
||||||
|
for (String msg : errors) {
|
||||||
|
errorMessage.append("<li>").append(msg).append("</li>\n");
|
||||||
|
}
|
||||||
|
errorMessage.append("</ul>\n");
|
||||||
|
|
||||||
|
if (errors.size() == 1) {
|
||||||
|
errorMsgSubject = "1 error found";
|
||||||
|
} else {
|
||||||
|
errorMsgSubject = errors.size() + " errors found";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
errorMessage.append("No errors encountered.");
|
||||||
|
errorMsgSubject = "No errors reported";
|
||||||
|
}
|
||||||
|
final IngestMessage msg = IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Finished " + image.getName()+ " - " + errorMsgSubject, errorMessage.toString());
|
||||||
|
services.postMessage(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void complete() {
|
public void complete() {
|
||||||
logger.log(Level.INFO, "complete() " + this.toString());
|
logger.log(Level.INFO, "complete() " + this.toString());
|
||||||
StringBuilder errorMessage = new StringBuilder();
|
|
||||||
String errorsFound = "";
|
|
||||||
|
|
||||||
|
// close modules
|
||||||
for (int i = 0; i < modules.size(); i++) {
|
for (int i = 0; i < modules.size(); i++) {
|
||||||
Extract module = modules.get(i);
|
Extract module = modules.get(i);
|
||||||
try {
|
try {
|
||||||
module.complete();
|
module.complete();
|
||||||
subCompleted.append(module.getName()).append(" complete <br>");
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
logger.log(Level.SEVERE, "Exception occurred when completing " + module.getName(), ex);
|
logger.log(Level.SEVERE, "Exception occurred when completing " + module.getName(), ex);
|
||||||
subCompleted.append(module.getName()).append(" failed to complete - see log for details <br>");
|
subCompleted.append(module.getName()).append(" failed to complete - see log for details <br>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
errorMessage.append(subCompleted);
|
|
||||||
int i = 0;
|
|
||||||
if (!errors.isEmpty()) {
|
|
||||||
errorMessage.append("<br>There were some errors extracting the data: <br>");
|
|
||||||
for (String msg : errors) {
|
|
||||||
i++;
|
|
||||||
final IngestMessage error = IngestMessage.createMessage(++messageId, MessageType.INFO, this, msg + "<br>");
|
|
||||||
services.postMessage(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i == 1) {
|
|
||||||
errorsFound = i + " error found";
|
|
||||||
} else {
|
|
||||||
errorsFound = i + " errors found";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
errorMessage.append("<br> No errors encountered.");
|
|
||||||
errorsFound = "No errors reported";
|
|
||||||
}
|
|
||||||
final IngestMessage msg = IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Completed - " + errorsFound, errorMessage.toString());
|
|
||||||
services.postMessage(msg);
|
|
||||||
|
|
||||||
//module specific cleanup due to completion here
|
//module specific cleanup due to completion here
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,8 +139,8 @@ public final class RAImageIngestModule implements IngestModuleImage {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(IngestModuleInit initContext) {
|
public void init(IngestModuleInit initContext) {
|
||||||
modules = new ArrayList<Extract>();
|
modules = new ArrayList<>();
|
||||||
logger.log(Level.INFO, "init() " + this.toString());
|
logger.log(Level.INFO, "init() {0}", this.toString());
|
||||||
services = IngestServices.getDefault();
|
services = IngestServices.getDefault();
|
||||||
|
|
||||||
final Extract registry = new ExtractRegistry();
|
final Extract registry = new ExtractRegistry();
|
||||||
|
@ -114,7 +114,8 @@ public class ThunderbirdMboxFileIngestModule implements IngestModuleAbstractFile
|
|||||||
|
|
||||||
|
|
||||||
if (isMbox) {
|
if (isMbox) {
|
||||||
services.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Processing " + fsContent.getName()));
|
logger.log(Level.INFO, "ThunderbirdMboxFileIngestModule: Parsing {0}", fsContent.getName());
|
||||||
|
|
||||||
String mboxName = fsContent.getName();
|
String mboxName = fsContent.getName();
|
||||||
String msfName = mboxName + ".msf";
|
String msfName = mboxName + ".msf";
|
||||||
//Long mboxId = fsContent.getId();
|
//Long mboxId = fsContent.getId();
|
||||||
@ -248,7 +249,6 @@ public class ThunderbirdMboxFileIngestModule implements IngestModuleAbstractFile
|
|||||||
@Override
|
@Override
|
||||||
public void complete() {
|
public void complete() {
|
||||||
logger.log(Level.INFO, "complete()");
|
logger.log(Level.INFO, "complete()");
|
||||||
services.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "COMPLETE"));
|
|
||||||
|
|
||||||
//module specific cleanup due completion here
|
//module specific cleanup due completion here
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user