mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
4380 add correlation attrs for imei, imsi, and iccid
This commit is contained in:
parent
271788c316
commit
3f8840f8fd
@ -3263,18 +3263,24 @@ abstract class AbstractSqlEamDb implements EamDb {
|
|||||||
}
|
}
|
||||||
final String dataSourceObjectIdIndexTemplate = "CREATE INDEX IF NOT EXISTS datasource_object_id ON data_sources (%s)";
|
final String dataSourceObjectIdIndexTemplate = "CREATE INDEX IF NOT EXISTS datasource_object_id ON data_sources (%s)";
|
||||||
statement.execute(String.format(dataSourceObjectIdIndexTemplate, dataSourceObjectIdColumnName));
|
statement.execute(String.format(dataSourceObjectIdIndexTemplate, dataSourceObjectIdColumnName));
|
||||||
|
List<String> instaceTablesToAdd = new ArrayList<>();
|
||||||
//update central repository to be able to store new correlation attributes
|
//update central repository to be able to store new correlation attributes
|
||||||
final String wirelessNetworsDbTableName = "wireless_networks";
|
final String wirelessNetworksDbTableName = "wireless_networks";
|
||||||
final String wirelessNetworksTableInstanceName = wirelessNetworsDbTableName + "_instances";
|
instaceTablesToAdd.add(wirelessNetworksDbTableName + "_instances");
|
||||||
final String macAddressDbTableName = "mac_address";
|
final String macAddressDbTableName = "mac_address";
|
||||||
final String macAddressTableInstanceName = macAddressDbTableName + "_instances";
|
instaceTablesToAdd.add(macAddressDbTableName + "_instances");
|
||||||
|
final String imeiNumberDbTableName = "imei_number";
|
||||||
|
instaceTablesToAdd.add(imeiNumberDbTableName + "_instances");
|
||||||
|
final String iccidNumberDbTableName = "iccid_number";
|
||||||
|
instaceTablesToAdd.add(iccidNumberDbTableName + "_instances");
|
||||||
|
final String imsiNumberDbTableName = "imsi_number";
|
||||||
|
instaceTablesToAdd.add(imsiNumberDbTableName + "_instances");
|
||||||
|
|
||||||
//add the wireless_networks attribute to the correlation_types table
|
//add the wireless_networks attribute to the correlation_types table
|
||||||
preparedStatement = conn.prepareStatement(addAttributeSql);
|
preparedStatement = conn.prepareStatement(addAttributeSql);
|
||||||
preparedStatement.setInt(1, CorrelationAttributeInstance.SSID_TYPE_ID);
|
preparedStatement.setInt(1, CorrelationAttributeInstance.SSID_TYPE_ID);
|
||||||
preparedStatement.setString(2, Bundle.CorrelationType_SSID_displayName());
|
preparedStatement.setString(2, Bundle.CorrelationType_SSID_displayName());
|
||||||
preparedStatement.setString(3, wirelessNetworsDbTableName);
|
preparedStatement.setString(3, wirelessNetworksDbTableName);
|
||||||
preparedStatement.setInt(4, 1);
|
preparedStatement.setInt(4, 1);
|
||||||
preparedStatement.setInt(5, 1);
|
preparedStatement.setInt(5, 1);
|
||||||
preparedStatement.execute();
|
preparedStatement.execute();
|
||||||
@ -3288,20 +3294,42 @@ abstract class AbstractSqlEamDb implements EamDb {
|
|||||||
preparedStatement.setInt(5, 1);
|
preparedStatement.setInt(5, 1);
|
||||||
preparedStatement.execute();
|
preparedStatement.execute();
|
||||||
|
|
||||||
//create a new wireless_networks_instances table and add indexes for its columns
|
//add the imei_number attribute to the correlation_types table
|
||||||
statement.execute(String.format(addSsidTableTemplate, wirelessNetworksTableInstanceName, wirelessNetworksTableInstanceName));
|
preparedStatement = conn.prepareStatement(addAttributeSql);
|
||||||
statement.execute(String.format(addCaseIdIndexTemplate, wirelessNetworksTableInstanceName, wirelessNetworksTableInstanceName));
|
preparedStatement.setInt(1, CorrelationAttributeInstance.IMEI_TYPE_ID);
|
||||||
statement.execute(String.format(addDataSourceIdIndexTemplate, wirelessNetworksTableInstanceName, wirelessNetworksTableInstanceName));
|
preparedStatement.setString(2, Bundle.CorrelationType_IMEI_displayName());
|
||||||
statement.execute(String.format(addValueIndexTemplate, wirelessNetworksTableInstanceName, wirelessNetworksTableInstanceName));
|
preparedStatement.setString(3, imeiNumberDbTableName);
|
||||||
statement.execute(String.format(addKnownStatusIndexTemplate, wirelessNetworksTableInstanceName, wirelessNetworksTableInstanceName));
|
preparedStatement.setInt(4, 1);
|
||||||
|
preparedStatement.setInt(5, 1);
|
||||||
//create a new mac_address_instances table and add indexes for its columns
|
preparedStatement.execute();
|
||||||
statement.execute(String.format(addSsidTableTemplate, macAddressTableInstanceName, macAddressTableInstanceName));
|
|
||||||
statement.execute(String.format(addCaseIdIndexTemplate, macAddressTableInstanceName, macAddressTableInstanceName));
|
//add the imsi_number attribute to the correlation_types table
|
||||||
statement.execute(String.format(addDataSourceIdIndexTemplate, macAddressTableInstanceName, macAddressTableInstanceName));
|
preparedStatement = conn.prepareStatement(addAttributeSql);
|
||||||
statement.execute(String.format(addValueIndexTemplate, macAddressTableInstanceName, macAddressTableInstanceName));
|
preparedStatement.setInt(1, CorrelationAttributeInstance.IMSI_TYPE_ID);
|
||||||
statement.execute(String.format(addKnownStatusIndexTemplate, macAddressTableInstanceName, macAddressTableInstanceName));
|
preparedStatement.setString(2, Bundle.CorrelationType_IMSI_displayName());
|
||||||
|
preparedStatement.setString(3, imsiNumberDbTableName);
|
||||||
|
preparedStatement.setInt(4, 1);
|
||||||
|
preparedStatement.setInt(5, 1);
|
||||||
|
preparedStatement.execute();
|
||||||
|
|
||||||
|
//add the iccid_number attribute to the correlation_types table
|
||||||
|
preparedStatement = conn.prepareStatement(addAttributeSql);
|
||||||
|
preparedStatement.setInt(1, CorrelationAttributeInstance.ICCID_TYPE_ID);
|
||||||
|
preparedStatement.setString(2, Bundle.CorrelationType_ICCID_displayName());
|
||||||
|
preparedStatement.setString(3, iccidNumberDbTableName);
|
||||||
|
preparedStatement.setInt(4, 1);
|
||||||
|
preparedStatement.setInt(5, 1);
|
||||||
|
preparedStatement.execute();
|
||||||
|
|
||||||
|
//create a new _instances tables and add indexes for their columns
|
||||||
|
for (String tableName : instaceTablesToAdd) {
|
||||||
|
statement.execute(String.format(addSsidTableTemplate, tableName, tableName));
|
||||||
|
statement.execute(String.format(addCaseIdIndexTemplate, tableName, tableName));
|
||||||
|
statement.execute(String.format(addDataSourceIdIndexTemplate, tableName, tableName));
|
||||||
|
statement.execute(String.format(addValueIndexTemplate, tableName, tableName));
|
||||||
|
statement.execute(String.format(addKnownStatusIndexTemplate, tableName, tableName));
|
||||||
|
}
|
||||||
|
|
||||||
//add file_obj_id column to _instances table which do not already have it
|
//add file_obj_id column to _instances table which do not already have it
|
||||||
String instance_type_dbname;
|
String instance_type_dbname;
|
||||||
final String objectIdColumnName = "file_obj_id";
|
final String objectIdColumnName = "file_obj_id";
|
||||||
|
@ -217,6 +217,9 @@ public class CorrelationAttributeInstance implements Serializable {
|
|||||||
public static final int USBID_TYPE_ID = 4;
|
public static final int USBID_TYPE_ID = 4;
|
||||||
public static final int SSID_TYPE_ID = 5;
|
public static final int SSID_TYPE_ID = 5;
|
||||||
public static final int MAC_TYPE_ID = 6;
|
public static final int MAC_TYPE_ID = 6;
|
||||||
|
public static final int IMEI_TYPE_ID = 7;
|
||||||
|
public static final int IMSI_TYPE_ID = 8;
|
||||||
|
public static final int ICCID_TYPE_ID = 9;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the default correlation types
|
* Load the default correlation types
|
||||||
@ -230,7 +233,10 @@ public class CorrelationAttributeInstance implements Serializable {
|
|||||||
"CorrelationType.PHONE.displayName=Phone Numbers",
|
"CorrelationType.PHONE.displayName=Phone Numbers",
|
||||||
"CorrelationType.USBID.displayName=USB Devices",
|
"CorrelationType.USBID.displayName=USB Devices",
|
||||||
"CorrelationType.SSID.displayName=Wireless Networks",
|
"CorrelationType.SSID.displayName=Wireless Networks",
|
||||||
"CorrelationType.MAC.displayName=Mac Addresses"})
|
"CorrelationType.MAC.displayName=Mac Addresses",
|
||||||
|
"CorrelationType.IMEI.displayName=IMEI Number",
|
||||||
|
"CorrelationType.IMSI.displayName=IMSI Number",
|
||||||
|
"CorrelationType.ICCID.displayName=ICCID Number"})
|
||||||
public static List<CorrelationAttributeInstance.Type> getDefaultCorrelationTypes() throws EamDbException {
|
public static List<CorrelationAttributeInstance.Type> getDefaultCorrelationTypes() throws EamDbException {
|
||||||
List<CorrelationAttributeInstance.Type> DEFAULT_CORRELATION_TYPES = new ArrayList<>();
|
List<CorrelationAttributeInstance.Type> DEFAULT_CORRELATION_TYPES = new ArrayList<>();
|
||||||
DEFAULT_CORRELATION_TYPES.add(new CorrelationAttributeInstance.Type(FILES_TYPE_ID, Bundle.CorrelationType_FILES_displayName(), "file", true, true)); // NON-NLS
|
DEFAULT_CORRELATION_TYPES.add(new CorrelationAttributeInstance.Type(FILES_TYPE_ID, Bundle.CorrelationType_FILES_displayName(), "file", true, true)); // NON-NLS
|
||||||
@ -240,6 +246,9 @@ public class CorrelationAttributeInstance implements Serializable {
|
|||||||
DEFAULT_CORRELATION_TYPES.add(new CorrelationAttributeInstance.Type(USBID_TYPE_ID, Bundle.CorrelationType_USBID_displayName(), "usb_devices", true, true)); // NON-NLS
|
DEFAULT_CORRELATION_TYPES.add(new CorrelationAttributeInstance.Type(USBID_TYPE_ID, Bundle.CorrelationType_USBID_displayName(), "usb_devices", true, true)); // NON-NLS
|
||||||
DEFAULT_CORRELATION_TYPES.add(new CorrelationAttributeInstance.Type(SSID_TYPE_ID, Bundle.CorrelationType_SSID_displayName(), "wireless_networks", true, true)); // NON-NLS
|
DEFAULT_CORRELATION_TYPES.add(new CorrelationAttributeInstance.Type(SSID_TYPE_ID, Bundle.CorrelationType_SSID_displayName(), "wireless_networks", true, true)); // NON-NLS
|
||||||
DEFAULT_CORRELATION_TYPES.add(new CorrelationAttributeInstance.Type(MAC_TYPE_ID, Bundle.CorrelationType_MAC_displayName(), "mac_address", true, true)); //NON-NLS
|
DEFAULT_CORRELATION_TYPES.add(new CorrelationAttributeInstance.Type(MAC_TYPE_ID, Bundle.CorrelationType_MAC_displayName(), "mac_address", true, true)); //NON-NLS
|
||||||
|
DEFAULT_CORRELATION_TYPES.add(new CorrelationAttributeInstance.Type(IMEI_TYPE_ID, Bundle.CorrelationType_IMEI_displayName(), "imei_number", true, true)); //NON-NLS
|
||||||
|
DEFAULT_CORRELATION_TYPES.add(new CorrelationAttributeInstance.Type(IMSI_TYPE_ID, Bundle.CorrelationType_IMSI_displayName(), "imsi_number", true, true)); //NON-NLS
|
||||||
|
DEFAULT_CORRELATION_TYPES.add(new CorrelationAttributeInstance.Type(ICCID_TYPE_ID, Bundle.CorrelationType_ICCID_displayName(), "iccid_number", true, true)); //NON-NLS
|
||||||
return DEFAULT_CORRELATION_TYPES;
|
return DEFAULT_CORRELATION_TYPES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,6 +67,12 @@ final public class CorrelationAttributeNormalizer {
|
|||||||
return data;
|
return data;
|
||||||
case CorrelationAttributeInstance.MAC_TYPE_ID:
|
case CorrelationAttributeInstance.MAC_TYPE_ID:
|
||||||
return data;
|
return data;
|
||||||
|
case CorrelationAttributeInstance.IMEI_TYPE_ID:
|
||||||
|
return data;
|
||||||
|
case CorrelationAttributeInstance.IMSI_TYPE_ID:
|
||||||
|
return data;
|
||||||
|
case CorrelationAttributeInstance.ICCID_TYPE_ID:
|
||||||
|
return data;
|
||||||
default:
|
default:
|
||||||
final String errorMessage = String.format(
|
final String errorMessage = String.format(
|
||||||
"Validator function not found for attribute type: %s",
|
"Validator function not found for attribute type: %s",
|
||||||
|
@ -161,16 +161,27 @@ public class EamArtifactUtil {
|
|||||||
}
|
}
|
||||||
} else if (correlationType.getId() == CorrelationAttributeInstance.USBID_TYPE_ID
|
} else if (correlationType.getId() == CorrelationAttributeInstance.USBID_TYPE_ID
|
||||||
&& BlackboardArtifact.ARTIFACT_TYPE.TSK_DEVICE_ATTACHED.getTypeID() == artifactTypeID) {
|
&& BlackboardArtifact.ARTIFACT_TYPE.TSK_DEVICE_ATTACHED.getTypeID() == artifactTypeID) {
|
||||||
|
|
||||||
value = bbArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DEVICE_ID)).getValueString();
|
value = bbArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DEVICE_ID)).getValueString();
|
||||||
} else if (correlationType.getId() == CorrelationAttributeInstance.SSID_TYPE_ID
|
} else if (correlationType.getId() == CorrelationAttributeInstance.SSID_TYPE_ID
|
||||||
&& BlackboardArtifact.ARTIFACT_TYPE.TSK_WIFI_NETWORK.getTypeID() == artifactTypeID) {
|
&& BlackboardArtifact.ARTIFACT_TYPE.TSK_WIFI_NETWORK.getTypeID() == artifactTypeID) {
|
||||||
value = bbArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SSID)).getValueString();
|
value = bbArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SSID)).getValueString();
|
||||||
}
|
// } else if (correlationType.getId() == CorrelationAttributeInstance.MAC_TYPE_ID
|
||||||
// else if (correlationType.getId() == CorrelationAttributeInstance.MAC_TYPE_ID
|
// && (BlackboardArtifact.ARTIFACT_TYPE.TSK_DEVICE_INFO.getTypeID() == artifactTypeID
|
||||||
// && BlackboardArtifact.ARTIFACT_TYPE.TSK_DEVICE_ATTACHED.getTypeID() == artifactTypeID) {
|
// || BlackboardArtifact.ARTIFACT_TYPE.TSK_BLUETOOTH_PAIRING == artifactTypeID
|
||||||
// value = bbArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DEVICE_ID)).getValueString();
|
// || BlackboardArtifact.ARTIFACT_TYPE.TSK_BLUETOOTH_ADAPTER == artifactTypeID
|
||||||
// } //WJS-TODO enable actually making the mac address attrs when tsk_artifacts and attrs added
|
// || BlackboardArtifact.ARTIFACT_TYPE.TSK_DEVICE_ATTACHED == artifactTypeID)) {
|
||||||
|
// value = bbArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_MAC_ADDRESS)).getValueString();
|
||||||
|
// } else if (correlationType.getId() == CorrelationAttributeInstance.IMEI_TYPE_ID
|
||||||
|
// && BlackboardArtifact.ARTIFACT_TYPE.TSK_DEVICE_INFO.getTypeID() == artifactTypeID) {
|
||||||
|
// value = bbArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_IMEI)).getValueString();
|
||||||
|
// } else if (correlationType.getId() == CorrelationAttributeInstance.IMSI_TYPE_ID
|
||||||
|
// && BlackboardArtifact.ARTIFACT_TYPE.TSK_DEVICE_INFO.getTypeID() == artifactTypeID) {
|
||||||
|
// value = bbArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_IMSI)).getValueString();
|
||||||
|
// } else if (correlationType.getId() == CorrelationAttributeInstance.MAC_TYPE_ID
|
||||||
|
// && BlackboardArtifact.ARTIFACT_TYPE.TSK_DEVICE_INFO.getTypeID() == artifactTypeID) {
|
||||||
|
// value = bbArtifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_ICID)).getValueString();
|
||||||
|
} //WJS-TODO enable actually making the mac address attrs when tsk_artifacts and attrs added
|
||||||
|
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
logger.log(Level.SEVERE, "Error getting attribute while getting type from BlackboardArtifact.", ex); // NON-NLS
|
logger.log(Level.SEVERE, "Error getting attribute while getting type from BlackboardArtifact.", ex); // NON-NLS
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user