diff --git a/Core/ivy.xml b/Core/ivy.xml index 9ba4a3c371..e6c513fdf6 100644 --- a/Core/ivy.xml +++ b/Core/ivy.xml @@ -44,6 +44,7 @@ + diff --git a/Core/nbproject/project.properties b/Core/nbproject/project.properties index 2a952926ba..541ef8e4c6 100644 --- a/Core/nbproject/project.properties +++ b/Core/nbproject/project.properties @@ -51,6 +51,7 @@ file.reference.jul-to-slf4j-1.7.25.jar=release\\modules\\ext\\jul-to-slf4j-1.7.2 file.reference.juniversalchardet-1.0.3.jar=release\\modules\\ext\\juniversalchardet-1.0.3.jar file.reference.junrar-2.0.0.jar=release\\modules\\ext\\junrar-2.0.0.jar file.reference.jython-standalone-2.7.0.jar=release/modules/ext/jython-standalone-2.7.0.jar +file.reference.libphonenumber-3.5.jar=release/modules/ext/libphonenumber-3.5.jar file.reference.mchange-commons-java-0.2.9.jar=release/modules/ext/mchange-commons-java-0.2.9.jar file.reference.metadata-extractor-2.11.0.jar=release\\modules\\ext\\metadata-extractor-2.11.0.jar file.reference.netcdf4-4.5.5.jar=release\\modules\\ext\\netcdf4-4.5.5.jar diff --git a/Core/nbproject/project.xml b/Core/nbproject/project.xml index c33dabfbc7..8f2eb52c85 100644 --- a/Core/nbproject/project.xml +++ b/Core/nbproject/project.xml @@ -405,6 +405,10 @@ ext/okhttp-2.7.5.jar release/modules/ext/okhttp-2.7.5.jar + + ext/libphonenumber-3.5.jar + release/modules/ext/libphonenumber-3.5.jar + ext/tika-core-1.20.jar release\modules\ext\tika-core-1.20.jar @@ -517,6 +521,10 @@ ext/google-http-client-1.29.0.jar release/modules/ext/google-http-client-1.29.0.jar + + ext/sleuthkit-postgresql-4.7.0.jar + release/modules/ext/sleuthkit-postgresql-4.7.0.jar + ext/bcpkix-jdk15on-1.60.jar release\modules\ext\bcpkix-jdk15on-1.60.jar @@ -605,10 +613,6 @@ ext/jbig2-imageio-3.0.2.jar release\modules\ext\jbig2-imageio-3.0.2.jar - - ext/sleuthkit-postgresql-4.7.0.jar - release/modules/ext/sleuthkit-postgresql-4.7.0.jar - ext/apache-mime4j-dom-0.8.2.jar release\modules\ext\apache-mime4j-dom-0.8.2.jar diff --git a/Core/src/org/sleuthkit/autopsy/communications/relationships/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/communications/relationships/Bundle.properties-MERGED index 3d6fbef0cb..73d807796e 100755 --- a/Core/src/org/sleuthkit/autopsy/communications/relationships/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/communications/relationships/Bundle.properties-MERGED @@ -11,6 +11,7 @@ ContactNode_Name=Name ContactNode_Office_Number=Office Number ContactNode_Phone=Phone Number ContactNode_URL=URL +ContactsViewer_columnHeader_Country=Country ContactsViewer_columnHeader_Email=Email ContactsViewer_columnHeader_Name=Name ContactsViewer_columnHeader_Phone=Phone diff --git a/Core/src/org/sleuthkit/autopsy/communications/relationships/ContactNode.java b/Core/src/org/sleuthkit/autopsy/communications/relationships/ContactNode.java index 8dbf58acef..80a6795ab3 100755 --- a/Core/src/org/sleuthkit/autopsy/communications/relationships/ContactNode.java +++ b/Core/src/org/sleuthkit/autopsy/communications/relationships/ContactNode.java @@ -18,6 +18,9 @@ */ package org.sleuthkit.autopsy.communications.relationships; +import com.google.i18n.phonenumbers.NumberParseException; +import com.google.i18n.phonenumbers.PhoneNumberUtil; +import com.google.i18n.phonenumbers.Phonenumber; import java.util.ArrayList; import java.util.List; import java.util.TimeZone; @@ -70,7 +73,7 @@ final class ContactNode extends BlackboardArtifactNode { @Override protected Sheet createSheet() { Sheet sheet = new Sheet(); - + final BlackboardArtifact artifact = getArtifact(); BlackboardArtifact.ARTIFACT_TYPE fromID = BlackboardArtifact.ARTIFACT_TYPE.fromID(artifact.getArtifactTypeID()); if (fromID != TSK_CONTACT) { @@ -103,26 +106,26 @@ final class ContactNode extends BlackboardArtifactNode { otherList.add(bba); } } - - addPropertiesToSheet(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME.getLabel(), - sheetSet, nameList); - addPropertiesToSheet(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER.getLabel(), - sheetSet, phoneNumList); - addPropertiesToSheet(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_EMAIL.getLabel(), - sheetSet, emailList); + + addPropertiesToSheet(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME.getLabel(), + sheetSet, nameList); + addPropertiesToSheet(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER.getLabel(), + sheetSet, phoneNumList); + addPropertiesToSheet(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_EMAIL.getLabel(), + sheetSet, emailList); for (BlackboardAttribute bba : otherList) { sheetSet.put(new NodeProperty<>(bba.getAttributeType().getTypeName(), bba.getAttributeType().getDisplayName(), "", bba.getDisplayString())); } - + List children = artifact.getChildren(); - if(children != null) { + if (children != null) { int count = 0; String imageLabelPrefix = "Image"; - for(Content child: children) { - if(child instanceof AbstractFile) { + for (Content child : children) { + if (child instanceof AbstractFile) { String imageLabel = imageLabelPrefix; - if(count > 0) { + if (count > 0) { imageLabel = imageLabelPrefix + "-" + count; } sheetSet.put(new NodeProperty<>(imageLabel, imageLabel, imageLabel, child.getName())); @@ -136,14 +139,20 @@ final class ContactNode extends BlackboardArtifactNode { return sheet; } - + private void addPropertiesToSheet(String propertyID, Sheet.Set sheetSet, List attributeList) { int count = 0; for (BlackboardAttribute bba : attributeList) { if (count++ > 0) { sheetSet.put(new NodeProperty<>(propertyID + "_" + count, bba.getAttributeType().getDisplayName(), "", bba.getDisplayString())); + if (bba.getAttributeType().getTypeName().startsWith("TSK_PHONE")) { + sheetSet.put(new NodeProperty<>("Country" + "_" + count, bba.getAttributeType().getDisplayName() + " Country", "", getCountryCode(bba.getValueString()))); + } } else { sheetSet.put(new NodeProperty<>(propertyID, bba.getAttributeType().getDisplayName(), "", bba.getDisplayString())); + if (bba.getAttributeType().getTypeName().startsWith("TSK_PHONE")) { + sheetSet.put(new NodeProperty<>("Country", bba.getAttributeType().getDisplayName() + " Country", "", getCountryCode(bba.getValueString()))); + } } } } @@ -175,4 +184,23 @@ final class ContactNode extends BlackboardArtifactNode { public String getSourceName() { return getDisplayName(); } + + private String getCountryCode(String phoneNumber) { + String regionCode = ""; + try { + PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance(); + Phonenumber.PhoneNumber phoneNum = phoneNumberUtil.parse(phoneNumber, "US"); + regionCode = phoneNumberUtil.getRegionCodeForNumber(phoneNum); + + if (regionCode == null) { + return ""; + } else { + return regionCode; + } + } catch (NumberParseException ex) { + logger.log(Level.WARNING, "Error getting country code, for phone number: {0}", phoneNumber); + return regionCode; + } + } + } diff --git a/Core/src/org/sleuthkit/autopsy/communications/relationships/ContactsViewer.java b/Core/src/org/sleuthkit/autopsy/communications/relationships/ContactsViewer.java index 33afae7251..41d1ba3445 100755 --- a/Core/src/org/sleuthkit/autopsy/communications/relationships/ContactsViewer.java +++ b/Core/src/org/sleuthkit/autopsy/communications/relationships/ContactsViewer.java @@ -59,6 +59,7 @@ public final class ContactsViewer extends JPanel implements RelationshipsViewer{ "ContactsViewer_columnHeader_Name=Name", "ContactsViewer_columnHeader_Phone=Phone", "ContactsViewer_columnHeader_Email=Email", + "ContactsViewer_columnHeader_Country=Country", "ContactsViewer_noContacts_message=" }) @@ -96,7 +97,8 @@ public final class ContactsViewer extends JPanel implements RelationshipsViewer{ outline = outlineViewPanel.getOutlineView().getOutline(); outlineViewPanel.getOutlineView().setPropertyColumns( "TSK_EMAIL", BlackboardAttribute.ATTRIBUTE_TYPE.TSK_EMAIL.getDisplayName(), - "TSK_PHONE_NUMBER", BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER.getDisplayName() + "TSK_PHONE_NUMBER", BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER.getDisplayName(), + "Country", "Country" ); outline.setRootVisible(false); ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(Bundle.ContactsViewer_columnHeader_Name());