mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Merge pull request #7485 from APriestman/8258_createAccountsWithAttributes
8258 Add attributes to credit card hit artifact.
This commit is contained in:
commit
126d2b6aba
@ -287,7 +287,7 @@ final class XRYCallsFileParser extends AbstractSingleEntityParser {
|
|||||||
if (callerId != null) {
|
if (callerId != null) {
|
||||||
try {
|
try {
|
||||||
currentCase.getCommunicationsManager().createAccountFileInstance(
|
currentCase.getCommunicationsManager().createAccountFileInstance(
|
||||||
Account.Type.PHONE, callerId, PARSER_NAME, parent, null);
|
Account.Type.PHONE, callerId, PARSER_NAME, parent, null, null);
|
||||||
} catch (InvalidAccountIDException ex) {
|
} catch (InvalidAccountIDException ex) {
|
||||||
logger.log(Level.WARNING, String.format("Invalid account identifier %s", callerId), ex);
|
logger.log(Level.WARNING, String.format("Invalid account identifier %s", callerId), ex);
|
||||||
}
|
}
|
||||||
@ -300,7 +300,7 @@ final class XRYCallsFileParser extends AbstractSingleEntityParser {
|
|||||||
for (String phone : calleeList) {
|
for (String phone : calleeList) {
|
||||||
try {
|
try {
|
||||||
currentCase.getCommunicationsManager().createAccountFileInstance(
|
currentCase.getCommunicationsManager().createAccountFileInstance(
|
||||||
Account.Type.PHONE, phone, PARSER_NAME, parent, null);
|
Account.Type.PHONE, phone, PARSER_NAME, parent, null, null);
|
||||||
} catch (InvalidAccountIDException ex) {
|
} catch (InvalidAccountIDException ex) {
|
||||||
logger.log(Level.WARNING, String.format("Invalid account identifier %s", phone), ex);
|
logger.log(Level.WARNING, String.format("Invalid account identifier %s", phone), ex);
|
||||||
}
|
}
|
||||||
|
@ -318,7 +318,7 @@ final class XRYMessagesFileParser implements XRYFileParser {
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
currentCase.getCommunicationsManager().createAccountFileInstance(
|
currentCase.getCommunicationsManager().createAccountFileInstance(
|
||||||
Account.Type.PHONE, pair.getValue(), PARSER_NAME, parent, null);
|
Account.Type.PHONE, pair.getValue(), PARSER_NAME, parent, null, null);
|
||||||
} catch (InvalidAccountIDException ex) {
|
} catch (InvalidAccountIDException ex) {
|
||||||
logger.log(Level.WARNING, String.format("Invalid account identifier %s", pair.getValue()), ex);
|
logger.log(Level.WARNING, String.format("Invalid account identifier %s", pair.getValue()), ex);
|
||||||
}
|
}
|
||||||
|
@ -638,7 +638,7 @@ final class RegexQuery implements KeywordSearchQuery {
|
|||||||
* for the hit and looked up based on the parsed bank identifcation
|
* for the hit and looked up based on the parsed bank identifcation
|
||||||
* number.
|
* number.
|
||||||
*/
|
*/
|
||||||
Collection<BlackboardAttribute> attributes = new ArrayList<>();
|
List<BlackboardAttribute> attributes = new ArrayList<>();
|
||||||
|
|
||||||
Map<BlackboardAttribute.Type, BlackboardAttribute> parsedTrackAttributeMap = new HashMap<>();
|
Map<BlackboardAttribute.Type, BlackboardAttribute> parsedTrackAttributeMap = new HashMap<>();
|
||||||
Matcher matcher = CREDIT_CARD_TRACK1_PATTERN.matcher(hit.getSnippet());
|
Matcher matcher = CREDIT_CARD_TRACK1_PATTERN.matcher(hit.getSnippet());
|
||||||
@ -720,13 +720,10 @@ final class RegexQuery implements KeywordSearchQuery {
|
|||||||
* Create an account instance.
|
* Create an account instance.
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
AccountFileInstance ccAccountInstance = Case.getCurrentCaseThrows().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD, ccnAttribute.getValueString(), MODULE_NAME, content, ingestJobId);
|
Case.getCurrentCaseThrows().getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.CREDIT_CARD,
|
||||||
|
ccnAttribute.getValueString(), MODULE_NAME, content, attributes, ingestJobId);
|
||||||
ccAccountInstance.addAttributes(attributes);
|
|
||||||
|
|
||||||
} catch (TskCoreException | NoCurrentCaseException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
LOGGER.log(Level.SEVERE, "Error creating CCN account instance", ex); //NON-NLS
|
LOGGER.log(Level.SEVERE, "Error creating CCN account instance", ex); //NON-NLS
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
if (isMbox || isEMLFile || isPstFile || isVcardFile) {
|
if (isMbox || isEMLFile || isPstFile || isVcardFile) {
|
||||||
try {
|
try {
|
||||||
communicationArtifactsHelper = new CommunicationArtifactsHelper(currentCase.getSleuthkitCase(),
|
communicationArtifactsHelper = new CommunicationArtifactsHelper(currentCase.getSleuthkitCase(),
|
||||||
EmailParserModuleFactory.getModuleName(), abstractFile, Account.Type.EMAIL);
|
EmailParserModuleFactory.getModuleName(), abstractFile, Account.Type.EMAIL, context.getJobId());
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
logger.log(Level.SEVERE, String.format("Failed to create CommunicationArtifactsHelper for file with object id = %d", abstractFile.getId()), ex);
|
logger.log(Level.SEVERE, String.format("Failed to create CommunicationArtifactsHelper for file with object id = %d", abstractFile.getId()), ex);
|
||||||
return ProcessResult.ERROR;
|
return ProcessResult.ERROR;
|
||||||
@ -713,7 +713,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
if (senderAddressList.size() == 1) {
|
if (senderAddressList.size() == 1) {
|
||||||
senderAddress = senderAddressList.get(0);
|
senderAddress = senderAddressList.get(0);
|
||||||
try {
|
try {
|
||||||
senderAccountInstance = accountFileInstanceCache.getAccountInstance(senderAddress);
|
senderAccountInstance = accountFileInstanceCache.getAccountInstance(senderAddress, context);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
logger.log(Level.WARNING, "Failed to create account for email address " + senderAddress, ex); //NON-NLS
|
logger.log(Level.WARNING, "Failed to create account for email address " + senderAddress, ex); //NON-NLS
|
||||||
}
|
}
|
||||||
@ -736,7 +736,7 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
AccountFileInstance recipientAccountInstance = accountFileInstanceCache.getAccountInstance(addr);
|
AccountFileInstance recipientAccountInstance = accountFileInstanceCache.getAccountInstance(addr, context);
|
||||||
recipientAccountInstances.add(recipientAccountInstance);
|
recipientAccountInstances.add(recipientAccountInstance);
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
logger.log(Level.WARNING, "Failed to create account for email address " + addr, ex); //NON-NLS
|
logger.log(Level.WARNING, "Failed to create account for email address " + addr, ex); //NON-NLS
|
||||||
@ -864,19 +864,20 @@ public final class ThunderbirdMboxFileIngestModule implements FileIngestModule {
|
|||||||
* Get the account file instance from the cache or the database.
|
* Get the account file instance from the cache or the database.
|
||||||
*
|
*
|
||||||
* @param email The email for this account.
|
* @param email The email for this account.
|
||||||
|
* @param context The current ingest job context.
|
||||||
*
|
*
|
||||||
* @return The corresponding AccountFileInstance
|
* @return The corresponding AccountFileInstance
|
||||||
*
|
*
|
||||||
* @throws TskCoreException
|
* @throws TskCoreException
|
||||||
*/
|
*/
|
||||||
AccountFileInstance getAccountInstance(String email) throws TskCoreException {
|
AccountFileInstance getAccountInstance(String email, IngestJobContext context) throws TskCoreException {
|
||||||
if (cacheMap.containsKey(email)) {
|
if (cacheMap.containsKey(email)) {
|
||||||
return cacheMap.get(email);
|
return cacheMap.get(email);
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountFileInstance accountInstance
|
AccountFileInstance accountInstance
|
||||||
= currentCase.getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.EMAIL, email,
|
= currentCase.getSleuthkitCase().getCommunicationsManager().createAccountFileInstance(Account.Type.EMAIL, email,
|
||||||
EmailParserModuleFactory.getModuleName(), file);
|
EmailParserModuleFactory.getModuleName(), file, null, context.getJobId());
|
||||||
cacheMap.put(email, accountInstance);
|
cacheMap.put(email, accountInstance);
|
||||||
return accountInstance;
|
return accountInstance;
|
||||||
}
|
}
|
||||||
|
@ -521,7 +521,7 @@ final class VcardParser {
|
|||||||
// Add phone number as a TSK_ACCOUNT.
|
// Add phone number as a TSK_ACCOUNT.
|
||||||
try {
|
try {
|
||||||
AccountFileInstance phoneAccountInstance = tskCase.getCommunicationsManager().createAccountFileInstance(Account.Type.PHONE,
|
AccountFileInstance phoneAccountInstance = tskCase.getCommunicationsManager().createAccountFileInstance(Account.Type.PHONE,
|
||||||
telephoneText, EmailParserModuleFactory.getModuleName(), abstractFile);
|
telephoneText, EmailParserModuleFactory.getModuleName(), abstractFile, null, context.getJobId());
|
||||||
accountInstances.add(phoneAccountInstance);
|
accountInstances.add(phoneAccountInstance);
|
||||||
}
|
}
|
||||||
catch(TskCoreException ex) {
|
catch(TskCoreException ex) {
|
||||||
@ -549,7 +549,7 @@ final class VcardParser {
|
|||||||
// Add e-mail as a TSK_ACCOUNT.
|
// Add e-mail as a TSK_ACCOUNT.
|
||||||
try {
|
try {
|
||||||
AccountFileInstance emailAccountInstance = tskCase.getCommunicationsManager().createAccountFileInstance(Account.Type.EMAIL,
|
AccountFileInstance emailAccountInstance = tskCase.getCommunicationsManager().createAccountFileInstance(Account.Type.EMAIL,
|
||||||
emailValue, EmailParserModuleFactory.getModuleName(), abstractFile);
|
emailValue, EmailParserModuleFactory.getModuleName(), abstractFile, null, context.getJobId());
|
||||||
accountInstances.add(emailAccountInstance);
|
accountInstances.add(emailAccountInstance);
|
||||||
}
|
}
|
||||||
catch(TskCoreException ex) {
|
catch(TskCoreException ex) {
|
||||||
@ -575,7 +575,7 @@ final class VcardParser {
|
|||||||
DataSource dataSource = tskCase.getDataSource(dataSourceObjId);
|
DataSource dataSource = tskCase.getDataSource(dataSourceObjId);
|
||||||
deviceId = dataSource.getDeviceId();
|
deviceId = dataSource.getDeviceId();
|
||||||
deviceAccountInstance = tskCase.getCommunicationsManager().createAccountFileInstance(Account.Type.DEVICE,
|
deviceAccountInstance = tskCase.getCommunicationsManager().createAccountFileInstance(Account.Type.DEVICE,
|
||||||
deviceId, EmailParserModuleFactory.getModuleName(), abstractFile);
|
deviceId, EmailParserModuleFactory.getModuleName(), abstractFile, null, context.getJobId());
|
||||||
}
|
}
|
||||||
catch (TskCoreException ex) {
|
catch (TskCoreException ex) {
|
||||||
logger.log(Level.WARNING, String.format(
|
logger.log(Level.WARNING, String.format(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user