CyberTotal

CyberTotal is a cloud-based threat intelligence service developed by CyCraft.

Data Enrichment & Threat Intelligence · CyberTotal

Details

IDCyberTotal
ProviderCyCraft Technology
CategoryData Enrichment & Threat Intelligence
From Version5.0.0
Docker Imagedemisto/python3:3.12.13.10116658
Supported ModulesAgentix XSIAM

README

CyberTotal is a cloud-based threat intelligence service developed by CyCraft.
This integration was integrated and tested with version 1.6.4 of CyberTotal

Configure CyberTotal in Cortex

Parameter Description Required
url CyberTotal URL True
token CyberTotal API Token True
feed Fetch indicators False
threshold_ip Bad ip threshold False
threshold_file Bad hash threshold False
threshold_domain Bad domain threshold False
threshold_url Bad url threshold False
insecure Trust any certificate (not secure) False
proxy Use system proxy settings 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.

ip


Return IP information and reputation

Base Command

ip

Input

Argument Name Description Required
ip List of IPs. Required
threshold If the IP has reputation above the threshold then the IP defined as malicious. If threshold not set, then threshold from instance configuration is used. Optional

Context Output

Path Type Description
CyberTotal.IP.scan_date date Scan date format: ISO 8601
CyberTotal.IP.resource string The scan target sent to CyberTotal.
CyberTotal.IP.task_id string The unique id of each scan in CyberTotal.
CyberTotal.IP.permalink string The link of this IP’s report in CyberTotal.
CyberTotal.IP.severity number Severity of this IP. The range is from 0 to 10.
CyberTotal.IP.confidence number Confidence of this IP. The range is from 0 to 10.
CyberTotal.IP.threat string Threat of this IP, which is a select from ‘High’, ‘Medium’ and ‘Low’.
CyberTotal.IP.detection_engines number The number of all antivirus vendors scanned.
CyberTotal.IP.positive_detections number The number of antivirus vendors scanned with positive detection.
CyberTotal.IP.detection_ratio string The ratio of positive_detections and detection_engines.
CyberTotal.IP.message string Message about this search.
IP.Address String IP address
IP.DetectionEngines Number The total number of engines that checked the indicator.
IP.PositiveDetections Number The number of engines that positively detected the indicator as malicious.
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.

Command Example

!ip ip=1.1.1.1

Context Example

{
    "CyberTotal": {
        "IP": {
            "confidence": 3,
            "detection_engines": 87,
            "detection_ratio": "4/87",
            "message": "search success",
            "permalink": "https://cybertotal.cycraft.com/app/intelligence/5a2601d575ea44058efeb1aba995dc8d",
            "positive_detections": 4,
            "resource": "1.1.1.1",
            "scan_date": "2020-07-28T14:11:19+00:00",
            "severity": 9,
            "task_id": "5a2601d575ea44058efeb1aba995dc8d",
            "threat": "High"
        }
    },
    "DBotScore": {
        "Indicator": "1.1.1.1",
        "Score": 1,
        "Type": "ip",
        "Vendor": "CyberTotal"
    },
    "IP": {
        "Address": "1.1.1.1",
        "DetectionEngines": 87,
        "PositiveDetections": 4
    }
}

Human Readable Output

IP List

confidence detection_engines detection_ratio message permalink positive_detections resource scan_date severity task_id threat
3 87 4/87 search success https://cybertotal.cycraft.com/app/intelligence/5a2601d575ea44058efeb1aba995dc8d 4 1.1.1.1 2020-07-28T14:11:19+00:00 9 5a2601d575ea44058efeb1aba995dc8d High

file


Return file’s information and reputation

Base Command

file

Input

Argument Name Description Required
file list of hash(s). Required
threshold If the HASH has reputation above the threshold then the HASH defined as malicious. If threshold not set, then threshold from instance configuration is used. Optional

Context Output

Path Type Description
CyberTotal.File.scan_date date Scan date format: ISO 8601
CyberTotal.File.resource string The scan target sent to CyberTotal.
CyberTotal.File.task_id string The unique id of each scan in CyberTotal.
CyberTotal.File.permalink string The link of this HASH’s report in CyberTotal.
CyberTotal.File.severity number Severity of this HASH. The range is from 0 to 10.
CyberTotal.File.confidence number Confidence of this HASH. The range is from 0 to 10.
CyberTotal.File.threat string Threat of this HASH, which is a select from ‘High’, ‘Medium’ and ‘Low’.
CyberTotal.File.detection_engines number The number of all antivirus vendors scanned.
CyberTotal.File.positive_detections number The number of antivirus vendors scanned with positive detection.
CyberTotal.File.detection_ratio string The ratio of positive_detections and detection_engines.
CyberTotal.File.message string Message about this search.
CyberTotal.File.size string Size of this file.
CyberTotal.File.md5 string This file’s md5 value.
CyberTotal.File.sha1 string This file’s sha1 value.
CyberTotal.File.sha256 string This file’s sha256 value.
CyberTotal.File.extension string This file’s extension type.
CyberTotal.File.name string This file’s name, separated by ‘,’ if more than 2 names.
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.Name String The full file name (including file extension).
File.Extension String The file extension, for example: ‘xls’.
File.Size Number The size of the file in bytes.
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.

Command Example

!file file=b5e8793b216cf2e63c47af4ac424ac9a77601405c131c32a2eaa22812306123e

Context Example

{
    "CyberTotal": {
        "File": {
            "confidence": 10,
            "detection_engines": 70,
            "detection_ratio": "58/70",
            "extension": "exe",
            "md5": "19063b2a1b1a7930aef31678903b7088",
            "message": "search success",
            "name": "19063b2a1b1a7930aef31678903b7088.virus",
            "permalink": "https://cybertotal.cycraft.com/app/intelligence/7a37a8d7a32847c9b3eee5a4431c9ab5",
            "positive_detections": 58,
            "resource": "b5e8793b216cf2e63c47af4ac424ac9a77601405c131c32a2eaa22812306123e",
            "scan_date": "2020-07-09T15:11:56+00:00",
            "severity": 10,
            "sha1": "c771b33f4f3867f95721d0eceed5c4040c78d3ee",
            "sha256": "b5e8793b216cf2e63c47af4ac424ac9a77601405c131c32a2eaa22812306123e",
            "size": "28672",
            "task_id": "7a37a8d7a32847c9b3eee5a4431c9ab5",
            "threat": "High"
        }
    },
    "DBotScore": {
        "Indicator": "b5e8793b216cf2e63c47af4ac424ac9a77601405c131c32a2eaa22812306123e",
        "Score": 3,
        "Type": "file",
        "Vendor": "CyberTotal"
    },
    "File": {
        "Extension": "exe",
        "MD5": "19063b2a1b1a7930aef31678903b7088",
        "Malicious": {
            "Description": "CyberTotal returned reputation 58",
            "Vendor": "CyberTotal"
        },
        "Name": "19063b2a1b1a7930aef31678903b7088.virus",
        "SHA1": "c771b33f4f3867f95721d0eceed5c4040c78d3ee",
        "SHA256": "b5e8793b216cf2e63c47af4ac424ac9a77601405c131c32a2eaa22812306123e",
        "Size": "28672"
    }
}

Human Readable Output

File List

confidence detection_engines detection_ratio extension md5 message name permalink positive_detections resource scan_date severity sha1 sha256 size task_id threat
10 70 58/70 exe 19063b2a1b1a7930aef31678903b7088 search success 19063b2a1b1a7930aef31678903b7088.virus https://cybertotal.cycraft.com/app/intelligence/7a37a8d7a32847c9b3eee5a4431c9ab5 58 b5e8793b216cf2e63c47af4ac424ac9a77601405c131c32a2eaa22812306123e 2020-07-09T15:11:56+00:00 10 c771b33f4f3867f95721d0eceed5c4040c78d3ee b5e8793b216cf2e63c47af4ac424ac9a77601405c131c32a2eaa22812306123e 28672 7a37a8d7a32847c9b3eee5a4431c9ab5 High

domain


Return domain information and reputation

Base Command

domain

Input

Argument Name Description Required
domain List of domains. Required
threshold If the domain has reputation above the threshold then the domain defined as malicious. If threshold not set, then threshold from instance configuration is used. Optional

Context Output

Path Type Description
CyberTotal.Domain.scan_date date Scan date format: ISO 8601
CyberTotal.Domain.resource string The scan target sent to CyberTotal.
CyberTotal.Domain.permalink string The link of this domain’s report in CyberTotal.
CyberTotal.Domain.severity number Severity of this domain. The range is from 0 to 10.
CyberTotal.Domain.confidence number Confidence of this domain. The range is from 0 to 10.
CyberTotal.Domain.threat string Threat of this domain, which is a select from ‘High’, ‘Medium’ and ‘Low’.
CyberTotal.Domain.detection_engines number The number of all antivirus vendors scanned.
CyberTotal.Domain.positive_detections number The number of antivirus vendors scanned with positive detection.
CyberTotal.Domain.detection_ratio string The ratio of positive_detections and detection_engines.
CyberTotal.Domain.message string Message about this search.
Domain.Name String The domain name, for example: “google.com”.
Domain.DetectionEngines Number The total number of engines that checked the indicator.
Domain.PositiveDetections Number The number of engines that positively detected the indicator as malicious.
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.

Command Example

!domain domain=abc.com

Context Example

{
    "CyberTotal": {
        "Domain": {
            "confidence": 7,
            "detection_engines": 79,
            "detection_ratio": "0/79",
            "message": "search success",
            "permalink": "https://cybertotal.cycraft.com/app/intelligence/79ca1bd740564c36a7a4a78df5dc719d",
            "positive_detections": 0,
            "resource": "abc.com",
            "scan_date": "2020-06-18T03:19:48+00:00",
            "severity": 6,
            "task_id": "79ca1bd740564c36a7a4a78df5dc719d",
            "threat": "Medium"
        }
    },
    "DBotScore": {
        "Indicator": "abc.com",
        "Score": 0,
        "Type": "domain",
        "Vendor": "CyberTotal"
    },
    "Domain": {
        "DetectionEngines": 79,
        "Name": "abc.com"
    }
}

Human Readable Output

Domain List

confidence detection_engines detection_ratio message permalink positive_detections resource scan_date severity task_id threat
7 79 0/79 search success https://cybertotal.cycraft.com/app/intelligence/79ca1bd740564c36a7a4a78df5dc719d 0 abc.com 2020-06-18T03:19:48+00:00 6 79ca1bd740564c36a7a4a78df5dc719d Medium

url


Return domain information and reputation

Base Command

url

Input

Argument Name Description Required
url List of url(s). Required
threshold If the URL has reputation above the threshold then the URL defined as malicious. If threshold not set, then threshold from instance configuration is used. Optional

Context Output

Path Type Description
CyberTotal.URL.scan_date date Scan date format: ISO 8601
CyberTotal.URL.resource string The scan target sent to CyberTotal.
CyberTotal.URL.task_id string The unique id of each scan in CyberTotal.
CyberTotal.URL.permalink string The link of this URL’s report in CyberTotal.
CyberTotal.URL.severity number Severity of this URL. The range is from 0 to 10.
CyberTotal.URL.confidence number Confidence of this URL. The range is from 0 to 10.
CyberTotal.URL.threat string Threat of this URL, which is a select from ‘High’, ‘Medium’ and ‘Low’.
CyberTotal.URL.detection_engines number The number of all antivirus vendors scanned.
CyberTotal.URL.positive_detections number The number of antivirus vendors scanned with positive detection.
CyberTotal.URL.detection_ratio string The ratio of positive_detections and detection_engines.
CyberTotal.URL.message string Message about this search.
URL.Data String The URL
URL.DetectionEngines String The total number of engines that checked the indicator.
URL.PositiveDetections String The number of engines that positively detected the indicator as malicious.
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.

Command Example

!url url=http://abc.com

Context Example

{
    "CyberTotal": {
        "URL": {
            "confidence": 1,
            "detection_engines": 79,
            "detection_ratio": "0/79",
            "message": "search success",
            "permalink": "https://cybertotal.cycraft.com/app/intelligence/61bbc65f5c034930b8a659c39e745d96",
            "positive_detections": 0,
            "resource": "http://abc.com",
            "scan_date": "2020-06-22T07:24:16+00:00",
            "severity": 5,
            "task_id": "61bbc65f5c034930b8a659c39e745d96",
            "threat": "Medium"
        }
    },
    "DBotScore": {
        "Indicator": "http://abc.com",
        "Score": 0,
        "Type": "url",
        "Vendor": "CyberTotal"
    },
    "URL": {
        "Data": "http://abc.com",
        "DetectionEngines": 79
    }
}

Human Readable Output

URL List

confidence detection_engines detection_ratio message permalink positive_detections resource scan_date severity task_id threat
1 79 0/79 search success https://cybertotal.cycraft.com/app/intelligence/61bbc65f5c034930b8a659c39e745d96 0 http://abc.com 2020-06-22T07:24:16+00:00 5 61bbc65f5c034930b8a659c39e745d96 Medium

cybertotal-ip-whois


Return ip whois information

Base Command

cybertotal-ip-whois

Input

Argument Name Description Required
ip List of IP(s). Required

Context Output

Path Type Description
CyberTotal.WHOIS-IP.scan_date date Scan date format: ISO 8601
CyberTotal.WHOIS-IP.task_id string The unique id of each scan in CyberTotal.
CyberTotal.WHOIS-IP.resource string The scan target sent to CyberTotal.
CyberTotal.WHOIS-IP.message string Message about this search.
CyberTotal.WHOIS-IP.permalink string The link of this whois report in CyberTotal.
CyberTotal.WHOIS-IP.createdAt date Create date format: ISO 8601
CyberTotal.WHOIS-IP.updatedAt date Update date format: ISO 8601
CyberTotal.WHOIS-IP.status string Status of this IP
CyberTotal.WHOIS-IP.domain string Domain of this IP
CyberTotal.WHOIS-IP.domainMd5 string MD5 translation of CyberTotal.WHOIS-IP.domain
CyberTotal.WHOIS-IP.domainUnicode string Encode CyberTotal.WHOIS-IP.domain by using unicode
CyberTotal.WHOIS-IP.nameservers string An array of all DNS nameservers
CyberTotal.WHOIS-IP.registrarName string The name of registrar
CyberTotal.WHOIS-IP.registrarEmail string The email address of registrar
CyberTotal.WHOIS-IP.registrarPhone string The phone number of registrar
CyberTotal.WHOIS-IP.registrarCreatedAt date Registrar create date format: ISO 8601
CyberTotal.WHOIS-IP.registrarUpdatedAt date Registrar update date format: ISO 8601
CyberTotal.WHOIS-IP.registrarExpiresAt date Registrar expire date format: ISO 8601
CyberTotal.WHOIS-IP.auditCreatedAt date Registrar update date format: ISO 8601
CyberTotal.WHOIS-IP.auditUpdatedAt date Registrar expire date format: ISO 8601
CyberTotal.WHOIS-IP.registrant.name string The name of registrant
CyberTotal.WHOIS-IP.registrant.organization string The organization name of registrant
CyberTotal.WHOIS-IP.registrant.street string The street name of registrant
CyberTotal.WHOIS-IP.registrant.city string The location city of registrant
CyberTotal.WHOIS-IP.registrant.state string The location state name of registrant
CyberTotal.WHOIS-IP.registrant.zip string The post zip code of registrant
CyberTotal.WHOIS-IP.registrant.country string The country of registrant
CyberTotal.WHOIS-IP.registrant.address string The address of registrant
CyberTotal.WHOIS-IP.admin.name string The name of admin
CyberTotal.WHOIS-IP.admin.organization string The organization name of admin
CyberTotal.WHOIS-IP.admin.street string The street name of admin
CyberTotal.WHOIS-IP.admin.city string The location city of admin
CyberTotal.WHOIS-IP.admin.state string The location state name of admin
CyberTotal.WHOIS-IP.admin.zip string The post zip code of admin
CyberTotal.WHOIS-IP.admin.country string The country of admin
CyberTotal.WHOIS-IP.admin.address string The address of admin
CyberTotal.WHOIS-IP.technical.name string The name of technical
CyberTotal.WHOIS-IP.technical.organization string The organization name of technical
CyberTotal.WHOIS-IP.technical.street string The street name of technical
CyberTotal.WHOIS-IP.technical.city string The location city of technical
CyberTotal.WHOIS-IP.technical.state string The location state name of technical
CyberTotal.WHOIS-IP.technical.zip string The post zip code of technical
CyberTotal.WHOIS-IP.technical.country string The country of technical
CyberTotal.WHOIS-IP.technical.address string The address of technical
CyberTotal.WHOIS-IP.contactEmails string An array of all contact email address
CyberTotal.WHOIS-IP.contacts string An array of all contact details
CyberTotal.WHOIS-IP.contactNames string An array of all contact names
CyberTotal.WHOIS-IP.contactCountries string An array of all contact countries
CyberTotal.WHOIS-IP.domainAvailable boolean If this domain is available
CyberTotal.WHOIS-IP.expired boolean If this IP is expired

Command Example

!cybertotal-ip-whois ip=1.1.1.1

Context Example

{
    "CyberTotal": {
        "WHOIS-IP": {
            "abuse": {
                "address": "po box 3646\n4101\nqld\naustralia\n",
                "country": "australia",
                "email": "xxx@xxx.net",
                "id": 0,
                "name": "IRT-APNICRANDNET-AU",
                "state": "qld",
                "street": "po box 3646",
                "whoisContactID": 0,
                "zip": "4101"
            },
            "admin": {
                "address": "po box 3646\n4101\nqld\naustralia\n",
                "country": "australia",
                "email": "research@apnic.net",
                "fax": "+61-7-3858-3199",
                "id": 0,
                "name": "APNIC RESEARCH",
                "phone": "+61-7-3858-3188",
                "state": "qld",
                "street": "po box 3646",
                "whoisContactID": 0,
                "zip": "4101"
            },
            "auditCreatedAt": "2020-07-18T02:07:02+00:00",
            "auditUpdatedAt": "2020-07-18T02:07:02+00:00",
            "compositeParseCode": 10528,
            "contactCountries": [
                "australia"
            ],
            "contactEmails": [
                "research@apnic.net"
            ],
            "contactNames": [
                "APNIC RESEARCH"
            ],
            "contactOrganizations": [],
            "contacts": [
                {
                    "address": "po box 3646\n4101\nqld\naustralia\n",
                    "country": "australia",
                    "email": "research@apnic.net",
                    "fax": "+61-7-3858-3199",
                    "id": 0,
                    "name": "APNIC RESEARCH",
                    "phone": "+61-7-3858-3188",
                    "state": "qld",
                    "street": "po box 3646",
                    "whoisContactID": 0,
                    "zip": "4101"
                }
            ],
            "createdAt": "2020-07-18T02:07:02+00:00",
            "domain": "1.1.1.0",
            "domainAvailable": false,
            "domainMd5": "ede514d996ecdf82a0abf5356ff6a13c",
            "domainUnicode": "1.1.1.0",
            "expired": false,
            "id": 6690074356934458000,
            "message": "search success",
            "nameservers": [],
            "netRange": {
                "ipEnd": "1.1.1.255",
                "ipStart": "1.1.1.0",
                "netName": "APNIC-LABS",
                "netRange": "1.1.1.0 - 1.1.1.255",
                "numericEnd": 16843263,
                "numericStart": 16843008,
                "status": "INACTIVE",
                "whoisNetRangeID": 0
            },
            "noRecord": false,
            "permalink": [
                "https://cybertotal.cycraft.com/app/intelligence/5a2601d575ea44058efeb1aba995dc8d"
            ],
            "registrarName": "APNIC",
            "registrarParseCode": 10528,
            "registrarUpdatedAt": "2020-07-15T13:10:57+00:00",
            "resource": [
                "1.1.1.1"
            ],
            "scan_date": [
                "2020-07-28 14:11:19"
            ],
            "status": "ACTIVE",
            "task_id": "5a2601d575ea44058efeb1aba995dc8d",
            "technical": {
                "address": "po box 3646\n4101\nqld\naustralia\n",
                "country": "australia",
                "email": "research@apnic.net",
                "fax": "+61-7-3858-3199",
                "id": 0,
                "name": "APNIC RESEARCH",
                "phone": "+61-7-3858-3188",
                "state": "qld",
                "street": "po box 3646",
                "whoisContactID": 0,
                "zip": "4101"
            },
            "tld": "ipv4",
            "updatedAt": "2020-07-18T02:07:02+00:00",
            "whoisID": 6690074356934458000,
            "whoisServer": "rdap.apnic.net"
        }
    }
}

Human Readable Output

Results

abuse admin auditCreatedAt auditUpdatedAt compositeParseCode contactCountries contactEmails contactNames contactOrganizations contacts createdAt domain domainAvailable domainMd5 domainUnicode expired id message nameservers netRange noRecord permalink registrarName registrarParseCode registrarUpdatedAt resource scan_date status task_id technical tld updatedAt whoisID whoisServer
whoisContactID: 0
email: xxx@xxx.net
name: IRT-APNICRANDNET-AU
street: po box 3646
state: qld
zip: 4101
country: australia
address: po box 3646
4101
qld
australia

id: 0
whoisContactID: 0
email: research@apnic.net
name: APNIC RESEARCH
street: po box 3646
state: qld
zip: 4101
country: australia
phone: +61-7-3858-3188
fax: +61-7-3858-3199
address: po box 3646
4101
qld
australia

id: 0
2020-07-18T02:07:02+00:00 2020-07-18T02:07:02+00:00 10528 australia research@apnic.net APNIC RESEARCH   {‘whoisContactID’: 0, ‘email’: ‘research@apnic.net’, ‘name’: ‘APNIC RESEARCH’, ‘street’: ‘po box 3646’, ‘state’: ‘qld’, ‘zip’: ‘4101’, ‘country’: ‘australia’, ‘phone’: ‘+61-7-3858-3188’, ‘fax’: ‘+61-7-3858-3199’, ‘address’: ‘po box 3646\n4101\nqld\naustralia\n’, ‘id’: 0} 2020-07-18T02:07:02+00:00 1.1.1.0 false ede514d996ecdf82a0abf5356ff6a13c 1.1.1.0 false 6690074356934458403 search success   status: INACTIVE
whoisNetRangeID: 0
netRange: 1.1.1.0 - 1.1.1.255
netName: APNIC-LABS
ipStart: 1.1.1.0
ipEnd: 1.1.1.255
numericEnd: 16843263
numericStart: 16843008
false [“https://cybertotal.cycraft.com/app/intelligence/5a2601d575ea44058efeb1aba995dc8d”] APNIC 10528 2020-07-15T13:10:57+00:00 [“1.1.1.1”] [“2020-07-28 14:11:19”] ACTIVE 5a2601d575ea44058efeb1aba995dc8d whoisContactID: 0
email: research@apnic.net
name: APNIC RESEARCH
street: po box 3646
state: qld
zip: 4101
country: australia
phone: +61-7-3858-3188
fax: +61-7-3858-3199
address: po box 3646
4101
qld
australia

id: 0
ipv4 2020-07-18T02:07:02+00:00 6690074356934458403 rdap.apnic.net

cybertotal-url-whois


Return url whois information

Base Command

cybertotal-url-whois

Input

Argument Name Description Required
url List of URL(s). Required

Context Output

Path Type Description
CyberTotal.WHOIS-URL.scan_date date Scan date format: ISO 8601
CyberTotal.WHOIS-URL.task_id string The unique id of each scan in CyberTotal.
CyberTotal.WHOIS-URL.resource string The scan target sent to CyberTotal.
CyberTotal.WHOIS-URL.message string Message about this search.
CyberTotal.WHOIS-URL.permalink string The link of this whois report in CyberTotal.
CyberTotal.WHOIS-URL.createdAt date Create date format: ISO 8601
CyberTotal.WHOIS-URL.updatedAt date Update date format: ISO 8601
CyberTotal.WHOIS-URL.status string Status of this IP
CyberTotal.WHOIS-URL.domain string Domain of this IP
CyberTotal.WHOIS-URL.domainMd5 string MD5 translation of CyberTotal.WHOIS-URL.domain
CyberTotal.WHOIS-URL.domainUnicode string Encode CyberTotal.WHOIS-URL.domain by using unicode
CyberTotal.WHOIS-URL.nameservers string An array of all DNS nameservers
CyberTotal.WHOIS-URL.registrarName string The name of registrar
CyberTotal.WHOIS-URL.registrarEmail string The email address of registrar
CyberTotal.WHOIS-URL.registrarPhone string The phone number of registrar
CyberTotal.WHOIS-URL.registrarCreatedAt date Registrar create date format: ISO 8601
CyberTotal.WHOIS-URL.registrarUpdatedAt date Registrar update date format: ISO 8601
CyberTotal.WHOIS-URL.registrarExpiresAt date Registrar expire date format: ISO 8601
CyberTotal.WHOIS-URL.auditCreatedAt date Registrar update date format: ISO 8601
CyberTotal.WHOIS-URL.auditUpdatedAt date Registrar expire date format: ISO 8601
CyberTotal.WHOIS-URL.registrant.name string The name of registrant
CyberTotal.WHOIS-URL.registrant.organization string The organization name of registrant
CyberTotal.WHOIS-URL.registrant.street string The street name of registrant
CyberTotal.WHOIS-URL.registrant.city string The location city of registrant
CyberTotal.WHOIS-URL.registrant.state string The location state name of registrant
CyberTotal.WHOIS-URL.registrant.zip string The post zip code of registrant
CyberTotal.WHOIS-URL.registrant.country string The country of registrant
CyberTotal.WHOIS-URL.registrant.address string The address of registrant
CyberTotal.WHOIS-URL.admin.name string The name of admin
CyberTotal.WHOIS-URL.admin.organization string The organization name of admin
CyberTotal.WHOIS-URL.admin.street string The street name of admin
CyberTotal.WHOIS-URL.admin.city string The location city of admin
CyberTotal.WHOIS-URL.admin.state string The location state name of admin
CyberTotal.WHOIS-URL.admin.zip string The post zip code of admin
CyberTotal.WHOIS-URL.admin.country string The country of admin
CyberTotal.WHOIS-URL.admin.address string The address of admin
CyberTotal.WHOIS-URL.technical.name string The name of technical
CyberTotal.WHOIS-URL.technical.organization string The organization name of technical
CyberTotal.WHOIS-URL.technical.street string The street name of technical
CyberTotal.WHOIS-URL.technical.city string The location city of technical
CyberTotal.WHOIS-URL.technical.state string The location state name of technical
CyberTotal.WHOIS-URL.technical.zip string The post zip code of technical
CyberTotal.WHOIS-URL.technical.country string The country of technical
CyberTotal.WHOIS-URL.technical.address string The address of technical
CyberTotal.WHOIS-URL.contactEmails string An array of all contact email address
CyberTotal.WHOIS-URL.contacts string An array of all contact details
CyberTotal.WHOIS-URL.contactNames string An array of all contact names
CyberTotal.WHOIS-URL.contactCountries string An array of all contact countries
CyberTotal.WHOIS-URL.domainAvailable boolean If this domain is available
CyberTotal.WHOIS-URL.expired boolean If this URL is expired

Command Example

!cybertotal-url-whois url=http://abc.com

Context Example

{
    "CyberTotal": {
        "WHOIS-URL": {
            "admin": {
                "address": "New York\n10023-6298\nNY\nUS\n",
                "city": "New York",
                "country": "US",
                "email": "xxx@xxx.net",
                "fax": "18182384694",
                "id": 0,
                "name": "ABC, Inc.; Domain Administrator",
                "organization": "ABC, Inc.",
                "phone": "18182384694",
                "state": "NY",
                "whoisContactID": 0,
                "zip": "10023-6298"
            },
            "auditCreatedAt": "2020-04-09T07:17:45+00:00",
            "auditUpdatedAt": "2020-04-09T07:17:45+00:00",
            "compositeParseCode": 3579,
            "contactCountries": [
                "US"
            ],
            "contactEmails": [
                "corp.dns.domains@testcorp.com"
            ],
            "contactNames": [
                "ABC, Inc.; Domain Administrator"
            ],
            "contactOrganizations": [
                "ABC, Inc."
            ],
            "contacts": [
                {
                    "address": "New York\n10023-6298\nNY\nUS\n",
                    "city": "New York",
                    "country": "US",
                    "email": "xxx@xxx.net",
                    "fax": "18182384694",
                    "id": 0,
                    "name": "ABC, Inc.; Domain Administrator",
                    "organization": "ABC, Inc.",
                    "phone": "18182384694",
                    "state": "NY",
                    "whoisContactID": 0,
                    "zip": "10023-6298"
                }
            ],
            "createdAt": "2020-04-09T07:17:45+00:00",
            "domain": "abc.com",
            "domainAvailable": false,
            "domainMd5": "929ba26f492f86d4a9d66a080849865a",
            "domainStatus": "clientTransferProhibited serverDeleteProhibited serverTransferProhibited serverUpdateProhibited",
            "domainUnicode": "abc.com",
            "expired": false,
            "id": 6653913764397840000,
            "message": "search success",
            "nameservers": [
                "ns-1368.awsdns-43.org",
                "ns-1869.awsdns-41.co.uk",
                "ns-318.awsdns-39.com",
                "ns-736.awsdns-28.net"
            ],
            "noRecord": false,
            "permalink": [
                "https://cybertotal.cycraft.com/app/intelligence/61bbc65f5c034930b8a659c39e745d96"
            ],
            "registrant": {
                "address": "New York\n10023-6298\nNY\nUS\n",
                "city": "New York",
                "country": "US",
                "email": "xxx@xxx.net",
                "fax": "18182384694",
                "id": 0,
                "name": "ABC, Inc.; Domain Administrator",
                "organization": "ABC, Inc.",
                "phone": "18182384694",
                "state": "NY",
                "whoisContactID": 0,
                "zip": "10023-6298"
            },
            "registrarCreatedAt": "1996-05-22T04:00:00+00:00",
            "registrarEmail": "domainabuse@cscglobal.com",
            "registrarExpiresAt": "2021-05-23T04:00:00+00:00",
            "registrarIanaID": 299,
            "registrarName": "CSC Corporate Domains, Inc.",
            "registrarParseCode": 3579,
            "registrarPhone": "+1.8887802723",
            "registrarUpdatedAt": "2020-04-08T07:06:06+00:00",
            "registryParseCode": 251,
            "resource": [
                "http://abc.com"
            ],
            "scan_date": [
                "2020-06-22 07:24:16"
            ],
            "status": "ACTIVE",
            "task_id": "61bbc65f5c034930b8a659c39e745d96",
            "technical": {
                "address": "New York\n10023-6298\nNY\nUS\n",
                "city": "New York",
                "country": "US",
                "email": "xxx@xxx.net",
                "fax": "18182384694",
                "id": 0,
                "name": "ABC, Inc.; Domain Administrator",
                "organization": "ABC, Inc.",
                "phone": "18182384694",
                "state": "NY",
                "whoisContactID": 0,
                "zip": "10023-6298"
            },
            "tld": "com",
            "updatedAt": "2020-04-09T07:17:45+00:00",
            "whoisID": 6653913764397840000,
            "whoisServer": "whois.corporatedomains.com"
        }
    }
}

Human Readable Output

Results

admin auditCreatedAt auditUpdatedAt compositeParseCode contactCountries contactEmails contactNames contactOrganizations contacts createdAt domain domainAvailable domainMd5 domainStatus domainUnicode expired id message nameservers noRecord permalink registrant registrarCreatedAt registrarEmail registrarExpiresAt registrarIanaID registrarName registrarParseCode registrarPhone registrarUpdatedAt registryParseCode resource scan_date status task_id technical tld updatedAt whoisID whoisServer
whoisContactID: 0
email: xxx@xxx.net
name: ABC, Inc.; Domain Administrator
organization: ABC, Inc.
city: New York
state: NY
zip: 10023-6298
country: US
phone: 18182384694
fax: 18182384694
address: New York
10023-6298
NY
US

id: 0
2020-04-09T07:17:45+00:00 2020-04-09T07:17:45+00:00 3579 US corp.dns.domains@testcorp.com ABC, Inc.; Domain Administrator ABC, Inc. {‘whoisContactID’: 0, ‘email’: ‘xxx@xxx.net’, ‘name’: ‘ABC, Inc.; Domain Administrator’, ‘organization’: ‘ABC, Inc.’, ‘city’: ‘New York’, ‘state’: ‘NY’, ‘zip’: ‘10023-6298’, ‘country’: ‘US’, ‘phone’: ‘18182384694’, ‘fax’: ‘18182384694’, ‘address’: ‘New York\n10023-6298\nNY\nUS\n’, ‘id’: 0} 2020-04-09T07:17:45+00:00 abc.com false 929ba26f492f86d4a9d66a080849865a clientTransferProhibited serverDeleteProhibited serverTransferProhibited serverUpdateProhibited abc.com false 6653913764397840884 search success ns-1368.awsdns-43.org,
ns-1869.awsdns-41.co.uk,
ns-318.awsdns-39.com,
ns-736.awsdns-28.net
false [“https://cybertotal.cycraft.com/app/intelligence/61bbc65f5c034930b8a659c39e745d96”] whoisContactID: 0
email: xxx@xxx.net
name: ABC, Inc.; Domain Administrator
organization: ABC, Inc.
city: New York
state: NY
zip: 10023-6298
country: US
phone: 18182384694
fax: 18182384694
address: New York
10023-6298
NY
US

id: 0
1996-05-22T04:00:00+00:00 domainabuse@cscglobal.com 2021-05-23T04:00:00+00:00 299 CSC Corporate Domains, Inc. 3579 +1.8887802723 2020-04-08T07:06:06+00:00 251 [“http://abc.com”] [“2020-06-22 07:24:16”] ACTIVE 61bbc65f5c034930b8a659c39e745d96 whoisContactID: 0
email: xxx@xxx.net
name: ABC, Inc.; Domain Administrator
organization: ABC, Inc.
city: New York
state: NY
zip: 10023-6298
country: US
phone: 18182384694
fax: 18182384694
address: New York
10023-6298
NY
US

id: 0
com 2020-04-09T07:17:45+00:00 6653913764397840884 whois.corporatedomains.com

cybertotal-domain-whois


Return domain whois information

Base Command

cybertotal-domain-whois

Input

Argument Name Description Required
domain List of domain(s). Required

Context Output

Path Type Description
CyberTotal.WHOIS-Domain.scan_date date Scan date format: ISO 8601
CyberTotal.WHOIS-Domain.task_id string The unique id of each scan in CyberTotal.
CyberTotal.WHOIS-Domain.resource string The scan target sent to CyberTotal.
CyberTotal.WHOIS-Domain.message string Message about this search.
CyberTotal.WHOIS-Domain.permalink string The link of this whois report in CyberTotal.
CyberTotal.WHOIS-Domain.createdAt date Create date format: ISO 8601
CyberTotal.WHOIS-Domain.updatedAt date Update date format: ISO 8601
CyberTotal.WHOIS-Domain.status string Status of this Domain
CyberTotal.WHOIS-Domain.domain string Top level Domain of this domain
CyberTotal.WHOIS-Domain.domainMd5 string MD5 translation of CyberTotal.WHOIS-Domain.domain
CyberTotal.WHOIS-Domain.domainUnicode string Encode CyberTotal.WHOIS-Domain.domain by using unicode
CyberTotal.WHOIS-Domain.nameservers string An array of all DNS nameservers
CyberTotal.WHOIS-Domain.registrarName string The name of registrar
CyberTotal.WHOIS-Domain.registrarEmail string The email address of registrar
CyberTotal.WHOIS-Domain.registrarPhone string The phone number of registrar
CyberTotal.WHOIS-Domain.registrarCreatedAt date Registrar create date format: ISO 8601
CyberTotal.WHOIS-Domain.registrarUpdatedAt date Registrar update date format: ISO 8601
CyberTotal.WHOIS-Domain.registrarExpiresAt date Registrar expire date format: ISO 8601
CyberTotal.WHOIS-Domain.auditCreatedAt date Registrar update date format: ISO 8601
CyberTotal.WHOIS-Domain.auditUpdatedAt date Registrar expire date format: ISO 8601
CyberTotal.WHOIS-Domain.registrant.name string The name of registrant
CyberTotal.WHOIS-Domain.registrant.organization string The organization name of registrant
CyberTotal.WHOIS-Domain.registrant.street string The street name of registrant
CyberTotal.WHOIS-Domain.registrant.city string The location city of registrant
CyberTotal.WHOIS-Domain.registrant.state string The location state name of registrant
CyberTotal.WHOIS-Domain.registrant.zip string The post zip code of registrant
CyberTotal.WHOIS-Domain.registrant.country string The country of registrant
CyberTotal.WHOIS-Domain.registrant.address string The address of registrant
CyberTotal.WHOIS-Domain.admin.name string The name of admin
CyberTotal.WHOIS-Domain.admin.organization string The organization name of admin
CyberTotal.WHOIS-Domain.admin.street string The street name of admin
CyberTotal.WHOIS-Domain.admin.city string The location city of admin
CyberTotal.WHOIS-Domain.admin.state string The location state name of admin
CyberTotal.WHOIS-Domain.admin.zip string The post zip code of admin
CyberTotal.WHOIS-Domain.admin.country string The country of admin
CyberTotal.WHOIS-Domain.admin.address string The address of admin
CyberTotal.WHOIS-Domain.technical.name string The name of technical
CyberTotal.WHOIS-Domain.technical.organization string The organization name of technical
CyberTotal.WHOIS-Domain.technical.street string The street name of technical
CyberTotal.WHOIS-Domain.technical.city string The location city of technical
CyberTotal.WHOIS-Domain.technical.state string The location state name of technical
CyberTotal.WHOIS-Domain.technical.zip string The post zip code of technical
CyberTotal.WHOIS-Domain.technical.country string The country of technical
CyberTotal.WHOIS-Domain.technical.address string The address of technical
CyberTotal.WHOIS-Domain.contactEmails string An array of all contact email address
CyberTotal.WHOIS-Domain.contacts string An array of all contact details
CyberTotal.WHOIS-Domain.contactNames string An array of all contact names
CyberTotal.WHOIS-Domain.contactCountries string An array of all contact countries
CyberTotal.WHOIS-Domain.domainAvailable boolean If this domain is available
CyberTotal.WHOIS-Domain.expired boolean If this domain is expired

Command Example

!cybertotal-domain-whois domain=abc.com

Context Example

{
    "CyberTotal": {
        "WHOIS-Domain": {
            "admin": {
                "address": "New York\n10023-6298\nNY\nUS\n",
                "city": "New York",
                "country": "US",
                "email": "xxx@xxx.net",
                "fax": "18182384694",
                "id": 0,
                "name": "ABC, Inc.; Domain Administrator",
                "organization": "ABC, Inc.",
                "phone": "18182384694",
                "state": "NY",
                "whoisContactID": 0,
                "zip": "10023-6298"
            },
            "auditCreatedAt": "2020-04-09T07:17:45+00:00",
            "auditUpdatedAt": "2020-04-09T07:17:45+00:00",
            "compositeParseCode": 3579,
            "contactCountries": [
                "US"
            ],
            "contactEmails": [
                "corp.dns.domains@testcorp.com"
            ],
            "contactNames": [
                "ABC, Inc.; Domain Administrator"
            ],
            "contactOrganizations": [
                "ABC, Inc."
            ],
            "contacts": [
                {
                    "address": "New York\n10023-6298\nNY\nUS\n",
                    "city": "New York",
                    "country": "US",
                    "email": "xxx@xxx.net",
                    "fax": "18182384694",
                    "id": 0,
                    "name": "ABC, Inc.; Domain Administrator",
                    "organization": "ABC, Inc.",
                    "phone": "18182384694",
                    "state": "NY",
                    "whoisContactID": 0,
                    "zip": "10023-6298"
                }
            ],
            "createdAt": "2020-04-09T07:17:45+00:00",
            "domain": "abc.com",
            "domainAvailable": false,
            "domainMd5": "929ba26f492f86d4a9d66a080849865a",
            "domainStatus": "clientTransferProhibited serverDeleteProhibited serverTransferProhibited serverUpdateProhibited",
            "domainUnicode": "abc.com",
            "expired": false,
            "id": 6653913764397840000,
            "message": "search success",
            "nameservers": [
                "ns-1368.awsdns-43.org",
                "ns-1869.awsdns-41.co.uk",
                "ns-318.awsdns-39.com",
                "ns-736.awsdns-28.net"
            ],
            "noRecord": false,
            "permalink": [
                "https://cybertotal.cycraft.com/app/intelligence/79ca1bd740564c36a7a4a78df5dc719d"
            ],
            "registrant": {
                "address": "New York\n10023-6298\nNY\nUS\n",
                "city": "New York",
                "country": "US",
                "email": "xxx@xxx.net",
                "fax": "18182384694",
                "id": 0,
                "name": "ABC, Inc.; Domain Administrator",
                "organization": "ABC, Inc.",
                "phone": "18182384694",
                "state": "NY",
                "whoisContactID": 0,
                "zip": "10023-6298"
            },
            "registrarCreatedAt": "1996-05-22T04:00:00+00:00",
            "registrarEmail": "domainabuse@cscglobal.com",
            "registrarExpiresAt": "2021-05-23T04:00:00+00:00",
            "registrarIanaID": 299,
            "registrarName": "CSC Corporate Domains, Inc.",
            "registrarParseCode": 3579,
            "registrarPhone": "+1.8887802723",
            "registrarUpdatedAt": "2020-04-08T07:06:06+00:00",
            "registryParseCode": 251,
            "resource": [
                "abc.com"
            ],
            "scan_date": [
                "2020-06-18 03:19:48"
            ],
            "status": "ACTIVE",
            "task_id": "79ca1bd740564c36a7a4a78df5dc719d",
            "technical": {
                "address": "New York\n10023-6298\nNY\nUS\n",
                "city": "New York",
                "country": "US",
                "email": "xxx@xxx.net",
                "fax": "18182384694",
                "id": 0,
                "name": "ABC, Inc.; Domain Administrator",
                "organization": "ABC, Inc.",
                "phone": "18182384694",
                "state": "NY",
                "whoisContactID": 0,
                "zip": "10023-6298"
            },
            "tld": "com",
            "updatedAt": "2020-04-09T07:17:45+00:00",
            "whoisID": 6653913764397840000,
            "whoisServer": "whois.corporatedomains.com"
        }
    }
}

Human Readable Output

Results

admin auditCreatedAt auditUpdatedAt compositeParseCode contactCountries contactEmails contactNames contactOrganizations contacts createdAt domain domainAvailable domainMd5 domainStatus domainUnicode expired id message nameservers noRecord permalink registrant registrarCreatedAt registrarEmail registrarExpiresAt registrarIanaID registrarName registrarParseCode registrarPhone registrarUpdatedAt registryParseCode resource scan_date status task_id technical tld updatedAt whoisID whoisServer
whoisContactID: 0
email: xxx@xxx.net
name: ABC, Inc.; Domain Administrator
organization: ABC, Inc.
city: New York
state: NY
zip: 10023-6298
country: US
phone: 18182384694
fax: 18182384694
address: New York
10023-6298
NY
US

id: 0
2020-04-09T07:17:45+00:00 2020-04-09T07:17:45+00:00 3579 US corp.dns.domains@testcorp.com ABC, Inc.; Domain Administrator ABC, Inc. {‘whoisContactID’: 0, ‘email’: ‘xxx@xxx.net’, ‘name’: ‘ABC, Inc.; Domain Administrator’, ‘organization’: ‘ABC, Inc.’, ‘city’: ‘New York’, ‘state’: ‘NY’, ‘zip’: ‘10023-6298’, ‘country’: ‘US’, ‘phone’: ‘18182384694’, ‘fax’: ‘18182384694’, ‘address’: ‘New York\n10023-6298\nNY\nUS\n’, ‘id’: 0} 2020-04-09T07:17:45+00:00 abc.com false 929ba26f492f86d4a9d66a080849865a clientTransferProhibited serverDeleteProhibited serverTransferProhibited serverUpdateProhibited abc.com false 6653913764397840884 search success ns-1368.awsdns-43.org,
ns-1869.awsdns-41.co.uk,
ns-318.awsdns-39.com,
ns-736.awsdns-28.net
false [“https://cybertotal.cycraft.com/app/intelligence/79ca1bd740564c36a7a4a78df5dc719d”] whoisContactID: 0
email: xxx@xxx.net
name: ABC, Inc.; Domain Administrator
organization: ABC, Inc.
city: New York
state: NY
zip: 10023-6298
country: US
phone: 18182384694
fax: 18182384694
address: New York
10023-6298
NY
US

id: 0
1996-05-22T04:00:00+00:00 domainabuse@cscglobal.com 2021-05-23T04:00:00+00:00 299 CSC Corporate Domains, Inc. 3579 +1.8887802723 2020-04-08T07:06:06+00:00 251 [“abc.com”] [“2020-06-18 03:19:48”] ACTIVE 79ca1bd740564c36a7a4a78df5dc719d whoisContactID: 0
email: xxx@xxx.net
name: ABC, Inc.; Domain Administrator
organization: ABC, Inc.
city: New York
state: NY
zip: 10023-6298
country: US
phone: 18182384694
fax: 18182384694
address: New York
10023-6298
NY
US

id: 0
com 2020-04-09T07:17:45+00:00 6653913764397840884 whois.corporatedomains.com

Configuration parameters

  • url — CyberTotal URL (required)
  • token — CyberTotal API Token (required)
  • feed — Fetch indicators
  • threshold_ip — Bad ip threshold
  • threshold_file — Bad hash threshold
  • threshold_domain — Bad domain threshold
  • threshold_url — Bad url threshold
  • insecure — Trust any certificate (not secure)
  • proxy — Use system proxy settings
  • integrationReliability — Source Reliability
  • feedExpirationPolicy
  • feedExpirationInterval

Commands (7)

  • cybertotal-domain-whois

    Return domain whois information.

  • cybertotal-ip-whois

    Return ip whois information.

  • cybertotal-url-whois

    Return url whois information.

  • domain

    Return domain information and reputation.

  • file

    Return file's information and reputation.

  • ip

    Return IP information and reputation.

  • url

    Return domain information and reputation.

import traceback
from datetime import timezone
from typing import Any
from urllib.parse import urlparse

import dateparser
import demistomock as demisto  # noqa: F401
import urllib3
from CommonServerPython import *  # noqa: F401

# Disable insecure warnings
urllib3.disable_warnings()

""" CONSTANTS """
UTC = timezone.utc  # noqa: UP017

""" CLIENT CLASS """


class Client(BaseClient):
    def parse_reputation(self, cybertotal_result: dict, resource: str) -> dict[str, Any]:
        scan_time = datetime.fromtimestamp(cybertotal_result["scan_time"], UTC).isoformat()
        permalink = cybertotal_result["url"]
        url_path = urlparse(permalink).path
        (_, _, task_id) = url_path.rpartition("/")

        result = {
            "permalink": permalink,
            "resource": resource,
            "positive_detections": 0,
            "detection_engines": 0,
            "scan_date": scan_time,
            "task_id": task_id,
            "detection_ratio": "0/0",
        }

        if "basic" not in cybertotal_result:
            result["message"] = "search success with no basic in cybertotal result"
            return result
        positive_detections = 0
        detection_engines = 0
        if "reputation" in cybertotal_result["basic"] and "avVenders" in cybertotal_result["basic"]["reputation"]:
            detection_engines = len(cybertotal_result["basic"]["reputation"]["avVenders"])
            for avVender in cybertotal_result["basic"]["reputation"]["avVenders"]:
                if avVender["detected"]:
                    positive_detections = positive_detections + 1
        result["positive_detections"] = positive_detections
        result["detection_engines"] = detection_engines
        result["detection_ratio"] = str(positive_detections) + "/" + str(detection_engines)
        result["message"] = "search success"
        if "score" in cybertotal_result["basic"]:
            result["severity"] = cybertotal_result["basic"]["score"].get("severity", -1)
            result["confidence"] = cybertotal_result["basic"]["score"].get("confidence", -1)
            result["threat"] = cybertotal_result["basic"]["score"].get("threat", "")
        return result

    def get_ip_reputation(self, ip: str) -> dict[str, Any]:
        """Gets the IP reputation using the '/_api/search/ip/basic' API endpoint

        :type ip: ``str``
        :param ip: IP address to get the reputation for

        :return: dict containing the IP reputation as returned from the API
        :rtype: ``Dict[str, Any]``
        """

        cybertotal_result = self._http_request(
            method="GET", url_suffix=f"/_api/search/ip/basic/{ip}", ok_codes=(200, 201, 400), resp_type="response"
        )

        status_code = cybertotal_result.status_code
        cybertotal_result = cybertotal_result.json()

        if status_code == 400 and cybertotal_result.get("non_field_errors"):
            return {"non_field_errors": cybertotal_result.get("non_field_errors")}

        if status_code == 400:
            raise DemistoException(f"Error in API call [{status_code}] - {cybertotal_result}")

        if "task_state" in cybertotal_result:
            return {"task_state": cybertotal_result["task_state"], "message": "this search is in progress, try again later..."}

        return self.parse_reputation(cybertotal_result, ip)

    def get_url_reputation(self, url: str) -> dict[str, Any]:  # pragma: nocover
        """Gets the URL reputation using the '/_api/search/url/basic' API endpoint

        :type url: ``str``
        :param url: URL to get the reputation for

        :return: dict containing the URL reputation as returned from the API
        :rtype: ``Dict[str, Any]``
        """

        cybertotal_result = self._http_request(
            method="GET", url_suffix=f"/_api/search/url/basic?q={url}", ok_codes=(200, 201, 400), resp_type="response"
        )

        status_code = cybertotal_result.status_code
        cybertotal_result = cybertotal_result.json()

        if status_code == 400 and cybertotal_result.get("non_field_errors"):
            return {"non_field_errors": cybertotal_result.get("non_field_errors")}

        if status_code == 400:
            raise DemistoException(f"Error in API call [{status_code}] - {cybertotal_result}")

        if "task_state" in cybertotal_result:
            return {"task_state": cybertotal_result["task_state"], "message": "this search is in progress, try again later..."}

        return self.parse_reputation(cybertotal_result, url)

    def get_file_reputation(self, _hash: str) -> dict[str, Any]:
        """Gets the File reputation using the '/_api/search/hash/basic' API endpoint

        :type file: ``str``
        :param file: File to get the reputation for

        :return: dict containing the File reputation as returned from the API
        :rtype: ``Dict[str, Any]``
        """

        cybertotal_result = self._http_request(method="GET", url_suffix=f"/_api/search/hash/basic/{_hash}")
        if "task_state" in cybertotal_result:
            return {"task_state": cybertotal_result["task_state"], "message": "this search is in progress, try again later..."}

        result = self.parse_reputation(cybertotal_result, _hash)

        if "BasicInfo" not in cybertotal_result["basic"]:
            result["message"] = "search success with no BasicInfo in cybertotal result"
            return result

        basic = cybertotal_result["basic"]["BasicInfo"]
        result["size"] = basic.get("filesize", "")
        result["md5"] = basic.get("md5", "")
        result["sha1"] = basic.get("sha1", "")
        result["sha256"] = basic.get("sha256", "")
        result["extension"] = basic.get("file_type_extension", "")
        result["name"] = basic.get("display_name", "")
        if type(result["name"]) is list:
            result["name"] = ", ".join(result["name"])
        return result

    def get_domain_reputation(self, domain: str) -> dict[str, Any]:
        """Gets the Domain reputation using the '/_api/search/domain/basic' API endpoint

        :type domain: ``str``
        :param domain: Domain to get the reputation for

        :return: dict containing the Domain reputation as returned from the API
        :rtype: ``Dict[str, Any]``
        """

        cybertotal_result = self._http_request(method="GET", url_suffix=f"/_api/search/domain/basic/{domain}")
        if "task_state" in cybertotal_result:
            return {"task_state": cybertotal_result["task_state"], "message": "this search is in progress, try again later..."}

        return self.parse_reputation(cybertotal_result, domain)

    def parse_whois(self, cybertotal_result: dict, resource: str) -> dict[str, Any]:
        scan_time = datetime.fromtimestamp(cybertotal_result["scan_time"], UTC).isoformat()
        permalink = cybertotal_result["url"]
        url_path = urlparse(permalink).path
        (_, _, task_id) = url_path.rpartition("/")

        result = {}
        if "whois" in cybertotal_result and len(cybertotal_result["whois"]) > 0:
            result = cybertotal_result["whois"].pop(0)
        result["permalink"] = (permalink,)
        result["resource"] = (resource,)
        scan_time_date = dateparser.parse(scan_time)
        assert scan_time_date is not None, f"could not parse {scan_time}"
        result["scan_date"] = (scan_time_date.strftime("%Y-%m-%d %H:%M:%S"),)
        result["task_id"] = task_id
        result["message"] = "search success"
        if "createdAt" in result:
            result["createdAt"] = datetime.fromtimestamp(result["createdAt"], UTC).isoformat()
        if "updatedAt" in result:
            result["updatedAt"] = datetime.fromtimestamp(result["updatedAt"], UTC).isoformat()
        if "registrarCreatedAt" in result:
            result["registrarCreatedAt"] = datetime.fromtimestamp(result["registrarCreatedAt"], UTC).isoformat()
        if "registrarUpdatedAt" in result:
            result["registrarUpdatedAt"] = datetime.fromtimestamp(result["registrarUpdatedAt"], UTC).isoformat()
        if "registrarExpiresAt" in result:
            result["registrarExpiresAt"] = datetime.fromtimestamp(result["registrarExpiresAt"], UTC).isoformat()
        if "auditCreatedAt" in result:
            result["auditCreatedAt"] = datetime.fromtimestamp(result["auditCreatedAt"], UTC).isoformat()
        if "auditUpdatedAt" in result:
            result["auditUpdatedAt"] = datetime.fromtimestamp(result["auditUpdatedAt"], UTC).isoformat()
        if "rawResponse" in result:
            result.pop("rawResponse")
        return result

    def get_ip_whois(self, ip: str) -> dict[str, Any]:
        """Gets the IP-whois information using the '/_api/search/ip/whois' API endpoint

        :type ip: ``str``
        :param ip: IP address to get the whois information for

        :return: dict containing the IP whois information as returned from the API
        :rtype: ``Dict[str, Any]``
        """

        cybertotal_result = self._http_request(method="GET", url_suffix=f"/_api/search/ip/whois/{ip}")
        if "task_state" in cybertotal_result:
            return {"task_state": cybertotal_result["task_state"], "message": "this search is in progress, try again later..."}

        return self.parse_whois(cybertotal_result, ip)

    def get_url_whois(self, url: str) -> dict[str, Any]:
        """Gets the URL-whois information using the '/_api/search/url/whois' API endpoint

        :type url: ``str``
        :param url: URL to get the whois information for

        :return: dict containing the URL whois information as returned from the API
        :rtype: ``Dict[str, Any]``
        """

        cybertotal_result = self._http_request(method="GET", url_suffix=f"/_api/search/url/whois?q={url}")
        if "task_state" in cybertotal_result:
            return {"task_state": cybertotal_result["task_state"], "message": "this search is in progress, try again later..."}

        return self.parse_whois(cybertotal_result, url)

    def get_domain_whois(self, domain: str) -> dict[str, Any]:
        """Gets the Domain-whois information using the '/_api/search/domain/whois' API endpoint

        :type domain: ``str``
        :param domain: Domain to get the whois information for

        :return: dict containing the Domain whois information as returned from the API
        :rtype: ``Dict[str, Any]``
        """

        cybertotal_result = self._http_request(method="GET", url_suffix=f"/_api/search/domain/whois/{domain}")
        if "task_state" in cybertotal_result:
            return {"task_state": cybertotal_result["task_state"], "message": "this search is in progress, try again later..."}

        return self.parse_whois(cybertotal_result, domain)


def ip_reputation_command(client: Client, args: dict[str, Any], default_threshold: int) -> list[CommandResults]:
    """ip command: Returns IP reputation for a list of IPs

    :type client: ``Client``
    :param Client: CyberTotal client to use

    :type args: ``Dict[str, Any]``
    :param args:
        all command arguments, usually passed from ``demisto.args()``.
        ``args['ip']`` is a list of IPs or a single IP
        ``args['threshold']`` threshold to determine whether an IP is malicious

    :type default_threshold: ``int``
    :param default_threshold:
        default threshold to determine whether an IP is malicious
        if threshold is not specified in the XSOAR arguments

    :return:
        A ``CommandResults`` object that is then passed to ``return_results``,
        that contains IPs

    :rtype: ``CommandResults``
    """

    ips = argToList(args.get("ip"))
    if len(ips) == 0:
        raise ValueError("IP(s) not specified")

    threshold = int(args.get("threshold", default_threshold))

    command_results: list[CommandResults] = []
    ip_message_list: list[dict[str, Any]] = []
    non_field_errors: list[str] = []

    for ip in ips:
        ip_data = client.get_ip_reputation(ip)
        if "task_state" in ip_data:
            task_state = ip_data.get("task_state", "none")
            demisto.debug(f"search this ip {ip} on cybertotal with status: {task_state}")
            ip_message_list.append({"ip": ip})
            continue

        if "non_field_errors" in ip_data:
            non_field_errors.extend(ip_data["non_field_errors"])
            continue

        reputation = int(ip_data.get("positive_detections", 0))
        if reputation == 0:
            score = Common.DBotScore.NONE  # unknown
        elif reputation >= threshold:
            score = Common.DBotScore.BAD  # bad
        elif reputation >= threshold / 2:
            score = Common.DBotScore.SUSPICIOUS  # suspicious
        else:
            score = Common.DBotScore.GOOD  # good

        dbot_score = Common.DBotScore(
            indicator=ip,
            indicator_type=DBotScoreType.IP,
            integration_name="CyberTotal",
            score=score,
            malicious_description=f"CyberTotal returned reputation {reputation}",
            reliability=demisto.params().get("integrationReliability"),
        )

        ip_standard_context = Common.IP(
            ip=ip,
            detection_engines=ip_data.get("detection_engines", None),
            positive_engines=ip_data.get("positive_detections", None),
            dbot_score=dbot_score,
        )

        readable_output = tableToMarkdown(f"IP: {ip}", ip_data)

        command_results.append(
            CommandResults(
                readable_output=readable_output,
                outputs_prefix="CyberTotal.IP",
                outputs_key_field="task_id",
                outputs=ip_data,
                indicator=ip_standard_context,
            )
        )

    if len(ip_message_list) > 0:
        readable_output = tableToMarkdown("IP search in progress , please try again later", ip_message_list)
        command_results.append(
            CommandResults(
                readable_output=readable_output,
            )
        )

    if len(non_field_errors) > 0:
        readable_output = "### IP search Failures:\n"
        readable_output += "\n".join(non_field_errors)

        command_results.append(
            CommandResults(
                readable_output=readable_output,
            )
        )

    return command_results


def url_reputation_command(client: Client, args: dict[str, Any], default_threshold: int) -> list[CommandResults]:
    """url command: Returns URL reputation for a list of URLs

    :type client: ``Client``
    :param Client: CyberTotal client to use

    :type args: ``Dict[str, Any]``
    :param args:
        all command arguments, usually passed from ``demisto.args()``.
        ``args['url']`` is a list of URLs or a single URL
        ``args['threshold']`` threshold to determine whether an URL is malicious

    :type default_threshold: ``int``
    :param default_threshold:
        default threshold to determine whether an URL is malicious
        if threshold is not specified in the XSOAR arguments

    :return:
        A ``CommandResults`` object that is then passed to ``return_results``,
        that contains URLs

    :rtype: ``CommandResults``
    """

    urls = argToList(args.get("url"))
    if len(urls) == 0:
        raise ValueError("URL(s) not specified")

    threshold = int(args.get("threshold", default_threshold))

    url_message_list: list[dict[str, Any]] = []
    command_results: list[CommandResults] = []

    for url in urls:
        url_raw_response = client.get_url_reputation(url)
        if "task_state" in url_raw_response:
            task_state = url_raw_response.get("task_state", "none")
            demisto.debug(f"search this url {url} on cybertotal with status: {task_state}")
            url_message_list.append({"url": url})
            continue

        reputation = int(url_raw_response.get("positive_detections", 0))
        if reputation == 0:
            score = Common.DBotScore.NONE  # unknown
        elif reputation >= threshold:
            score = Common.DBotScore.BAD  # bad
        elif reputation >= threshold / 2:
            score = Common.DBotScore.SUSPICIOUS  # suspicious
        else:
            score = Common.DBotScore.GOOD  # good

        dbot_score = Common.DBotScore(
            indicator=url,
            indicator_type=DBotScoreType.URL,
            integration_name="CyberTotal",
            score=score,
            malicious_description=f"CyberTotal returned reputation {reputation}",
            reliability=demisto.params().get("integrationReliability"),
        )

        url_standard_context = Common.URL(
            url=url,
            detection_engines=url_raw_response.get("detection_engines"),
            positive_detections=url_raw_response.get("positive_detections"),
            dbot_score=dbot_score,
        )

        readable_output = tableToMarkdown(f"URL {url}", url_raw_response)

        command_results.append(
            CommandResults(
                readable_output=readable_output,
                outputs_prefix="CyberTotal.URL",
                outputs_key_field="task_id",
                outputs=url_raw_response,
                indicator=url_standard_context,
            )
        )

    if len(url_message_list) > 0:
        readable_output = tableToMarkdown("URL search in progress , please try again later", url_message_list)
        command_results.append(CommandResults(readable_output=readable_output))

    return command_results


def file_reputation_command(client: Client, args: dict[str, Any], default_threshold: int) -> list[CommandResults]:
    """file command: Returns File reputation for a list of Files

    :type client: ``Client``
    :param Client: CyberTotal client to use

    :type args: ``Dict[str, Any]``
    :param args:
        all command arguments, usually passed from ``demisto.args()``.
        ``args['file']`` is a list of Files or a single File
        ``args['threshold']`` threshold to determine whether an File is malicious

    :type default_threshold: ``int``
    :param default_threshold:
        default threshold to determine whether an File is malicious
        if threshold is not specified in the XSOAR arguments

    :return:
        A ``CommandResults`` object that is then passed to ``return_results``,
        that contains Files

    :rtype: ``CommandResults``
    """

    hashs = argToList(args.get("file"))
    if len(hashs) == 0:
        raise ValueError("HASH(s) not specified")

    threshold = int(args.get("threshold", default_threshold))

    hash_message_list: list[dict[str, Any]] = []
    command_results: list[CommandResults] = []

    for _hash in hashs:
        hash_reputation_response = client.get_file_reputation(_hash)
        if "task_state" in hash_reputation_response:
            task_state = hash_reputation_response.get("task_state", "none")
            demisto.debug(f"search this file {_hash} on cybertotal with status: {task_state}")
            hash_message_list.append({"file": _hash})
            continue

        reputation = int(hash_reputation_response.get("positive_detections", 0))
        if reputation == 0:
            score = Common.DBotScore.NONE  # unknown
        elif reputation >= threshold:
            score = Common.DBotScore.BAD  # bad
        elif reputation >= threshold / 2:
            score = Common.DBotScore.SUSPICIOUS  # suspicious
        else:
            score = Common.DBotScore.GOOD  # good

        dbot_score = Common.DBotScore(
            indicator=_hash,
            indicator_type=DBotScoreType.FILE,
            integration_name="CyberTotal",
            score=score,
            malicious_description=f"CyberTotal returned reputation {reputation}",
            reliability=demisto.params().get("integrationReliability"),
        )

        hash_standard_context = Common.File(
            md5=hash_reputation_response.get("md5", None),
            sha1=hash_reputation_response.get("sha1", None),
            sha256=hash_reputation_response.get("sha256", None),
            size=hash_reputation_response.get("size", None),
            extension=hash_reputation_response.get("extension", None),
            name=hash_reputation_response.get("name", None),
            dbot_score=dbot_score,
        )

        readable_output = tableToMarkdown(f"File {_hash}", hash_reputation_response)

        command_results.append(
            CommandResults(
                readable_output=readable_output,
                outputs_prefix="CyberTotal.File",
                outputs_key_field="task_id",
                outputs=hash_reputation_response,
                indicator=hash_standard_context,
            )
        )

    if len(hash_message_list) > 0:
        readable_output = tableToMarkdown("File search in progress , please try again later", hash_message_list)
        command_results.append(CommandResults(readable_output=readable_output))

    return command_results


def domain_reputation_command(client: Client, args: dict[str, Any], default_threshold: int) -> list[CommandResults]:
    """domain command: Returns Domain reputation for a list of Domains

    :type client: ``Client``
    :param Client: CyberTotal client to use

    :type args: ``Dict[str, Any]``
    :param args:
        all command arguments, usually passed from ``demisto.args()``.
        ``args['domain']`` is a list of Domains or a single Domain
        ``args['threshold']`` threshold to determine whether an Domain is malicious

    :type default_threshold: ``int``
    :param default_threshold:
        default threshold to determine whether an Domain is malicious
        if threshold is not specified in the XSOAR arguments

    :return:
        A ``CommandResults`` object that is then passed to ``return_results``,
        that contains Domains

    :rtype: ``CommandResults``
    """

    domains = argToList(args.get("domain"))
    if len(domains) == 0:
        raise ValueError("domain(s) not specified")

    threshold = int(args.get("threshold", default_threshold))

    # Context standard for Domain class
    domain_message_list: list[dict[str, Any]] = []
    command_results: list[CommandResults] = []

    for domain in domains:
        domain_data = client.get_domain_reputation(domain)
        if "task_state" in domain_data:
            task_state = domain_data.get("task_state", "none")
            demisto.debug(f"search this domain {domain} on cybertotal with status: {task_state}")
            domain_message_list.append({"domain": domain})
            continue
        reputation = int(domain_data.get("positive_detections", 0))
        if reputation == 0:
            score = Common.DBotScore.NONE  # unknown
        elif reputation >= threshold:
            score = Common.DBotScore.BAD  # bad
        elif reputation >= threshold / 2:
            score = Common.DBotScore.SUSPICIOUS  # suspicious
        else:
            score = Common.DBotScore.GOOD  # good

        dbot_score = Common.DBotScore(
            indicator=domain,
            integration_name="CyberTotal",
            indicator_type=DBotScoreType.DOMAIN,
            score=score,
            malicious_description=f"CyberTotal returned reputation {reputation}",
            reliability=demisto.params().get("integrationReliability"),
        )

        domain_standard_context = Common.Domain(
            domain=domain,
            positive_detections=domain_data.get("positive_detections", None),
            detection_engines=domain_data.get("detection_engines", None),
            dbot_score=dbot_score,
        )

        readable_output = tableToMarkdown(f"Domain {domain}", domain_data)

        command_results.append(
            CommandResults(
                readable_output=readable_output,
                outputs_prefix="CyberTotal.Domain",
                outputs_key_field="task_id",
                outputs=domain_data,
                indicator=domain_standard_context,
            )
        )

    if len(domain_message_list) > 0:
        readable_output = tableToMarkdown("Domain search in progress , please try again later", domain_message_list)
        command_results.append(CommandResults(readable_output=readable_output))

    return command_results


def ip_whois_command(client: Client, args: dict[str, Any]) -> CommandResults:
    """cybertotal-ip-whois command: Returns IP whois information for a list of IPs

    :type client: ``Client``
    :param Client: CyberTotal client to use

    :type args: ``Dict[str, Any]``
    :param args:
        all command arguments, usually passed from ``demisto.args()``.
        ``args['ip']`` is a list of IPs or a single IP

    :return:
        A ``CommandResults`` object that is then passed to ``return_results``,
        that contains IPs

    :rtype: ``CommandResults``
    """

    ips = argToList(args.get("ip"))
    if len(ips) == 0:
        raise ValueError("IP(s) not specified")

    ip_data_list: list[dict[str, Any]] = []

    for ip in ips:
        ip_data = client.get_ip_whois(ip)
        ip_data_list.append(ip_data)

    return CommandResults(outputs_prefix="CyberTotal.WHOIS-IP", outputs_key_field="task_id", outputs=ip_data_list)


def url_whois_command(client: Client, args: dict[str, Any]) -> CommandResults:
    """cybertotal-url-whois command: Returns URL whois information for a list of URLs

    :type client: ``Client``
    :param Client: CyberTotal client to use

    :type args: ``Dict[str, Any]``
    :param args:
        all command arguments, usually passed from ``demisto.args()``.
        ``args['url']`` is a list of URLs or a single URL

    :return:
        A ``CommandResults`` object that is then passed to ``return_results``,
        that contains URLs

    :rtype: ``CommandResults``
    """

    urls = argToList(args.get("url"))
    if len(urls) == 0:
        raise ValueError("URL(s) not specified")

    url_data_list: list[dict[str, Any]] = []

    for url in urls:
        url_data = client.get_url_whois(url)
        url_data_list.append(url_data)

    return CommandResults(outputs_prefix="CyberTotal.WHOIS-URL", outputs_key_field="task_id", outputs=url_data_list)


def domain_whois_command(client: Client, args: dict[str, Any]) -> CommandResults:
    """cybertotal-domain-whois command: Returns Domain whois information for a list of Domains

    :type client: ``Client``
    :param Client: CyberTotal client to use

    :type args: ``Dict[str, Any]``
    :param args:
        all command arguments, usually passed from ``demisto.args()``.
        ``args['domain']`` is a list of Domains or a single Domain

    :return:
        A ``CommandResults`` object that is then passed to ``return_results``,
        that contains Domains

    :rtype: ``CommandResults``
    """

    domains = argToList(args.get("domain"))
    if len(domains) == 0:
        raise ValueError("Domain(s) not specified")

    domain_data_list: list[dict[str, Any]] = []

    for domain in domains:
        domain_data = client.get_domain_whois(domain)
        domain_data_list.append(domain_data)

    return CommandResults(outputs_prefix="CyberTotal.WHOIS-Domain", outputs_key_field="task_id", outputs=domain_data_list)


def test_module(client: Client) -> str:  # pragma: nocover
    """Tests API connectivity and authentication'
    Returning 'ok' indicates that the integration works like it is supposed to.
    Connection to the service is successful.
    Raises exceptions if something goes wrong.
    :type client: ``Client``
    :param Client: CyberTotal client to use
    :return: 'ok' if test passed, anything else will fail the test.
    :rtype: ``str``
    """

    # INTEGRATION DEVELOPER TIP
    # Client class should raise the exceptions, but if the test fails
    # the exception text is printed to the Cortex XSOAR UI.
    # If you have some specific errors you want to capture (i.e. auth failure)
    # you should catch the exception here and return a string with a more
    # readable output (for example return 'Authentication Error, API Key
    # invalid').
    # Cortex XSOAR will print everything you return different than 'ok' as
    # an error
    try:
        client.get_domain_reputation("abc.com")
    except DemistoException as e:
        if "Forbidden" in str(e):
            return "Authorization Error: make sure API Key is correctly set"
        else:
            raise e
    return "ok"


def main() -> None:  # pragma: nocover
    verify_certificate = not demisto.params().get("insecure", False)
    cybertotal_url = demisto.params().get("url")
    cybertotal_token = demisto.params().get("token")

    proxy = demisto.params().get("proxy", False)

    demisto.debug(f"Command being called is {demisto.command()}")
    try:
        headers = {"Authorization": f"Token {cybertotal_token}"}
        client = Client(base_url=cybertotal_url, verify=verify_certificate, headers=headers, proxy=proxy)

        if demisto.command() == "test-module":
            # This is the call made when pressing the integration Test button.
            result = test_module(client)
            return_results(result)

        elif demisto.command() == "ip":
            default_threshold = int(demisto.params().get("threshold_ip", "10"))
            return_results(ip_reputation_command(client, demisto.args(), default_threshold))

        elif demisto.command() == "url":
            default_threshold = int(demisto.params().get("threshold_url", "10"))
            return_results(url_reputation_command(client, demisto.args(), default_threshold))

        elif demisto.command() == "domain":
            default_threshold = int(demisto.params().get("threshold_domain", "10"))
            return_results(domain_reputation_command(client, demisto.args(), default_threshold))

        elif demisto.command() == "file":
            default_threshold = int(demisto.params().get("threshold_hash", "10"))
            return_results(file_reputation_command(client, demisto.args(), default_threshold))

        elif demisto.command() == "cybertotal-ip-whois":
            return_results(ip_whois_command(client, demisto.args()))

        elif demisto.command() == "cybertotal-url-whois":
            return_results(url_whois_command(client, demisto.args()))

        elif demisto.command() == "cybertotal-domain-whois":
            return_results(domain_whois_command(client, demisto.args()))

    except Exception as e:
        demisto.error(traceback.format_exc())  # print the traceback
        return_error(f"Failed to execute {demisto.command()} command.\nError:\n{e!s}")


""" ENTRY POINT """


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