Skip to content

Commit ea3262c

Browse files
committed
gis-9379 add new endpoint /iocs/generate
1 parent 0236ff1 commit ea3262c

File tree

1 file changed

+7
-7
lines changed
  • uncoder-core/app/translator/tools

1 file changed

+7
-7
lines changed

uncoder-core/app/translator/tools/const.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import typing
1+
from typing import get_args, Literal
22

33
IP_IOC_REGEXP_PATTERN = r"(?:^|[ \/\[(\"',;>|])((?:25[0-5]|2[0-4]\d|[0-1]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d{1,2})){3})(?=[\s)\]\"',;:\/?\n<|]|$)" # noqa: E501
44
DOMAIN_IOC_REGEXP_PATTERN = r"(?:^|[\s\/\[\]@(\"',;{>|])(?:(?:http[s]?|ftp):\/\/?)?([^:\\\/\s({\[\]@\"'`,]+\.[a-zA-Z]+)(?:(?:(?:[/|:]\w+)*\/)(?:[\w\-.]+[^#?\s]+)?(?:[\w/\-&?=%.#]+(?:\(\))?)?)?(?=[\s)\]\"',;<|]|$)" # noqa: E501
55
URL_IOC_REGEXP_PATTERN = r"(?:^|[\s\/\[\]@(\"',;{>|])((?:(?:http[s]?|ftp):\/\/?)+(?:[^:\\\/\s({\[\]@\"'`,]+\.[a-zA-Z0-9]+)(?:(?:(?:[/|:]\w+)*\/)(?:[\w\-.]+[^#?\s<']+)?(?:[\w/\-&?=%.#]+(?:\(\))?)?)?)(?=[\s)\]\"',;<|]|$)" # noqa: E501
66

7-
IOCType = typing.Literal["ip", "domain", "url", "hash"]
8-
HashType = typing.Literal["md5", "sha1", "sha256", "sha512"]
9-
IocParsingRule = typing.Literal["replace_dots", "remove_private_and_reserved_ips", "replace_hxxp"]
7+
IOCType = Literal["ip", "domain", "url", "hash"]
8+
HashType = Literal["md5", "sha1", "sha256", "sha512"]
9+
IocParsingRule = Literal["replace_dots", "remove_private_and_reserved_ips", "replace_hxxp"]
1010

11-
DefaultIOCType = list(typing.get_args(IOCType))
12-
DefaultHashType = list(typing.get_args(HashType))
13-
DefaultIocParsingRule = list(typing.get_args(IocParsingRule))
11+
DefaultIOCType = list(get_args(IOCType))
12+
DefaultHashType = list(get_args(HashType))
13+
DefaultIocParsingRule = list(get_args(IocParsingRule))
1414

1515
HASH_MAP = {"md5": "HashMd5", "sha1": "HashSha1", "sha256": "HashSha256", "sha512": "HashSha512"}
1616

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy