CrowdStrike Falcon Intel v2

CrowdStrike Threat intelligence service integration helps organizations defend themselves against adversary activity by investigating incidents, and accelerating alert triage and response.

Data Enrichment & Threat Intelligence · CrowdStrike Falcon Intel

Details

IDCrowdStrike Falcon Intel v2
ProviderCrowdStrike
CategoryData Enrichment & Threat Intelligence
From Version5.0.0
Docker Imagedemisto/python3:3.12.13.10116658
Supported ModulesAgentix XSIAM

README

Threat intelligence service by CrowdStrike focused on delivering a technical feed to help organizations better defend themselves against adversary activity.

Configure CrowdStrike Falcon Intel v2 in Cortex

Parameter Description Required
Server URL The server URL to which you want to connect True
credentials Client ID True
threshold Indicator Threshold. Minimum malicious confidence from Falcon Intel to consider the indicator malicious.(low, medium, high) False
proxy Use system proxy settings False
insecure Trust any certificate (not secure) False

Commands

You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.

file


Check file reputation.

Base Command

file

Input

Argument Name Description Required
file A comma-separated list of file hashes (MD5/SHA1/SHA256) to check. Required

Context Output

Path Type Description
File.MD5 String The MD5 hash of the file.
File.SHA1 String The SHA1 hash of the file.
File.SHA256 String The SHA256 hash of the file.
File.Malicious.Vendor String The vendor that reported the file as malicious.
File.Malicious.Description String A description explaining why the file was determined to be malicious.
DBotScore.Indicator String The indicator that was tested.
DBotScore.Type String The indicator type.
DBotScore.Vendor String The vendor used to calculate the score.
DBotScore.Score Number The actual score.
FalconIntel.Indicator.ID String The indicator ID.
FalconIntel.Indicator.Type String The indicator type.
FalconIntel.Indicator.Value String The indicator value.
FalconIntel.Indicator.LastUpdate Date The last time the indicator was updated.
FalconIntel.Indicator.PublishDate Date The time the indicator was published.
FalconIntel.Indicator.MaliciousConfidence String The confidence level by which an indicator is considered to be malicious
FalconIntel.Indicator.Reports String The report ID that the indicator is associated with
FalconIntel.Indicator.Actors String Actors that the indicator is associated
FalconIntel.Indicator.MalwareFamilies String A list of malware families that an indicator has been associated. An indicator may be associated with more than one malware family.
FalconIntel.Indicator.KillChains String The point in the kill chain at which an indicator is associated
FalconIntel.Indicator.DomainTypes String The domain type of domain indicators
FalconIntel.Indicator.IPAddressTypes String The address type of ip_address indicators
FalconIntel.Indicator.Relations.Indicator String Related Indicators
FalconIntel.Indicator.Type String The indicator type
FalconIntel.Indicator.Labels String Additional labels

Command Example

!file file=sha256_value

Context Example

{
    "DBotScore": {
        "Indicator": "sha256_value",
        "Score": 3,
        "Type": "file",
        "Vendor": "FalconIntel"
    },
    "FalconIntel": {
        "Indzicator": {
            "Actors": [
                "CIRCUSSPIDER"
            ],
            "ID": "hash_sha256_id",
            "Labels": [
                "CSD/CSA-201011",
                "ThreatType/Criminal",
                "CSD/CSWR-20018",
                "CSD/CSWR-20023",
                "CSD/CSDR-20035",
                "CSD/CSWR-20020",
                "CSD/CSWR-20024",
                "CSD/CSWR-20021",
                "MaliciousConfidence/High",
                "Malware/NetWalker"
            ],
            "MaliciousConfidence": "high",
            "MalwareFamilies": [
                "NetWalker"
            ],
            "Relations": [
                "hash_md5: 0432b62130ca06c04d5a12a5e9841300",
                "hash_sha1: fd2b8fff2c583a1af1b86f150be8f611a2292197"
            ],
            "Reports": [
                "CSA-201011",
                "CSWR-20018",
                "CSWR-20023",
                "CSDR-20035",
                "CSWR-20020",
                "CSWR-20024",
                "CSWR-20021",
                "CSA-200605",
                "CSA-200385",
                "CSDR-20090",
                "CSWR-20017",
                "CSIT-20081",
                "CSWR-20011"
            ],
            "Type": "hash_sha256",
            "Value": "sha256_value"
        }
    },
    "File": {
        "Actors": [
            "CIRCUSSPIDER"
        ],
        "Malicious": {
            "Description": "High confidence",
            "Vendor": "FalconIntel"
        },
        "MalwareFamilies": [
            "NetWalker"
        ],
        "Reports": [
            "CSA-201011",
            "CSWR-20018",
            "CSWR-20023",
            "CSDR-20035",
            "CSWR-20020",
            "CSWR-20024",
            "CSWR-20021",
            "CSA-200605",
            "CSA-200385",
            "CSDR-20090",
            "CSWR-20017",
            "CSIT-20081",
            "CSWR-20011"
        ],
        "SHA256": "sha256_value"
    }
}

Human Readable Output

Falcon Intel file reputation

Actors ID Labels Malicious Confidence Malware Families Relations Reports Type Value
CIRCUSSPIDER hash_sha256_sha256_value CSD/CSA-201011,
ThreatType/Criminal,
CSD/CSWR-20018,
CSD/CSWR-20023,
CSD/CSDR-20035,
CSD/CSWR-20020,
CSD/CSWR-20024,
CSD/CSWR-20021,
MaliciousConfidence/High,
Malware/NetWalker
high NetWalker hash_md5: 0432b62130ca06c04d5a12a5e9841300,
hash_sha1: fd2b8fff2c583a1af1b86f150be8f611a2292197
CSA-201011,
CSWR-20018,
CSWR-20023,
CSDR-20035,
CSWR-20020,
CSWR-20024,
CSWR-20021,
CSA-200605,
CSA-200385,
CSDR-20090,
CSWR-20017,
CSIT-20081,
CSWR-20011
hash_sha256 sha256_value

url


Check the given URL reputation.

Notice: Submitting indicators using this command might make the indicator data publicly available. See the vendor’s documentation for more details.

Base Command

url

Input

Argument Name Description Required
url A comma-separated list of URLs to check. Required

Context Output

Path Type Description
URL.Data String The URL
URL.Malicious.Vendor String The vendor reporting the URL as malicious.
URL.Malicious.Description String A description of the malicious URL.
DBotScore.Indicator String The indicator that was tested.
DBotScore.Type String The indicator type.
DBotScore.Vendor String The vendor used to calculate the score.
DBotScore.Score Number The actual score.
FalconIntel.Indicator.ID String The indicator ID.
FalconIntel.Indicator.Type String The indicator type.
FalconIntel.Indicator.Value String The indicator value.
FalconIntel.Indicator.LastUpdate Date The last time the indicator was updated.
FalconIntel.Indicator.PublishDate Date The time the indicator was published.
FalconIntel.Indicator.MaliciousConfidence String The confidence level by which an indicator is considered to be malicious
FalconIntel.Indicator.Reports String The report ID that the indicator is associated with
FalconIntel.Indicator.Actors String Actors that the indicator is associated
FalconIntel.Indicator.MalwareFamilies String A list of malware families that an indicator has been associated. An indicator may be associated with more than one malware family.
FalconIntel.Indicator.KillChains String The point in the kill chain at which an indicator is associated
FalconIntel.Indicator.DomainTypes String The domain type of domain indicators
FalconIntel.Indicator.IPAddressTypes String The address type of ip_address indicators
FalconIntel.Indicator.Relations.Indicator String Related Indicators
FalconIntel.Indicator.Type String The indicator type
FalconIntel.Indicator.Labels String Additional labels

Command Example

!url url=https://withifceale.top/treusparq.php

Context Example

{
    "DBotScore": {
        "Indicator": "https://withifceale.top/treusparq.php",
        "Score": 3,
        "Type": "url",
        "Vendor": "FalconIntel"
    },
    "FalconIntel": {
        "Indicator": {
            "ID": "url_https://withifceale.top/treusparq.php",
            "KillChains": [
                "C2"
            ],
            "Labels": [
                "CSD/CSA-200342",
                "KillChain/C2",
                "Malware/Zloader",
                "CSD/CSDR-20011",
                "CSD/CSIT-20009",
                "CSD/CSA-191551",
                "MaliciousConfidence/High",
                "ThreatType/Criminal",
                "CSD/CSA-200038",
                "ThreatType/Banking"
            ],
            "MaliciousConfidence": "high",
            "MalwareFamilies": [
                "Zloader"
            ],
            "Relations": [
                "hash_sha256: sha256_value",
                "hash_sha256: sha256_value",
                "hash_sha256: sha256_value",
                "hash_md5: md5_value",
                "hash_md5: md5_value",
                "hash_sha1: sha1_value",
                "hash_sha1: sha1_value",
                "hash_md5: md5_value",
                "hash_sha1: sha1_value",
                "hash_sha1: sha1_value"
            ],
            "Reports": [
                "CSA-200342",
                "CSDR-20011",
                "CSIT-20009",
                "CSA-191551",
                "CSA-200038",
                "CSIT-17112",
                "CSA-200149"
            ],
            "Type": "url",
            "Value": "https://withifceale.top/treusparq.php"
        }
    },
    "URL": {
        "Data": "https://withifceale.top/treusparq.php",
        "KillChains": [
            "C2"
        ],
        "Malicious": {
            "Description": "High confidence",
            "Vendor": "FalconIntel"
        },
        "MalwareFamilies": [
            "Zloader"
        ],
        "Reports": [
            "CSA-200342",
            "CSDR-20011",
            "CSIT-20009",
            "CSA-191551",
            "CSA-200038",
            "CSIT-17112",
            "CSA-200149"
        ]
    }
}

Human Readable Output

Falcon Intel URL reputation

ID Kill Chains Labels Malicious Confidence Malware Families Relations Reports Type Value
url_https://withifceale.top/treusparq.php C2 CSD/CSA-200342,
KillChain/C2,
Malware/Zloader,
CSD/CSDR-20011,
CSD/CSIT-20009,
CSD/CSA-191551,
MaliciousConfidence/High,
ThreatType/Criminal,
CSD/CSA-200038,
ThreatType/Banking
high Zloader hash_sha256: sha256_value,
hash_sha256: sha256_value,
hash_sha256: sha256_value,
hash_md5: md5_value,
hash_md5: md5_value,
hash_sha1: sha1_value,
hash_sha1: sha1_value,
hash_md5: md5_value,
hash_sha1: sha1_value,
hash_sha1: sha1_value
CSA-200342,
CSDR-20011,
CSIT-20009,
CSA-191551,
CSA-200038,
CSIT-17112,
CSA-200149
url https://withifceale.top/treusparq.php

domain


Check the given URL reputation.

Notice: Submitting indicators using this command might make the indicator data publicly available. See the vendor’s documentation for more details.

Base Command

domain

Input

Argument Name Description Required
domain A comma-seperated list of domains to check. Required

Context Output

Path Type Description
Domain.Name String The domain name, for example: “google.com”.
Domain.Malicious.Vendor String The vendor reporting the domain as malicious.
Domain.Malicious.Description String A description explaining why the domain was reported as malicious.
DBotScore.Indicator String The indicator that was tested.
DBotScore.Type String The indicator type.
DBotScore.Vendor String The vendor used to calculate the score.
DBotScore.Score Number The actual score.
FalconIntel.Indicator.ID String The indicator ID.
FalconIntel.Indicator.Type String The indicator type.
FalconIntel.Indicator.Value String The indicator value.
FalconIntel.Indicator.LastUpdate Date The last time the indicator was updated.
FalconIntel.Indicator.PublishDate Date The time the indicator was published.
FalconIntel.Indicator.MaliciousConfidence String The confidence level by which an indicator is considered to be malicious
FalconIntel.Indicator.Reports String The report ID that the indicator is associated with
FalconIntel.Indicator.Actors String Actors that the indicator is associated
FalconIntel.Indicator.MalwareFamilies String A list of malware families that an indicator has been associated. An indicator may be associated with more than one malware family.
FalconIntel.Indicator.KillChains String The point in the kill chain at which an indicator is associated
FalconIntel.Indicator.DomainTypes String The domain type of domain indicators
FalconIntel.Indicator.IPAddressTypes String The address type of ip_address indicators
FalconIntel.Indicator.Relations.Indicator String Related Indicators
FalconIntel.Indicator.Type String The indicator type
FalconIntel.Indicator.Labels String Additional labels

Command Example

!domain domain=xeemoquo.top

Context Example

{
    "DBotScore": {
        "Indicator": "xeemoquo.top",
        "Score": 3,
        "Type": "domain",
        "Vendor": "FalconIntel"
    },
    "Domain": {
        "KillChains": [
            "C2"
        ],
        "Malicious": {
            "Description": "High confidence",
            "Vendor": "FalconIntel"
        },
        "Name": "xeemoquo.top",
        "Reports": [
            "CSA-191551",
            "CSA-200038",
            "CSDR-20011",
            "CSA-200149"
        ]
    },
    "FalconIntel": {
        "Indicator": {
            "ID": "domain_xeemoquo.top",
            "KillChains": [
                "C2"
            ],
            "Labels": [
                "CSD/CSA-191551",
                "CSD/CSA-200038",
                "MaliciousConfidence/High",
                "KillChain/C2",
                "CSD/CSDR-20011",
                "CSD/CSA-200149"
            ],
            "MaliciousConfidence": "high",
            "Relations": [
                "hash_md5: md5_value",
                "hash_sha1: sha1_value",
                "hash_sha1: sha1_value",
                "hash_md5: md5_value",
                "hash_sha1: sha1_value",
                "hash_md5: md5_value",
                "hash_md5: md5_value",
                "hash_sha256: sha256_value",
                "hash_sha256: sha256_value",
                "hash_sha1: sha1_value"
            ],
            "Reports": [
                "CSA-191551",
                "CSA-200038",
                "CSDR-20011",
                "CSA-200149"
            ],
            "Type": "domain",
            "Value": "xeemoquo.top"
        }
    }
}

Human Readable Output

Falcon Intel domain reputation

ID Kill Chains Labels Malicious Confidence Relations Reports Type Value
domain_xeemoquo.top C2 CSD/CSA-191551,
CSD/CSA-200038,
MaliciousConfidence/High,
KillChain/C2,
CSD/CSDR-20011,
CSD/CSA-200149
high hash_md5: md5_value,
hash_sha1: sha1_value,
hash_sha1: sha1_value,
hash_md5: md5_value,
hash_sha1: sha1_value,
hash_md5: md5_value,
hash_md5: md5_value,
hash_sha256: sha256_value,
hash_sha256: sha256_value,
hash_sha1: sha1_value
CSA-191551,
CSA-200038,
CSDR-20011,
CSA-200149
domain xeemoquo.top

ip


Check IP reputation.

Base Command

ip

Input

Argument Name Description Required
ip A comma-separated list of IP addresses to check. Required

Context Output

Path Type Description
IP.Address String IP address
IP.Malicious.Vendor String The vendor reporting the IP address as malicious.
IP.Malicious.Description String A description explaining why the IP address was reported as malicious.
DBotScore.Indicator String The indicator that was tested.
DBotScore.Type String The indicator type.
DBotScore.Vendor String The vendor used to calculate the score.
DBotScore.Score Number The actual score.
FalconIntel.Indicator.ID String The indicator ID.
FalconIntel.Indicator.Type String The indicator type.
FalconIntel.Indicator.Value String The indicator value.
FalconIntel.Indicator.LastUpdate Date The last time the indicator was updated.
FalconIntel.Indicator.PublishDate Date The time the indicator was published.
FalconIntel.Indicator.MaliciousConfidence String The confidence level by which an indicator is considered to be malicious
FalconIntel.Indicator.Reports String The report ID that the indicator is associated with
FalconIntel.Indicator.Actors String Actors that the indicator is associated
FalconIntel.Indicator.MalwareFamilies String A list of malware families that an indicator has been associated. An indicator may be associated with more than one malware family.
FalconIntel.Indicator.KillChains String The point in the kill chain at which an indicator is associated
FalconIntel.Indicator.DomainTypes String The domain type of domain indicators
FalconIntel.Indicator.IPAddressTypes String The address type of ip_address indicators
FalconIntel.Indicator.Relations.Indicator String Related Indicators
FalconIntel.Indicator.Type String The indicator type
FalconIntel.Indicator.Labels String Additional labels

Command Example

!ip ip=8.8.8.8

Context Example

{
    "DBotScore": {
        "Indicator": "8.8.8.8",
        "Score": 3,
        "Type": "ip",
        "Vendor": "FalconIntel"
    },
    "FalconIntel": {
        "Indicator": {
            "Actors": [
                "QUILTEDTIGER"
            ],
            "ID": "ip_address_8.8.8.8",
            "KillChains": [
                "C2"
            ],
            "Labels": [
                "KillChain/C2",
                "Malware/Badnews",
                "Actor/QUILTEDTIGER",
                "ThreatType/Targeted",
                "MitreATTCK/CommandAndControl/StandardApplicationLayerProtocol",
                "MaliciousConfidence/High",
                "MitreATTCK/CommandAndControl/CommonlyUsedPort"
            ],
            "MaliciousConfidence": "high",
            "MalwareFamilies": [
                "Badnews"
            ],
            "Relations": [
                "hash_sha1: sha1_value",
                "hash_sha256: sha256_value",
                "hash_md5: md5_value",
                "hash_md5: md5_value",
                "hash_sha256: sha256_value",
                "hash_sha1: sha1_value",
                "hash_md5: md5_value",
                "hash_sha1: sha1_value",
                "hash_sha256: sha256_value",
                "hash_sha1: sha1_value"
            ],
            "Type": "ip_address",
            "Value": "8.8.8.8"
        }
    },
    "IP": {
        "Actors": [
            "QUILTEDTIGER"
        ],
        "Address": "8.8.8.8",
        "KillChains": [
            "C2"
        ],
        "Malicious": {
            "Description": "High confidence",
            "Vendor": "FalconIntel"
        },
        "MalwareFamilies": [
            "Badnews"
        ]
    }
}

Human Readable Output

Falcon Intel IP reputation

Actors ID Kill Chains Labels Malicious Confidence Malware Families Relations Type Value
QUILTEDTIGER ip_address_8.8.8.8 C2 KillChain/C2,
Malware/Badnews,
Actor/QUILTEDTIGER,
ThreatType/Targeted,
MitreATTCK/CommandAndControl/StandardApplicationLayerProtocol,
MaliciousConfidence/High,
MitreATTCK/CommandAndControl/CommonlyUsedPort
high Badnews hash_sha1: sha1_value,
hash_sha256: sha256_value,
hash_md5: md5_value,
hash_md5: md5_value,
hash_sha256: sha256_value,
hash_sha1: sha1_value,
hash_md5: md5_value,
hash_sha1: sha1_value,
hash_sha256: sha256_value,
hash_sha1: sha1_value
ip_address 8.8.8.8

cs-actors


Search known actors based on the given parameters.

Base Command

cs-actors

Input

Argument Name Description Required
query Search based on a query written in FQL (Falcon Query Language, See https://falcon.crowdstrike.com/support/documentation/45/falcon-query-language-fql for more information). Optional
free_search Search across all fields in an Actor object. Optional
name Search based on actor name. Optional
description Search based on description. Optional
created_date Search range from created date. Supported formats: ISO 8601 (for example, 2020-07-28T10:00:00Z) and time period (for example, 24 hours). Optional
max_last_modified_date Search range to modified date. Supported formats: ISO 8601 (for example, 2020-07-28T10:00:00Z) and time period (for example, 24 hours). Optional
min_last_activity_date Search range from activity date. Supported formats: ISO 8601 (for example, 2020-07-28T10:00:00Z) and time period (for example, 24 hours). Optional
max_last_activity_date Search range to activity date. Supported formats: ISO 8601 (for example, 2020-07-28T10:00:00Z) and time period (for example, 24 hours). Optional
origins Search by origins separated by “,”. Optional
target_countries Search by target countries separated by “,”. Optional
target_industries Search by target industries separated by “,”. Optional
motivations Search by motivations separated by “,”. Optional
offset Which page of the results to retrieve. It is 0 based. Optional
limit The maximum number of actors to retrieve. The default is 10. Optional
sort Sort by field and direction. Optional
slug Search by ‘slug’ or short descriptive name. Ex: “anchor-panda” Optional
display_full_fields Whether to display the full fields result from CS API. Default is False Optional

Context Output

Path Type Description
FalconIntel.Actor.ImageURL String The URL of the actor image
FalconIntel.Actor.Name String The actor name.
FalconIntel.Actor.ID String The actor ID.
FalconIntel.Actor.URL String The url of the actor
FalconIntel.Actor.Slug String Slug name ofactor
FalconIntel.Actor.ShortDescription String The actor short description.
FalconIntel.Actor.Description String The actor full description.
FalconIntel.Actor.FirstActivityDate Date The actor first activity date.
FalconIntel.Actor.LastActivityDate Date The actor last activity date.
FalconIntel.Actor.Active Boolean The actor active status.
FalconIntel.Actor.KnowsAs String Nicknames the actor is known as.
FalconIntel.Actor.TargetIndustries String A list of targeted industries associated with this actor
FalconIntel.Actor.TargetCountries String A list of targeted countries associated with this actor
FalconIntel.Actor.Origins String The actor’s country of origin. Ex: Afghanistan
FalconIntel.Actor.Motivations String The actor’s motivations. Ex: Criminal
FalconIntel.Actor.Capability String The actor’s capability. Ex: Average
FalconIntel.Actor.Group String The actor’s group. Ex: panda gang
FalconIntel.Actor.Region String The actor’s region. Ex: Eastern Europe
FalconIntel.Actor.KillChains String Kill chain fields.

Command Example

!cs-actors limit=1 target_industries="Entertainment,Healthcare"

Context Example

{
    "FalconIntel": {
        "Actor": {
            "Active": false,
            "Capability": "Average",
            "FirstActivityDate": "2019-05-01T00:00:00.000Z",
            "ID": 76078,
            "KnownAs": "Maze Team",
            "LastActivityDate": "2020-09-01T00:00:00.000Z",
            "Motivations": [
                "Criminal"
            ],
            "Name": "TWISTED SPIDER",
            "Origins": [
                "Eastern Europe",
                "Russian Federation"
            ],
            "ShortDescription": "TWISTED SPIDER is the criminal group behind the development and operation of Maze ransomware. While the ransomware was first observed in May 2019, the group gained notoriety in November 2019 with their brazen attitude toward victims and their willingness to speak with security researchers as they began using Big Game Hunting (BGH) tactics to target ...",
            "Description": "TWISTED SPIDER is the criminal group behind the development and operation of Maze ransomware. While the ransomware was first observed in May 2019, the group gained notoriety in November 2019 with their brazen attitude toward victims and their willingness to speak with security researchers as they began using Big Game Hunting (BGH) tactics to target organizations and businesses.",
            "Slug": "twisted-spider",
            "TargetCountries": [
                "Algeria",
                "Argentina",
                "Australia",
                "Austria",
                "Belgium",
                "Brazil",
                "Canada",
                "China",
                "Colombia",
                "Costa Rica",
                "Czech Republic",
                "Egypt",
                "France",
                "Germany",
                "Hong Kong",
                "India",
                "Italy",
                "Japan",
                "Luxembourg",
                "Macedonia",
                "Netherlands",
                "Nigeria",
                "North America",
                "Norway",
                "Oman",
                "Puerto Rico",
                "Saudi Arabia",
                "Singapore",
                "South Africa",
                "South Korea",
                "Spain",
                "Sri Lanka",
                "Switzerland",
                "Thailand",
                "United Arab Emirates",
                "United Kingdom",
                "United States",
                "Vietnam"
            ],
            "TargetIndustries": [
                "Academic",
                "Agriculture",
                "Automotive",
                "Aviation",
                "Biomedical",
                "Chemicals",
                "Consulting & Professional Services",
                "Consumer Goods",
                "Energy",
                "Entertainment",
                "Financial Management & Hedge Funds",
                "Financial Services",
                "Food and Beverage",
                "Government",
                "Healthcare",
                "Hospitality",
                "Industrials and Engineering",
                "Insurance",
                "Legal",
                "Logistics",
                "Manufacturing",
                "Media",
                "NGOs and Nonprofits",
                "Oil and Gas",
                "Opportunistic",
                "Pharmaceuticals",
                "Real Estate",
                "Retail",
                "State & Municipal Government",
                "Technology",
                "Telecommunications",
                "Transportation",
                "Travel",
                "Utilities"
            ],
            "URL": "https://falcon.crowdstrike.com/intelligence/actors/twisted-spider/"
        }
    }
}

Human Readable Output

Falcon Intel Actor search

Active Capability First Activity Date ID Known As Last Activity Date Motivations Name Origins Short Description Slug Target Countries Target Industries URL
false Average 2019-05-01T00:00:00.000Z 76078 Maze Team 2020-09-01T00:00:00.000Z Criminal TWISTED SPIDER Eastern Europe,
Russian Federation
TWISTED SPIDER is the criminal group behind the development and operation of Maze ransomware. While the ransomware was first observed in May 2019, the group gained notoriety in November 2019 with their brazen attitude toward victims and their willingness to speak with security researchers as they began using Big Game Hunting (BGH) tactics to target organizations and businesses. While other actors … twisted-spider Algeria,
Argentina,
Australia,
Austria,
Belgium,
Brazil,
Canada,
China,
Colombia,
Costa Rica,
Czech Republic,
Egypt,
France,
Germany,
Hong Kong,
India,
Italy,
Japan,
Luxembourg,
Macedonia,
Netherlands,
Nigeria,
North America,
Norway,
Oman,
Puerto Rico,
Saudi Arabia,
Singapore,
South Africa,
South Korea,
Spain,
Sri Lanka,
Switzerland,
Thailand,
United Arab Emirates,
United Kingdom,
United States,
Vietnam
Academic,
Agriculture,
Automotive,
Aviation,
Biomedical,
Chemicals,
Consulting & Professional Services,
Consumer Goods,
Energy,
Entertainment,
Financial Management & Hedge Funds,
Financial Services,
Food and Beverage,
Government,
Healthcare,
Hospitality,
Industrials and Engineering,
Insurance,
Legal,
Logistics,
Manufacturing,
Media,
NGOs and Nonprofits,
Oil and Gas,
Opportunistic,
Pharmaceuticals,
Real Estate,
Retail,
State & Municipal Government,
Technology,
Telecommunications,
Transportation,
Travel,
Utilities
https://falcon.crowdstrike.com/intelligence/actors/twisted-spider/

cs-indicators


Search known indicators based on the given parameters.

Base Command

cs-indicators

Input

Argument Name Description Required
query Search based on a query written in FQL (Falcon Query Language, See https://falcon.crowdstrike.com/support/documentation/45/falcon-query-language-fql for more information). Optional
type The indicator type. Optional
malicious_confidence Indicates a confidence level by which an indicator is considered to be malicious. Optional
offset Used to paginate the response. You can then use limit to set the number of results for the next page. Optional
last_updated The date the indicator was last updated.Supported formats: ISO 8601 (for example, 2020-07-28T10:00:00Z) and time period (for example, 24 hours). Optional
indicator The value for the given indicator type. Optional
sort Sort by field and direction. Optional
id The indicator’s ID, in the following format <type>_<indicator>. Optional
limit The maximum number of indicators to retrieve. The default is 10. Optional

Context Output

Path Type Description
File.MD5 String The MD5 hash of the file.
File.SHA1 String The SHA1 hash of the file.
File.SHA256 String The SHA1 hash of the file.
File.Malicious.Vendor String The vendor that reported the file as malicious.
File.Malicious.Description String A description explaining why the file was determined to be malicious.
File.Reports String For malicious files, the associated reports describing the hash
File.Actors String For malicious files, the associated actors
File.MalwareFamilies String For malicious files, the associated malware family
File.KillChains String For malicious files, the associated kill chain
URL.Data String The URL
URL.Malicious.Vendor String The vendor reporting the URL as malicious.
URL.Malicious.Description String A description of the malicious URL.
URL.Reports String For malicious URL, the associated reports describing the URL
URL.Actors String For malicious URL, the associated actors
URL.MalwareFamilies String For malicious URL, the associated malware family
URL.KillChains String For malicious URL, the associated kill chain
Domain.Name String The domain name, for example: “google.com”.
Domain.Malicious.Vendor String The vendor reporting the domain as malicious.
Domain.Malicious.Description String A description explaining why the domain was reported as malicious.
Domain.Reports String For malicious domain, the associated reports describing the domain
Domain.Actors String For malicious domain, the associated actors
Domain.MalwareFamilies String For malicious domain, the associated malware family
Domain.KillChains String For malicious domain, the associated kill chain
IP.Address String IP address
IP.Malicious.Vendor String The vendor reporting the IP address as malicious.
IP.Malicious.Description String A description explaining why the IP address was reported as malicious.
IP.Reports String For malicious IP, the associated reports describing the IP
IP.Actors String For malicious IP, the associated actors
IP.MalwareFamilies String For malicious IP, the associated malware family
IP.KillChains String For malicious IP, the associated kill chain
DBotScore.Indicator String The indicator we tested
DBotScore.Type String The type of the indicator
DBotScore.Vendor String Vendor used to calculate the score
DBotScore.Score Number The actual score
FalconIntel.Indicator.ID String The indicator ID.
FalconIntel.Indicator.Type String The indicator type.
FalconIntel.Indicator.Value String The indicator value.
FalconIntel.Indicator.LastUpdate Date The last time the indicator was updated.
FalconIntel.Indicator.PublishDate Date The time the indicator was published.
FalconIntel.Indicator.MaliciousConfidence String The confidence level by which an indicator is considered to be malicious
FalconIntel.Indicator.Reports String The report ID that the indicator is associated with
FalconIntel.Indicator.Actors String Actors that the indicator is associated
FalconIntel.Indicator.MalwareFamilies String A list of malware families that an indicator has been associated. An indicator may be associated with more than one malware family.
FalconIntel.Indicator.KillChains String The point in the kill chain at which an indicator is associated
FalconIntel.Indicator.DomainTypes String The domain type of domain indicators
FalconIntel.Indicator.IPAddressTypes String The address type of ip_address indicators
FalconIntel.Indicator.Relations.Indicator String Related Indicators
FalconIntel.Indicator.Type String The indicator type
FalconIntel.Indicator.Labels String Additional labels

Command Example

!cs-indicators limit=1 type=ip_address malicious_confidence=high

Context Example

{
    "DBotScore": {
        "Indicator": "8.8.8.8",
        "Score": 3,
        "Type": "ip",
        "Vendor": "FalconIntel"
    },
    "FalconIntel": {
        "Indicator": {
            "ID": "ip_address_id",
            "KillChains": [
                "C2"
            ],
            "Labels": [
                "CSD/CSA-191023",
                "CSD/CSA-191350",
                "CSD/CSA-181072",
                "CSD/CSWR-17018",
                "CSD/CSWR-20022",
                "CSD/CSWR-19024",
                "MaliciousConfidence/High",
                "KillChain/C2",
                "CSD/CSIT-16091",
                "ThreatType/Commodity"
            ],
            "MaliciousConfidence": "high",
            "MalwareFamilies": [
                "njRAT"
            ],
            "Reports": [
                "CSA-191023",
                "CSA-191350",
                "CSA-181072",
                "CSWR-17018",
                "CSWR-20022",
                "CSWR-19024",
                "CSIT-16091",
                "CSA-201008",
                "CSWR-20014"
            ],
            "Type": "ip_address",
            "Value": "8.8.8.8"
        }
    },
    "IP": {
        "Address": "8.8.8.8",
        "KillChains": [
            "C2"
        ],
        "Malicious": {
            "Description": "High confidence",
            "Vendor": "FalconIntel"
        },
        "MalwareFamilies": [
            "njRAT"
        ],
        "Reports": [
            "CSA-191023",
            "CSA-191350",
            "CSA-181072",
            "CSWR-17018",
            "CSWR-20022",
            "CSWR-19024",
            "CSIT-16091",
            "CSA-201008",
            "CSWR-20014"
        ]
    }
}

Human Readable Output

Falcon Intel Indicator search

ID Kill Chains Labels Malicious Confidence Malware Families Reports Type Value
ip_address_id C2 CSD/CSA-191023,
CSD/CSA-191350,
CSD/CSA-181072,
CSD/CSWR-17018,
CSD/CSWR-20022,
CSD/CSWR-19024,
MaliciousConfidence/High,
KillChain/C2,
CSD/CSIT-16091,
ThreatType/Commodity
high njRAT CSA-191023,
CSA-191350,
CSA-181072,
CSWR-17018,
CSWR-20022,
CSWR-19024,
CSIT-16091,
CSA-201008,
CSWR-20014
ip_address 8.8.8.8

cs-reports


The Falcon Intel Reports API allows to query CrowdStrike intelligence publications.

Base Command

cs-reports

Input

Argument Name Description Required
query Search based on a query written in FQL (Falcon Query Language, See https://falcon.crowdstrike.com/support/documentation/45/falcon-query-language-fql for more information). Optional
free_search Search across all fields in an Report object. Optional
name Search for keywords across report names (i.e. the report’s title). Optional
actors Search for a report related to a particular actors. Actors should be comma separated. - For example - actor1,actor2,… Optional
target_countries Search reports by targeted country/countries Optional
target_industries Search reports by targeted industry/industries Optional
motivations Search by motivation Optional
slug Search by report ‘slug’ or short descriptive name Optional
description Search the body of the report Optional
type The type of object to search for. Optional
sub_type The sub-type to search for. Optional
tags Tags associated with a report (managed internally by CS). Optional
created_date Constrain results to those created on a certain date. Supported formats: ISO 8601 (for example, 2020-07-28T10:00:00Z) and time period (for example, 24 hours). Optional
max_last_modified_date Constrain results to those modified on or before a certain date. Supported formats: ISO 8601 (for example, 2020-07-28T10:00:00Z) and time period (for example, 24 hours). Optional
offset Used to paginate the response. You can then use limit to set the number of results for the next page. Optional
limit The maximum number of reports to retrieve. The default is 10. Optional
sort Sort by field and direction. Optional
display_full_fields Whether to display the full fields result from CS API. Default is False Optional

Context Output

Path Type Description
FalconIntel.Report.ID String The report ID.
FalconIntel.Report.URL String The report URL.
FalconIntel.Report.Name String The report name.
FalconIntel.Report.Type String The report type.
FalconIntel.Report.SubType String The report sub type.
FalconIntel.Report.Slug String Slug name of the report
FalconIntel.Report.CreatedDate Date The date the report was created.
FalconIntel.Report.LastModifiedSate Date The date the report was last modified.
FalconIntel.Report.ShortDescription String The report short description.
FalconIntel.Report.Description String The report full description.
FalconIntel.Report.TargetIndustries String Targeted industries included in the report. Ex: aerospace
FalconIntel.Report.TargetCountries String Targeted countries included in the report. Ex: afghanistan
FalconIntel.Report.Motivations String Motivations included in the report. Ex: criminal
FalconIntel.Report.Tags String The report’s tags. Ex: intel_feed

Command Example

!cs-reports limit=1 created_date="2016-09-30T19:15:53.000Z"

Context Example

{
    "FalconIntel": {
        "Report": {
            "CreatedDate": "2016-09-30T19:15:53.000Z",
            "ID": 7448,
            "LastModifiedSate": "2020-07-24T10:15:02.000Z",
            "Name": "Snort Changelog",
            "ShortDescription": "Added one additional rule to detect Hancitor ...",
            "Description": "Added one additional rule to detect Hancitor malware traffic decsribed in CSIT-16107. ",
            "Slug": "slug_value",
            "SubType": "Snort/Suricata",
            "Type": "Feeds",
            "URL": "https://falcon.crowdstrike.com/intelligence/reports/snort-changelog-9-5-2016-6/"
        }
    }
}

Human Readable Output

Falcon Intel Report search

Created Date ID Last Modified Sate Name Short Description Slug Sub Type Type URL
2016-09-30T19:15:53.000Z 7448 2020-07-24T10:15:02.000Z Snort Changelog Added one additional rule to detect Hancitor malware traffic decsribed in CSIT-16107. snort-changelog-9-5-2016-6 Snort/Suricata Feeds https://falcon.crowdstrike.com/intelligence/reports/snort-changelog-9-5-2016-6/

Configuration parameters

  • server_url — Server URL (e.g., https://example.net) (required)
  • credentials — Client ID (required)
  • timeout — The amount of time (in seconds) that a request will wait for a client to establish a connection to a remote machine before a timeout occurs.
  • threshold — Indicator Threshold. Minimum malicious confidence from Falcon Intel to consider the indicator malicious.
  • integrationReliability — Source Reliability (required)
  • feedExpirationPolicy
  • feedExpirationInterval
  • proxy — Use system proxy settings
  • insecure — Trust any certificate (not secure)

Commands (7)

  • cs-actors

    Search known actors based on the given parameters.

  • cs-indicators

    Search known indicators based on the given parameters.

  • cs-reports

    Queries CrowdStrike intelligence publications.

  • domain

    Checks the domain reputation.

  • file

    Checks the file reputation.

  • ip

    Checks the IP reputation.

  • url

    Checks the URL reputation.

import traceback
from datetime import UTC, datetime
from typing import Any

import demistomock as demisto
import urllib3
from CommonServerPython import *
from dateparser import parse

from CommonServerUserPython import *

# Disable insecure warnings
urllib3.disable_warnings()

""" GLOBAL VARIABLES """

MALICIOUS_DICTIONARY: dict[Any, int] = {
    "low": Common.DBotScore.GOOD,
    "medium": Common.DBotScore.SUSPICIOUS,
    "high": Common.DBotScore.BAD,
}

MALICIOUS_THRESHOLD = MALICIOUS_DICTIONARY.get(demisto.params().get("threshold", "high"))

""" CLIENT """


class Client:
    """
    The integration's client
    """

    def __init__(self, params: dict[str, str], reliability: Optional[DBotScoreReliability] = None):
        self.cs_client: CrowdStrikeClient = CrowdStrikeClient(params=params)
        self.reliability = reliability
        self.query_params: dict[str, str] = {"offset": "offset", "limit": "limit", "sort": "sort", "free_search": "q"}
        self.date_params: dict[str, dict[str, str]] = {
            "created_date": {"operator": "", "api_key": "created_date"},
            "last_updated_date": {"operator": "", "api_key": "last_updated"},
            "max_last_modified_date": {"operator": "<=", "api_key": "last_modified_date"},
            "min_last_activity_date": {"operator": ">=", "api_key": "first_activity_date"},
            "max_last_activity_date": {"operator": "<=", "api_key": "last_activity_date"},
        }

    def build_request_params(self, args: dict[str, Any]) -> dict[str, Any]:
        """
        Build the params dict for the request
        :param args: Cortex XSOAR args
        :return: The params dict
        """
        params: dict[str, Any] = {key: args.get(arg) for arg, key in self.query_params.items()}
        query = args.get("query")
        params["filter"] = query if query else self.build_filter_query(args)
        return assign_params(**params)

    def build_filter_query(self, args: dict[str, str]) -> str:
        """
        Builds the filter query in Falcon Query Language (FQL)
        :param args: Cortex XSOAR args
        :return: The query
        """
        filter_query: str = ""

        for key in args:
            if key not in self.query_params:
                if key not in self.date_params:
                    values: List[str] = argToList(args[key], ",")
                    for value in values:
                        if isinstance(value, str):
                            value = value.replace("'", "%27")
                        filter_query += f"{key}:'{value}'+"
                else:
                    operator: Optional[str] = self.date_params.get(key, {}).get("operator")
                    api_key: Optional[str] = self.date_params.get(key, {}).get("api_key")
                    # Parsing date argument of ISO format or free language into datetime object,
                    # replacing TZ with UTC, taking its timestamp format and rounding it up.
                    parsed_date = parse(args[key])
                    assert parsed_date is not None
                    filter_query += f"{api_key}:{operator}{int(parsed_date.replace(tzinfo=UTC).timestamp())}+"

        if filter_query.endswith("+"):
            filter_query = filter_query[:-1]

        return filter_query

    def get_indicator(self, indicator_value: str) -> dict[str, Any]:
        # crowdstrike do not allow passing single quotes - so we encode them
        # we are not encoding the entire indicator value, as the other reserved chars (such as + and &) are allowed
        indicator_value = indicator_value.replace("'", "%27")
        args: dict[str, Any] = {"indicator": indicator_value, "limit": 1}
        params: dict[str, Any] = self.build_request_params(args)
        return self.cs_client.http_request(method="GET", url_suffix="intel/combined/indicators/v1", params=params)

    def cs_actors(self, args: dict[str, str]) -> dict[str, Any]:
        url_suffix = "intel/combined/actors/v1"
        if argToBoolean(args.pop("display_full_fields", False)):
            url_suffix += "?fields=__full__"
        params: dict[str, Any] = self.build_request_params(args)
        return self.cs_client.http_request(method="GET", url_suffix=url_suffix, params=params)

    def cs_indicators(self, args: dict[str, str]) -> dict[str, Any]:
        params: dict[str, Any] = self.build_request_params(args)
        return self.cs_client.http_request(method="GET", url_suffix="intel/combined/indicators/v1", params=params)

    def cs_reports(self, args: dict[str, str]) -> dict[str, Any]:
        url_suffix = "intel/combined/reports/v1"
        if argToBoolean(args.pop("display_full_fields", False)):
            url_suffix += "?fields=__full__"
        params: dict[str, Any] = self.build_request_params(args)
        return self.cs_client.http_request(method="GET", url_suffix=url_suffix, params=params)


""" HELPER FUNCTIONS """


def get_dbot_score_type(indicator_type: str) -> Exception | DBotScoreType | str:
    """
    Returns the dbot score type
    :param indicator_type: The indicator type
    :return: The dbot score type
    """
    if indicator_type == "ip":
        return DBotScoreType.IP
    elif indicator_type == "domain":
        return DBotScoreType.DOMAIN
    elif indicator_type == "file" or indicator_type == "hash":
        return DBotScoreType.FILE
    elif indicator_type == "url":
        return DBotScoreType.URL
    else:
        raise DemistoException("Indicator type is not supported.")


def get_score_from_resource(r: dict[str, Any]) -> int:
    """
    Calculates the DBotScore for the resource
    :param r: The resource
    :return: The DBotScore
    """
    malicious_confidence: int = MALICIOUS_DICTIONARY.get(r.get("malicious_confidence"), 0)
    if malicious_confidence == 3 or MALICIOUS_THRESHOLD == 1:
        score = 3
    elif malicious_confidence == 2 or MALICIOUS_THRESHOLD == 2:
        score = 2
    else:
        score = 1
    return score


def get_indicator_hash_type(indicator_value: str) -> str | Exception:
    """
    Calculates the type of the hash
    :param indicator_value: The hash value
    :return: The hash type
    """
    length: int = len(indicator_value)
    if length == 32:
        return "hash_md5"
    elif length == 40:
        return "hash_sha1"
    elif length == 64:
        return "hash_sha256"
    else:
        raise DemistoException(
            f"Invalid hash. Hash length is: {length}. Please provide either MD5 (32 length)"
            f", SHA1 (40 length) or SHA256 (64 length) hash."
        )


def get_indicator_object(
    indicator_value: Any, indicator_type: str, dbot_score: Common.DBotScore
) -> Common.IP | Common.URL | Common.File | Common.Domain | None:
    """
    Returns the corresponding indicator common object
    :param indicator_value: The indicator value
    :param indicator_type: The indicator value
    :param dbot_score: The indicator DBotScore
    :return: The indicator common object
    """
    if indicator_type == "ip":
        return Common.IP(ip=indicator_value, dbot_score=dbot_score)
    elif indicator_type == "url":
        return Common.URL(url=indicator_value, dbot_score=dbot_score)
    elif indicator_type == "hash":
        hash_type: str | Exception = get_indicator_hash_type(indicator_value)
        if hash_type == "hash_md5":
            return Common.File(md5=indicator_value, dbot_score=dbot_score)
        elif hash_type == "hash_sha1":
            return Common.File(sha1=indicator_value, dbot_score=dbot_score)
        else:
            return Common.File(sha256=indicator_value, dbot_score=dbot_score)
    elif indicator_type == "domain":
        return Common.Domain(domain=indicator_value, dbot_score=dbot_score)
    else:
        return None


def should_filter_resource_by_type(resource, indicator_type, indicator_value):
    """
    checks if a resource should be filtered by his type.
    :param resource: The resource object
    :param indicator_type: The indicator type
    :param indicator_value: The indicator value
    :return: True if the resource should be filtered (don't match the indicator type) or False otherwise.
    """
    # indicator type was not filtered using the query due to a bug in the CrowdStrike API.
    if indicator_type == "hash":
        filter_type = get_indicator_hash_type(indicator_value)
    elif indicator_type == "ip":
        filter_type = "ip_address"
    else:
        filter_type = indicator_type

    return resource.get("type") != filter_type


def build_indicator(indicator_value: str, indicator_type: str, title: str, client: Client) -> List[CommandResults]:
    """
    Builds an indicator entry
    :param indicator_value: The indicator value
    :param indicator_type: The indicator type
    :param title: The title to show to the user
    :param client: The integration's client
    :return: The indicator entry
    """
    res: dict[str, Any] = client.get_indicator(indicator_value)
    resources: List[Any] = res.get("resources", [])
    results: List[CommandResults] = []

    if resources:
        for r in resources:
            if should_filter_resource_by_type(r, indicator_type, indicator_value):
                continue
            output = get_indicator_outputs(r)
            score = get_score_from_resource(r)
            dbot_score = Common.DBotScore(
                indicator=indicator_value,
                indicator_type=get_dbot_score_type(indicator_type),
                integration_name="CrowdStrike Falcon Intel v2",
                malicious_description="High confidence",
                score=score,
                reliability=client.reliability,
            )
            indicator = get_indicator_object(indicator_value, indicator_type, dbot_score)
            results.append(
                CommandResults(
                    outputs=output,
                    outputs_prefix="FalconIntel.Indicator",
                    outputs_key_field="ID",
                    indicator=indicator,
                    readable_output=tableToMarkdown(name=title, t=output, headerTransform=pascalToSpace),
                    raw_response=res,
                )
            )

    else:
        results.append(
            create_indicator_result_with_dbotscore_unknown(
                indicator=indicator_value, indicator_type=DBotScoreType.FILE if indicator_type == "hash" else indicator_type
            )
        )

    return results


def get_values(items_list: List[Any], return_type: str = "str", keys: str | List[Any] = "value") -> str | List[str | dict]:
    """
    Returns the values of list's items
    :param items_list: The items list
    :param return_type: Whether to return string or list
    :param keys: The key to get the data
    :return: The values list
    """
    new_list: List[Any] = []
    if not items_list:
        return new_list
    if isinstance(keys, str):
        new_list = [item.get(keys) for item in items_list]
    elif isinstance(keys, list):
        new_list = [{underscoreToCamelCase(f): item.get(f) for f in item if f in keys} for item in items_list]
    if return_type == "list":
        return new_list
    return ", ".join(str(item) for item in new_list)


def get_indicator_outputs(resource: dict[str, Any]) -> dict[str, Any]:
    """
    Build the output and extra context of an indicator
    :param resource: The indicator's object
    :return: The indicator's human readable
    """
    output: dict[str, Any] = {}

    if resource:
        indicator_id = resource.get("id")
        indicator_value = resource.get("indicator")
        indicator_type = resource.get("type")
        last_update = resource.get("last_update")
        publish_date = resource.get("publish_date")
        malicious_confidence = resource.get("malicious_confidence")
        reports = resource.get("reports")
        actors = resource.get("actors")
        malware_families = resource.get("malware_families")
        kill_chains = resource.get("kill_chains")
        domain_types = resource.get("domain_types")
        ip_address_types = resource.get("ip_address_types")
        relations: List[Any] = resource.get("relations", [])[:10]
        labels: List[Any] = resource.get("labels", [])[:10]

        output = assign_params(
            ID=indicator_id,
            Type=indicator_type,
            Value=indicator_value,
            LastUpdate=datetime.fromtimestamp(last_update, UTC).isoformat() if last_update else None,
            PublishDate=datetime.fromtimestamp(publish_date, UTC).isoformat() if publish_date else None,
            MaliciousConfidence=malicious_confidence,
            Reports=reports,
            Actors=actors,
            MalwareFamilies=malware_families,
            KillChains=kill_chains,
            DomainTypes=domain_types,
            IPAddressTypes=ip_address_types,
            Relations=[
                f'{item.get("Type")}: {item.get("Indicator")}'  # type: ignore
                for item in get_values(relations, return_type="list", keys=["indicator", "type"])  # type: ignore
            ],
            Labels=get_values(labels, return_type="list", keys="name"),
        )

    return output


""" COMMANDS """


def run_test_module(client: Client) -> str | Exception:
    """
    If a client is successfully constructed then an access token was successfully created,
    therefore the username and password are valid and a connection was made.
    On top of the above, this function validates the http request to indicators endpoint.
    :param client: the client object with an access token
    :return: ok if got a valid access token and not all the quota is used at the moment
    """
    client.cs_client.http_request("GET", "intel/combined/indicators/v1", params={"limit": 1})
    return "ok"


def file_command(files: List, client: Client) -> List[CommandResults]:
    results: List[CommandResults] = []
    for file in files:
        results += build_indicator(file, "hash", "Falcon Intel file reputation:\n", client)
    return results


def ip_command(ips: List, client: Client) -> List[CommandResults]:
    results: List[CommandResults] = []
    for ip in ips:
        results += build_indicator(ip, "ip", "Falcon Intel IP reputation:\n", client)
    return results


def url_command(urls: List, client: Client) -> List[CommandResults]:
    results: List[CommandResults] = []
    for url in urls:
        results += build_indicator(url, "url", "Falcon Intel URL reputation:\n", client)
    return results


def domain_command(domains: List, client: Client) -> List[CommandResults]:
    results: List[CommandResults] = []
    for domain in domains:
        results += build_indicator(domain, "domain", "Falcon Intel domain reputation:\n", client)
    return results


def cs_actors_command(client: Client, args: dict[str, str]) -> CommandResults:
    res: dict[str, Any] = client.cs_actors(args)
    resources: List[Any] = res.get("resources", [])
    outputs: List[dict[str, Any]] = []
    md_outputs: List[dict[str, Any]] = []
    md: str = ""
    title: str = "Falcon Intel Actor search:"

    if resources:
        for r in resources:
            image_url = r.get("image", {}).get("url")
            name = r.get("name")
            actor_id = r.get("id")
            url = r.get("url")
            slug = r.get("slug")
            short_description = r.get("short_description")
            description = r.get("description")
            first_activity_date = r.get("first_activity_date")
            last_activity_date = r.get("last_activity_date")
            active = r.get("active")
            known_as = r.get("known_as")
            target_industries = r.get("target_industries") or []
            target_countries = r.get("target_countries") or []
            origins = r.get("origins") or []
            motivations = r.get("motivations") or []
            capability = r.get("capability", {}).get("value")
            group = r.get("group")
            region = r.get("region", {}).get("value")
            kill_chain = r.get("kill_chain")

            output: dict[str, Any] = assign_params(
                ImageURL=image_url,
                Name=name,
                ID=actor_id,
                URL=url,
                Slug=slug,
                ShortDescription=short_description,
                Description=description,
                FirstActivityDate=datetime.fromtimestamp(first_activity_date, UTC).isoformat() if first_activity_date else None,
                LastActivityDate=datetime.fromtimestamp(last_activity_date, UTC).isoformat() if last_activity_date else None,
                Active=active,
                KnownAs=known_as,
                TargetIndustries=get_values(target_industries, return_type="list"),
                TargetCountries=get_values(target_countries, return_type="list"),
                Origins=get_values(origins, return_type="list"),
                Motivations=get_values(motivations, return_type="list"),
                Capability=capability,
                Group=group,
                Region=region,
                KillChains=kill_chain,
            )
            outputs.append(output)

            md_output: dict[str, Any] = output
            for key in ("URL", "ImageURL"):
                if key in md_output:
                    value = md_output[key]
                    md_output[key] = f"[{value}]({value})"

            md_outputs.append(md_output)
    else:
        md = "No actors found."

    results: CommandResults = CommandResults(
        outputs=outputs,
        outputs_key_field="ID",
        outputs_prefix="FalconIntel.Actor",
        readable_output=md if md else tableToMarkdown(name=title, t=md_outputs, headerTransform=pascalToSpace, removeNull=True),
        raw_response=res,
    )

    return results


def cs_indicators_command(client: Client, args: dict[str, str]) -> List[CommandResults]:
    res: dict[str, Any] = client.cs_indicators(args)
    resources: List[Any] = res.get("resources", [])
    results: List[CommandResults] = []
    title: str = "Falcon Intel Indicator search:"

    if resources:
        for r in resources:
            output = get_indicator_outputs(r)
            indicator_value = output.get("Value")
            indicator_type = output.get("Type")
            indicator: Optional[Common.Indicator] = None

            if indicator_type in ("hash_md5", "hash_sha256", "hash_sha1", "ip_address", "url", "domain"):
                if indicator_type in ("hash_md5", "hash_sha1", "hash_sha256"):
                    indicator_type = "hash"
                elif indicator_type == "ip_address":
                    indicator_type = "ip"
                score = get_score_from_resource(r)
                dbot_score = Common.DBotScore(
                    indicator=indicator_value,
                    indicator_type=get_dbot_score_type(indicator_type),
                    integration_name="CrowdStrike Falcon Intel v2",
                    malicious_description="High confidence",
                    score=score,
                    reliability=client.reliability,
                )
                indicator = get_indicator_object(indicator_value, indicator_type, dbot_score)
            results.append(
                CommandResults(
                    outputs=output,
                    outputs_prefix="FalconIntel.Indicator",
                    outputs_key_field="ID",
                    readable_output=tableToMarkdown(name=title, t=output, headerTransform=pascalToSpace),
                    raw_response=res,
                    indicator=indicator,
                )
            )
    else:
        results.append(CommandResults(readable_output="No indicators found."))

    return results


def cs_reports_command(client: Client, args: dict[str, str]) -> CommandResults:
    res: dict[str, Any] = client.cs_reports(args)
    resources: List[Any] = res.get("resources", [])
    outputs: List[dict[str, Any]] = []
    md_outputs: List[dict[str, Any]] = []
    md: str = ""
    title: str = "Falcon Intel Report search:"

    if resources:
        for r in resources:
            report_id: int = r.get("id")
            url: str = r.get("url")
            name: str = r.get("name")
            report_type: str = r.get("type", {}).get("name")
            sub_type: str = r.get("sub_type", {}).get("name")
            slug: str = r.get("slug")
            created_date: int = r.get("created_date")
            last_modified_date: int = r.get("last_modified_date")
            short_description: str = r.get("short_description")
            description: str = r.get("description")
            target_industries: List[Any] = r.get("target_industries") or []
            target_countries: List[Any] = r.get("target_countries") or []
            motivations: List[Any] = r.get("motivations") or []
            tags: List[Any] = r.get("tags") or []
            actors: List[Any] = r.get("actors") or []

            output: dict[str, Any] = assign_params(
                ID=report_id,
                URL=url,
                Name=name,
                Type=report_type,
                SubType=sub_type,
                Slug=slug,
                CreatedDate=datetime.fromtimestamp(created_date, UTC).isoformat() if created_date else None,
                LastModifiedSate=datetime.fromtimestamp(last_modified_date, UTC).isoformat() if last_modified_date else None,
                ShortDescription=short_description,
                Description=description,
                TargetIndustries=get_values(target_industries, return_type="list"),
                TargetCountries=get_values(target_countries, return_type="list"),
                Motivations=get_values(motivations, return_type="list"),
                Tags=get_values(tags, return_type="list"),
                Actors=get_values(actors, return_type="list", keys="name"),
            )
            outputs.append(output)

            md_output: dict[str, Any] = output
            if "URL" in md_output:
                value = md_output["URL"]
                md_output["URL"] = f"[{value}]({value})"

            md_outputs.append(md_output)

    else:
        md = "No reports found."

    results: CommandResults = CommandResults(
        outputs_prefix="FalconIntel.Report",
        outputs=outputs,
        outputs_key_field="ID",
        readable_output=md if md else tableToMarkdown(name=title, t=outputs, headerTransform=pascalToSpace, removeNull=True),
        raw_response=res,
    )

    return results


def main():
    params: dict[str, str] = demisto.params()

    reliability = params.get("integrationReliability", "C - Fairly reliable")
    reliability = (
        DBotScoreReliability.get_dbot_score_reliability_from_str(reliability)
        if DBotScoreReliability.is_valid_type(reliability)
        else None
    )

    args: dict[str, str] = demisto.args()
    results: CommandResults | List[CommandResults]
    try:
        command: str = demisto.command()
        LOG(f"Command being called in CrowdStrike Falcon Intel v2 is: {command}")
        client: Client = Client(params=params, reliability=reliability)
        if command == "test-module":
            result: str | Exception = run_test_module(client)
            return_results(result)
        elif command == "file":
            results = file_command(argToList(args["file"]), client)
            return_results(results)
        elif command == "ip":
            results = ip_command(argToList(args["ip"]), client)
            return_results(results)
        elif command == "url":
            results = url_command(argToList(args["url"]), client)
            return_results(results)
        elif command == "domain":
            results = domain_command(argToList(args["domain"]), client)
            return_results(results)
        elif command == "cs-actors":
            results = cs_actors_command(client, args)
            return_results(results)
        elif command == "cs-indicators":
            results = cs_indicators_command(client, args)
            return_results(results)
        elif command == "cs-reports":
            results = cs_reports_command(client, args)
            return_results(results)
        else:
            raise NotImplementedError(f"{command} command is not an existing CrowdStrike Falcon Intel v2 integration")
    except Exception as err:
        return_error(f"Unexpected error:\n{err!s}", error=traceback.format_exc())


from CrowdStrikeApiModule import *  # noqa: E402

if __name__ in ("__main__", "builtin", "builtins"):
    main()