Skip to main content

FindEmailCampaign

This Script is part of the Phishing Campaign Pack.#

Find a campaign of emails based on their textual similarity.

This script can be executed upon each new incoming Phishing incident. The script would search among past incidents whether past incidents with high text similarity to the current one exist. The script uses NLP techniques for calculating text similarity. The text similarity is calculated based on the email body and email subject fields of the phishing incident. If such incidents were found, the script would aggregate details regarding them, such as their senders, recipients, dates, mutual indicators, snippets from the email, etc. This script's purpose is to provide you an immediate background for phishing incidents when similar incidents exist, and furthermore, help you to detect phishing campaigns more easily.

Script Data#


NameDescription
Script Typepython3
Tagsml, phishing
Cortex XSOAR Version5.0.0

Used In#


This script is used in the following playbooks and scripts.

  • Detect & Manage Phishing Campaigns

Inputs#


Argument NameDescription
incidentTypeFieldNameThe name of the incident field in which the incident type is stored. Default is "type". Change this argument only if you are using a custom field for specifying the incident type.
incidentTypesA comma-separated list of incident types by which to filter. Specify "None" to search through all incident types.
existingIncidentsLookbackThe date from which to search for similar incidents. Date format is the same as in the incidents query page. For example: "3 days ago", "2019-01-01T00:00:00 +0200".
queryAdditional text by which to query incidents.
limitThe maximum number of incidents to fetch.
emailSubjectThe name of the field that contains the email subject.
emailBodyThe name of the field that contains the email body.
emailBodyHTMLThe name of the field that contains the HTML version of the email body.
emailFromThe name of the field that contains the email sender.
statusScopeWhether to compare the new incident to closed incidents, unclosed incidents, or all incidents.
thresholdThreshold by which to consider incidents as similar. The range of values is 0-1.
maxIncidentsToReturnThe maximum number of incidents to display as part of a campaign. If a campaign includes a higher number of incidents, the results will contain only this amount of incidents.
minIncidentsForCampaignMinimum number of incidents to consider as a campaign.
minUniqueRecipientsMinimum number of unique recipients of similar email incidents to consider as a campaign.
fieldsToDisplayA comma-seperated list of fields to display. An example is "emailclassification,closereason". If a list of fields is provided, and a campaign is detected, these incidents fields will be displayed.
includeSelfInclude the current incident in EmailCampaign path in context.

Outputs#


PathDescriptionType
EmailCampaign.isCampaignFoundWhether a campaign was found.Boolean
EmailCampaign.involvedIncidentsCountThe number of incidents involved in the campaign.Number
EmailCampaign.incidents.idThe IDs of the incidents involved in the campaign.Unknown
EmailCampaign.incidents.similarityThe textual similarity of the related emails to the current incident.Unknown
EmailCampaign.incidents.emailfromThe senders of the emails involved in the campaign.Unknown
EmailCampaign.incidents.emailfromdomainThe domains of the email senders involved in the campaign.Unknown
EmailCampaign.incidents.recipientsA list of email addresses of recipients involved in the campaign. The list is comprised of the following fields, "Email To", "Email CC", "Email BCC".Unknown
EmailCampaign.incidents.recipientsdomainA list of the domains of the email addresses of recipients involved in the campaign. The list is comprised of the following fields, "Email To", "Email CC", "Email BCC".Unknown
EmailCampaign.indicators.idThe IDs of the mututal indicators of the incidents involved in the campaign.Unknown
EmailCampaign.indicators.valueThe values of the mututal indicators of the incidents involved in the campaign.Unknown
EmailCampaign.fieldsToDisplayList of fields to display in the linked list table.Unknown
EmailCampaign.firstIncidentDateThe occurrence date of the oldest incident in the campaign.unknown
incident.emailcampaignsummaryMarkdown table with email campaign summary.string
incident.emailcampaignsnippetsMarkdown table with email content summary.string
incident.emailcampaignmutualindicatorsMarkdown table with relevant indicators.string
incident.emailcampaigncanvasLink to the campaign canvas.string