mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
4590 hide Data Source Profile in tree
This commit is contained in:
parent
64e1d6065d
commit
cde86ea894
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2018 Basis Technology Corp.
|
* Copyright 2011-2019 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");
|
||||||
@ -44,6 +44,7 @@ import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
|||||||
import org.sleuthkit.datamodel.Blackboard;
|
import org.sleuthkit.datamodel.Blackboard;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_ACCOUNT;
|
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_ACCOUNT;
|
||||||
|
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_DATA_SOURCE_PROFILE;
|
||||||
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG;
|
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG;
|
||||||
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO;
|
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO;
|
||||||
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT;
|
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT;
|
||||||
@ -235,6 +236,7 @@ public class ExtractedContent implements AutopsyVisitableItem {
|
|||||||
doNotShow.add(new BlackboardArtifact.Type(TSK_INTERESTING_FILE_HIT));
|
doNotShow.add(new BlackboardArtifact.Type(TSK_INTERESTING_FILE_HIT));
|
||||||
doNotShow.add(new BlackboardArtifact.Type(TSK_INTERESTING_ARTIFACT_HIT));
|
doNotShow.add(new BlackboardArtifact.Type(TSK_INTERESTING_ARTIFACT_HIT));
|
||||||
doNotShow.add(new BlackboardArtifact.Type(TSK_ACCOUNT));
|
doNotShow.add(new BlackboardArtifact.Type(TSK_ACCOUNT));
|
||||||
|
doNotShow.add(new BlackboardArtifact.Type(TSK_DATA_SOURCE_PROFILE));
|
||||||
}
|
}
|
||||||
|
|
||||||
private final PropertyChangeListener pcl = (PropertyChangeEvent evt) -> {
|
private final PropertyChangeListener pcl = (PropertyChangeEvent evt) -> {
|
||||||
|
@ -35,29 +35,41 @@ import org.sleuthkit.datamodel.TskCoreException;
|
|||||||
@Messages({"DataSourceProfiler.parentModuleName=Recent Activity"})
|
@Messages({"DataSourceProfiler.parentModuleName=Recent Activity"})
|
||||||
public class DataSourceProfiler extends Extract {
|
public class DataSourceProfiler extends Extract {
|
||||||
|
|
||||||
private Content dataSource;
|
|
||||||
private static final Logger logger = Logger.getLogger(Firefox.class.getName());
|
private static final Logger logger = Logger.getLogger(Firefox.class.getName());
|
||||||
|
private Content dataSource;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void process(Content dataSource, IngestJobContext context) {
|
void process(Content dataSource, IngestJobContext context) {
|
||||||
|
Collection<BlackboardAttribute> bbattributes = new ArrayList<>();
|
||||||
this.dataSource = dataSource;
|
this.dataSource = dataSource;
|
||||||
try {
|
try {
|
||||||
checkForWindowsVolume();
|
checkForWindowsVolume(bbattributes);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
logger.log(Level.WARNING, "Failed to check if datasource contained Windows volume.", ex);
|
logger.log(Level.WARNING, "Failed to check if datasource contained Windows volume.", ex);
|
||||||
}
|
}
|
||||||
}
|
//create an artifact if any attributes were added
|
||||||
|
if (!bbattributes.isEmpty()) {
|
||||||
void checkForWindowsVolume() throws TskCoreException {
|
|
||||||
FileManager fileManager = currentCase.getServices().getFileManager();
|
|
||||||
List<AbstractFile> files = fileManager.findFilesByParentPath(dataSource.getId(), "/windows/system32");
|
|
||||||
if (!files.isEmpty()) {
|
|
||||||
Collection<BlackboardAttribute> bbattributes = new ArrayList<BlackboardAttribute>();
|
|
||||||
bbattributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATA_SOURCE_DESCRIPTOR,
|
|
||||||
Bundle.DataSourceProfiler_parentModuleName(),
|
|
||||||
"Windows volume")); //NON-NLS
|
|
||||||
addArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_DATA_SOURCE_PROFILE, dataSource, bbattributes);
|
addArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_DATA_SOURCE_PROFILE, dataSource, bbattributes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the data source contains files which would indicate a windows
|
||||||
|
* volume is present in it.
|
||||||
|
*
|
||||||
|
* @param bbattributes the list of blackboard attributes to add to if a windows volume is present
|
||||||
|
*
|
||||||
|
* @throws TskCoreException
|
||||||
|
*/
|
||||||
|
private void checkForWindowsVolume(Collection<BlackboardAttribute> bbattributes) throws TskCoreException {
|
||||||
|
FileManager fileManager = currentCase.getServices().getFileManager();
|
||||||
|
List<AbstractFile> files = fileManager.findFilesByParentPath(dataSource.getId(), "/windows/system32");
|
||||||
|
//create an attribute if any files with the windows/system32 path were found
|
||||||
|
if (!files.isEmpty()) {
|
||||||
|
bbattributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATA_SOURCE_DESCRIPTOR,
|
||||||
|
Bundle.DataSourceProfiler_parentModuleName(),
|
||||||
|
"Windows volume")); //NON-NLS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user