mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
Populate the In Hashsets column (empty string if there were no hits for that file).
This commit is contained in:
parent
4d0788dc22
commit
e585d612e7
@ -194,7 +194,7 @@ public abstract class AbstractAbstractFileNode<T extends AbstractFile> extends A
|
|||||||
map.put(AbstractFilePropertyType.TYPE_DIR.toString(), content.getDirType().getLabel());
|
map.put(AbstractFilePropertyType.TYPE_DIR.toString(), content.getDirType().getLabel());
|
||||||
map.put(AbstractFilePropertyType.TYPE_META.toString(), content.getMetaType().toString());
|
map.put(AbstractFilePropertyType.TYPE_META.toString(), content.getMetaType().toString());
|
||||||
map.put(AbstractFilePropertyType.KNOWN.toString(), content.getKnown().getName());
|
map.put(AbstractFilePropertyType.KNOWN.toString(), content.getKnown().getName());
|
||||||
map.put(AbstractFilePropertyType.HASHSETS.toString(), "");
|
map.put(AbstractFilePropertyType.HASHSETS.toString(), HashsetHits.getList(content.getSleuthkitCase(), content.getId()));
|
||||||
map.put(AbstractFilePropertyType.MD5HASH.toString(), content.getMd5Hash() == null ? "" : content.getMd5Hash());
|
map.put(AbstractFilePropertyType.MD5HASH.toString(), content.getMd5Hash() == null ? "" : content.getMd5Hash());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,6 +94,43 @@ public class HashsetHits implements AutopsyVisitableItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public String getList(SleuthkitCase skCase, long objId) {
|
||||||
|
ResultSet rs = null;
|
||||||
|
String strList = "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
int setNameId = BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID();
|
||||||
|
int artId = BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID();
|
||||||
|
String query = "SELECT value_text,blackboard_attributes.artifact_id,attribute_type_id "
|
||||||
|
+ "FROM blackboard_attributes,blackboard_artifacts WHERE "
|
||||||
|
+ "attribute_type_id=" + setNameId
|
||||||
|
+ " AND blackboard_attributes.artifact_id=blackboard_artifacts.artifact_id"
|
||||||
|
+ " AND blackboard_artifacts.artifact_type_id=" + artId
|
||||||
|
+ " AND blackboard_artifacts.obj_id=" + objId;
|
||||||
|
rs = skCase.runQuery(query);
|
||||||
|
int i = 0;
|
||||||
|
while (rs.next()) {
|
||||||
|
if (i++ > 0) {
|
||||||
|
strList += ", ";
|
||||||
|
}
|
||||||
|
strList += rs.getString("value_text");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
logger.log(Level.WARNING, "SQL Exception occurred: ", ex);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
if (rs != null) {
|
||||||
|
try {
|
||||||
|
skCase.closeRunQuery(rs);
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
logger.log(Level.WARNING, "Error closing result set after getting hashset hits", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return strList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> T accept(AutopsyItemVisitor<T> v) {
|
public <T> T accept(AutopsyItemVisitor<T> v) {
|
||||||
return v.visit(this);
|
return v.visit(this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user