txt2stix 1.1.10__py3-none-any.whl → 1.1.12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- txt2stix/ai_extractor/anthropic.py +2 -2
- txt2stix/ai_extractor/gemini.py +3 -3
- txt2stix/attack_flow.py +1 -1
- txt2stix/bundler.py +1 -1
- txt2stix/txt2stix.py +1 -0
- {txt2stix-1.1.10.dist-info → txt2stix-1.1.12.dist-info}/METADATA +13 -8
- {txt2stix-1.1.10.dist-info → txt2stix-1.1.12.dist-info}/RECORD +10 -10
- {txt2stix-1.1.10.dist-info → txt2stix-1.1.12.dist-info}/WHEEL +0 -0
- {txt2stix-1.1.10.dist-info → txt2stix-1.1.12.dist-info}/entry_points.txt +0 -0
- {txt2stix-1.1.10.dist-info → txt2stix-1.1.12.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,7 +6,7 @@ from llama_index.llms.anthropic import Anthropic
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class AnthropicAIExtractor(BaseAIExtractor, provider="anthropic"):
|
|
9
|
-
def __init__(self, **kwargs) -> None:
|
|
9
|
+
def __init__(self, model='claude-sonnet-4-0', **kwargs) -> None:
|
|
10
10
|
kwargs.setdefault('temperature', float(os.environ.get('TEMPERATURE', 0.0)))
|
|
11
|
-
self.llm = Anthropic(max_tokens=4096, system_prompt=self.system_prompt, **kwargs)
|
|
11
|
+
self.llm = Anthropic(max_tokens=4096, model=model, system_prompt=self.system_prompt, **kwargs)
|
|
12
12
|
super().__init__()
|
txt2stix/ai_extractor/gemini.py
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
2
|
import os
|
|
3
3
|
from txt2stix.ai_extractor.base import BaseAIExtractor
|
|
4
|
-
from llama_index.llms.
|
|
4
|
+
from llama_index.llms.google_genai import GoogleGenAI
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class GeminiAIExtractor(BaseAIExtractor, provider="gemini"):
|
|
8
8
|
def __init__(self, **kwargs) -> None:
|
|
9
9
|
kwargs.setdefault('temperature', float(os.environ.get('TEMPERATURE', 0.0)))
|
|
10
|
-
self.llm =
|
|
10
|
+
self.llm = GoogleGenAI(max_tokens=4096, **kwargs)
|
|
11
11
|
super().__init__()
|
|
12
12
|
|
|
13
13
|
def count_tokens(self, text):
|
|
14
|
-
return self.llm.
|
|
14
|
+
return self.llm._client.models.count_tokens(model=self.llm.model, contents=text).total_tokens
|
|
15
15
|
|
|
16
16
|
@property
|
|
17
17
|
def extractor_name(self):
|
txt2stix/attack_flow.py
CHANGED
|
@@ -7,7 +7,7 @@ from txt2stix import txt2stixBundler
|
|
|
7
7
|
from txt2stix.ai_extractor.base import BaseAIExtractor
|
|
8
8
|
from txt2stix.common import UUID_NAMESPACE
|
|
9
9
|
from txt2stix.retriever import STIXObjectRetriever
|
|
10
|
-
from stix2extensions
|
|
10
|
+
from stix2extensions import AttackAction, AttackFlow
|
|
11
11
|
from .utils import AttackFlowList
|
|
12
12
|
|
|
13
13
|
def parse_flow(report, flow: AttackFlowList, techniques, tactics):
|
txt2stix/bundler.py
CHANGED
|
@@ -133,7 +133,7 @@ class txt2stixBundler:
|
|
|
133
133
|
"phone-number": None,
|
|
134
134
|
"weakness": None,
|
|
135
135
|
}
|
|
136
|
-
EXTENSION_DEFINITION_BASE_URL = "https://raw.githubusercontent.com/muchdogesec/stix2extensions/main/extension-definitions"
|
|
136
|
+
EXTENSION_DEFINITION_BASE_URL = "https://raw.githubusercontent.com/muchdogesec/stix2extensions/main/automodel_generated/extension-definitions"
|
|
137
137
|
ATTACK_FLOW_SMO_URL = "https://github.com/muchdogesec/stix2extensions/raw/refs/heads/main/remote-definitions/attack-flow.json"
|
|
138
138
|
report = None
|
|
139
139
|
identity = None
|
txt2stix/txt2stix.py
CHANGED
|
@@ -361,6 +361,7 @@ def validate_token_count(max_tokens, input, extractors: list[BaseAIExtractor]):
|
|
|
361
361
|
logging.info('INPUT_TOKEN_LIMIT = %d', max_tokens)
|
|
362
362
|
for extractor in extractors:
|
|
363
363
|
token_count = _count_token(extractor, input)
|
|
364
|
+
logging.info(f"{extractor.extractor_name}: input_file token count = {token_count}")
|
|
364
365
|
if token_count > max_tokens:
|
|
365
366
|
raise FatalException(f"{extractor.extractor_name}: input_file token count ({token_count}) exceeds INPUT_TOKEN_LIMIT ({max_tokens})")
|
|
366
367
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: txt2stix
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.12
|
|
4
4
|
Summary: txt2stix is a Python script that is designed to identify and extract IoCs and TTPs from text files, identify the relationships between them, convert them to STIX 2.1 objects, and output as a STIX 2.1 bundle.
|
|
5
5
|
Project-URL: Homepage, https://github.com/muchdogesec/txt2stix
|
|
6
6
|
Project-URL: Issues, https://github.com/muchdogesec/txt2stix/issues
|
|
@@ -15,8 +15,8 @@ Requires-Python: >=3.9
|
|
|
15
15
|
Requires-Dist: base58>=2.1.1
|
|
16
16
|
Requires-Dist: beautifulsoup4>=4.12.3
|
|
17
17
|
Requires-Dist: json-repair
|
|
18
|
-
Requires-Dist: llama-index-core>=0.
|
|
19
|
-
Requires-Dist: llama-index-llms-openai>=0.
|
|
18
|
+
Requires-Dist: llama-index-core>=0.14.8
|
|
19
|
+
Requires-Dist: llama-index-llms-openai>=0.6.8
|
|
20
20
|
Requires-Dist: mistune>=3.0.2
|
|
21
21
|
Requires-Dist: pathvalidate>=3.2.0
|
|
22
22
|
Requires-Dist: phonenumbers>=8.13.39
|
|
@@ -24,18 +24,23 @@ Requires-Dist: python-dotenv>=1.0.1
|
|
|
24
24
|
Requires-Dist: requests>=2.32.4
|
|
25
25
|
Requires-Dist: schwifty>=2024.6.1
|
|
26
26
|
Requires-Dist: stix2-validator
|
|
27
|
-
Requires-Dist: stix2extensions
|
|
27
|
+
Requires-Dist: stix2extensions>=2.0.1
|
|
28
28
|
Requires-Dist: tld>=0.13
|
|
29
29
|
Requires-Dist: tldextract>=5.1.2
|
|
30
30
|
Requires-Dist: validators>=0.28.3
|
|
31
31
|
Provides-Extra: anthropic
|
|
32
|
-
Requires-Dist: llama-index-llms-anthropic>=0.7
|
|
32
|
+
Requires-Dist: llama-index-llms-anthropic>=0.9.7; extra == 'anthropic'
|
|
33
33
|
Provides-Extra: deepseek
|
|
34
|
-
Requires-Dist: llama-index-llms-deepseek>=0.
|
|
34
|
+
Requires-Dist: llama-index-llms-deepseek>=0.2.2; extra == 'deepseek'
|
|
35
35
|
Provides-Extra: gemini
|
|
36
|
-
Requires-Dist: llama-index-llms-
|
|
36
|
+
Requires-Dist: llama-index-llms-google-genai>=0.5.0; extra == 'gemini'
|
|
37
|
+
Provides-Extra: llms
|
|
38
|
+
Requires-Dist: llama-index-llms-anthropic>=0.9.7; extra == 'llms'
|
|
39
|
+
Requires-Dist: llama-index-llms-deepseek>=0.2.2; extra == 'llms'
|
|
40
|
+
Requires-Dist: llama-index-llms-google-genai>=0.5.0; extra == 'llms'
|
|
41
|
+
Requires-Dist: llama-index-llms-openrouter>=0.4.2; extra == 'llms'
|
|
37
42
|
Provides-Extra: openrouter
|
|
38
|
-
Requires-Dist: llama-index-llms-openrouter>=0.
|
|
43
|
+
Requires-Dist: llama-index-llms-openrouter>=0.4.2; extra == 'openrouter'
|
|
39
44
|
Provides-Extra: tests
|
|
40
45
|
Requires-Dist: pytest; extra == 'tests'
|
|
41
46
|
Requires-Dist: pytest-cov; extra == 'tests'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
txt2stix/__init__.py,sha256=Sm_VT913IFuAZ6dJEdVz3baPwC5VYtHySVfBAOUG92w,803
|
|
2
|
-
txt2stix/attack_flow.py,sha256=
|
|
3
|
-
txt2stix/bundler.py,sha256=
|
|
2
|
+
txt2stix/attack_flow.py,sha256=qlzI7TdYwPOXegx0hTdvVuZ_He2yQVg9eFPOpEt3huE,9038
|
|
3
|
+
txt2stix/bundler.py,sha256=5E6IptaAyHXdMA7JUw8yG5J2hLZ9kqQuDsWCQAC3xlY,16937
|
|
4
4
|
txt2stix/common.py,sha256=ISnGNKqJPE1EcfhL-x_4G18mcwt1urmorkW-ru9kV-0,585
|
|
5
5
|
txt2stix/credential_checker.py,sha256=eWDP-jY3-jm8zI0JMoUcyoQZ_JqPNfCIr_HAO8nVYz0,3044
|
|
6
6
|
txt2stix/extractions.py,sha256=_tlsqYHhfAoV-PJzxRHysrX47uxCsMlSg7PQWxww1u0,2171
|
|
@@ -8,13 +8,13 @@ txt2stix/indicator.py,sha256=dyf4wbvVrZRitZpm6t7UusSM98bVW1qc5UkdGpVm3ls,30025
|
|
|
8
8
|
txt2stix/lookups.py,sha256=h42YVtYUkWZm6ZPv2h5hHDHDzDs3yBqrT_T7pj2MDZI,2301
|
|
9
9
|
txt2stix/retriever.py,sha256=sMNhnEYk3l5W44qZsWaDQtJYoHXA1oYIPM6wDqiUHSg,6642
|
|
10
10
|
txt2stix/stix.py,sha256=9nXD9a2dCY4uaatl-mlIA1k3srwQBhGW-tUSho3iYe0,30
|
|
11
|
-
txt2stix/txt2stix.py,sha256=
|
|
11
|
+
txt2stix/txt2stix.py,sha256=CaK2YmkMjBvC8FXZmvkThZfb9_K94sV31Uvns3gPx20,18862
|
|
12
12
|
txt2stix/utils.py,sha256=n6mh4t9ZRJ7iT4Jvp9ai_dfCXjgXNcRtF_zXO7nkpnk,3304
|
|
13
13
|
txt2stix/ai_extractor/__init__.py,sha256=5Tf6Co9THzytBdFEVhD-7vvT05TT3nSpltnAV1sfdoM,349
|
|
14
|
-
txt2stix/ai_extractor/anthropic.py,sha256=
|
|
14
|
+
txt2stix/ai_extractor/anthropic.py,sha256=B5Z3nm2-w5KBhLcVJGkhNF0dn4lUo-fW_DnbOeJKA5Q,481
|
|
15
15
|
txt2stix/ai_extractor/base.py,sha256=t0SCh24FeDEDzXsrGFada6ux9F6m0ILwXtPSaleDiv8,4172
|
|
16
16
|
txt2stix/ai_extractor/deepseek.py,sha256=2XehIYbWXG6Odq68nQX4CNtl5GdmBlAmjLP_lG2eEFo,660
|
|
17
|
-
txt2stix/ai_extractor/gemini.py,sha256=
|
|
17
|
+
txt2stix/ai_extractor/gemini.py,sha256=rhhYrCa1zZTjadVk2QFhguD8_Yr03gl-D4Yb2nVBMI4,633
|
|
18
18
|
txt2stix/ai_extractor/openai.py,sha256=1RxaLy0TJ4GjNKmcJoi6ZiBrCS_gt5ql9jpeE-SOy8g,642
|
|
19
19
|
txt2stix/ai_extractor/openrouter.py,sha256=hAA6mTOMcpA28XYsOCvuJH7WMJqXCxfqZGJf_VrDsIk,628
|
|
20
20
|
txt2stix/ai_extractor/prompts.py,sha256=NtqtVyPPtShPlVZ5SrFmo-LCkfpANIIi4H9rjqaxqDo,10559
|
|
@@ -114,8 +114,8 @@ txt2stix/includes/lookups/threat_actor.txt,sha256=QfDO9maQuqKBgW_Sdd7VGv1SHZ9Ra-
|
|
|
114
114
|
txt2stix/includes/lookups/tld.txt,sha256=-MEgJea2NMG_KDsnc4BVvI8eRk5Dm93L-t8SGYx5wMo,8598
|
|
115
115
|
txt2stix/includes/lookups/tool.txt,sha256=HGKG6JpUE26w6ezzSxOjBkp15UpSaB7N-mZ_NU_3G7A,6
|
|
116
116
|
txt2stix/includes/tests/test_cases.yaml,sha256=vErA3c5fySeWvJ5yJ8dCTEo3ufRATASAjaF4gj4Az1M,22424
|
|
117
|
-
txt2stix-1.1.
|
|
118
|
-
txt2stix-1.1.
|
|
119
|
-
txt2stix-1.1.
|
|
120
|
-
txt2stix-1.1.
|
|
121
|
-
txt2stix-1.1.
|
|
117
|
+
txt2stix-1.1.12.dist-info/METADATA,sha256=H_-Z_rIZrd0_yLobzdL9Ftthm400x05vLmSThIRDcVQ,15032
|
|
118
|
+
txt2stix-1.1.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
119
|
+
txt2stix-1.1.12.dist-info/entry_points.txt,sha256=x6QPtt65hWeomw4IpJ_wQUesBl1M4WOLODbhOKyWMFg,55
|
|
120
|
+
txt2stix-1.1.12.dist-info/licenses/LICENSE,sha256=BK8Ppqlc4pdgnNzIxnxde0taoQ1BgicdyqmBvMiNYgY,11364
|
|
121
|
+
txt2stix-1.1.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|