txt2stix 0.0.4__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.
Files changed (119) hide show
  1. txt2stix/__init__.py +33 -0
  2. txt2stix/ai_extractor/__init__.py +15 -0
  3. txt2stix/ai_extractor/anthropic.py +12 -0
  4. txt2stix/ai_extractor/base.py +87 -0
  5. txt2stix/ai_extractor/deepseek.py +19 -0
  6. txt2stix/ai_extractor/gemini.py +18 -0
  7. txt2stix/ai_extractor/openai.py +15 -0
  8. txt2stix/ai_extractor/openrouter.py +20 -0
  9. txt2stix/ai_extractor/prompts.py +164 -0
  10. txt2stix/ai_extractor/utils.py +85 -0
  11. txt2stix/attack_flow.py +101 -0
  12. txt2stix/bundler.py +428 -0
  13. txt2stix/common.py +23 -0
  14. txt2stix/extractions.py +59 -0
  15. txt2stix/includes/__init__.py +0 -0
  16. txt2stix/includes/extractions/ai/config.yaml +1023 -0
  17. txt2stix/includes/extractions/lookup/config.yaml +393 -0
  18. txt2stix/includes/extractions/pattern/config.yaml +609 -0
  19. txt2stix/includes/helpers/mimetype_filename_extension_list.csv +936 -0
  20. txt2stix/includes/helpers/stix_relationship_types.txt +41 -0
  21. txt2stix/includes/helpers/tlds.txt +1446 -0
  22. txt2stix/includes/helpers/windows_registry_key_prefix.txt +12 -0
  23. txt2stix/includes/lookups/_README.md +11 -0
  24. txt2stix/includes/lookups/_generate_lookups.py +247 -0
  25. txt2stix/includes/lookups/attack_pattern.txt +1 -0
  26. txt2stix/includes/lookups/campaign.txt +1 -0
  27. txt2stix/includes/lookups/country_iso3166_alpha2.txt +249 -0
  28. txt2stix/includes/lookups/course_of_action.txt +1 -0
  29. txt2stix/includes/lookups/disarm_id_v1_5.txt +345 -0
  30. txt2stix/includes/lookups/disarm_name_v1_5.txt +347 -0
  31. txt2stix/includes/lookups/extensions.txt +78 -0
  32. txt2stix/includes/lookups/identity.txt +1 -0
  33. txt2stix/includes/lookups/infrastructure.txt +1 -0
  34. txt2stix/includes/lookups/intrusion_set.txt +1 -0
  35. txt2stix/includes/lookups/malware.txt +2 -0
  36. txt2stix/includes/lookups/mitre_atlas_id_v4_5_2.txt +116 -0
  37. txt2stix/includes/lookups/mitre_atlas_name_v4_5_2.txt +117 -0
  38. txt2stix/includes/lookups/mitre_attack_enterprise_aliases_v16_0.txt +1502 -0
  39. txt2stix/includes/lookups/mitre_attack_enterprise_id_v16_0.txt +1656 -0
  40. txt2stix/includes/lookups/mitre_attack_enterprise_name_v16_0.txt +1765 -0
  41. txt2stix/includes/lookups/mitre_attack_ics_aliases_v16_0.txt +141 -0
  42. txt2stix/includes/lookups/mitre_attack_ics_id_v16_0.txt +254 -0
  43. txt2stix/includes/lookups/mitre_attack_ics_name_v16_0.txt +293 -0
  44. txt2stix/includes/lookups/mitre_attack_mobile_aliases_v16_0.txt +159 -0
  45. txt2stix/includes/lookups/mitre_attack_mobile_id_v16_0.txt +277 -0
  46. txt2stix/includes/lookups/mitre_attack_mobile_name_v16_0.txt +296 -0
  47. txt2stix/includes/lookups/mitre_capec_id_v3_9.txt +559 -0
  48. txt2stix/includes/lookups/mitre_capec_name_v3_9.txt +560 -0
  49. txt2stix/includes/lookups/mitre_cwe_id_v4_15.txt +939 -0
  50. txt2stix/includes/lookups/mitre_cwe_name_v4_15.txt +939 -0
  51. txt2stix/includes/lookups/threat_actor.txt +1 -0
  52. txt2stix/includes/lookups/tld.txt +1422 -0
  53. txt2stix/includes/lookups/tool.txt +1 -0
  54. txt2stix/includes/tests/test_cases.yaml +695 -0
  55. txt2stix/indicator.py +860 -0
  56. txt2stix/lookups.py +68 -0
  57. txt2stix/pattern/__init__.py +13 -0
  58. txt2stix/pattern/extractors/__init__.py +0 -0
  59. txt2stix/pattern/extractors/base_extractor.py +167 -0
  60. txt2stix/pattern/extractors/card/README.md +34 -0
  61. txt2stix/pattern/extractors/card/__init__.py +15 -0
  62. txt2stix/pattern/extractors/card/amex_card_extractor.py +52 -0
  63. txt2stix/pattern/extractors/card/diners_card_extractor.py +47 -0
  64. txt2stix/pattern/extractors/card/discover_card_extractor.py +48 -0
  65. txt2stix/pattern/extractors/card/jcb_card_extractor.py +43 -0
  66. txt2stix/pattern/extractors/card/master_card_extractor.py +63 -0
  67. txt2stix/pattern/extractors/card/union_card_extractor.py +38 -0
  68. txt2stix/pattern/extractors/card/visa_card_extractor.py +46 -0
  69. txt2stix/pattern/extractors/crypto/__init__.py +3 -0
  70. txt2stix/pattern/extractors/crypto/btc_extractor.py +38 -0
  71. txt2stix/pattern/extractors/directory/__init__.py +10 -0
  72. txt2stix/pattern/extractors/directory/unix_directory_extractor.py +40 -0
  73. txt2stix/pattern/extractors/directory/unix_file_path_extractor.py +42 -0
  74. txt2stix/pattern/extractors/directory/windows_directory_path_extractor.py +47 -0
  75. txt2stix/pattern/extractors/directory/windows_file_path_extractor.py +42 -0
  76. txt2stix/pattern/extractors/domain/__init__.py +8 -0
  77. txt2stix/pattern/extractors/domain/domain_extractor.py +39 -0
  78. txt2stix/pattern/extractors/domain/hostname_extractor.py +36 -0
  79. txt2stix/pattern/extractors/domain/sub_domain_extractor.py +49 -0
  80. txt2stix/pattern/extractors/hashes/__init__.py +16 -0
  81. txt2stix/pattern/extractors/hashes/md5_extractor.py +16 -0
  82. txt2stix/pattern/extractors/hashes/sha1_extractor.py +14 -0
  83. txt2stix/pattern/extractors/hashes/sha224_extractor.py +18 -0
  84. txt2stix/pattern/extractors/hashes/sha2_256_exactor.py +14 -0
  85. txt2stix/pattern/extractors/hashes/sha2_512_exactor.py +13 -0
  86. txt2stix/pattern/extractors/hashes/sha3_256_exactor.py +15 -0
  87. txt2stix/pattern/extractors/hashes/sha3_512_exactor.py +16 -0
  88. txt2stix/pattern/extractors/helper.py +64 -0
  89. txt2stix/pattern/extractors/ip/__init__.py +14 -0
  90. txt2stix/pattern/extractors/ip/ipv4_cidr_extractor.py +49 -0
  91. txt2stix/pattern/extractors/ip/ipv4_extractor.py +18 -0
  92. txt2stix/pattern/extractors/ip/ipv4_port_extractor.py +42 -0
  93. txt2stix/pattern/extractors/ip/ipv6_cidr_extractor.py +18 -0
  94. txt2stix/pattern/extractors/ip/ipv6_extractor.py +16 -0
  95. txt2stix/pattern/extractors/ip/ipv6_port_extractor.py +46 -0
  96. txt2stix/pattern/extractors/others/__init__.py +22 -0
  97. txt2stix/pattern/extractors/others/asn_extractor.py +14 -0
  98. txt2stix/pattern/extractors/others/cpe_extractor.py +29 -0
  99. txt2stix/pattern/extractors/others/cve_extractor.py +14 -0
  100. txt2stix/pattern/extractors/others/email_extractor.py +21 -0
  101. txt2stix/pattern/extractors/others/filename_extractor.py +17 -0
  102. txt2stix/pattern/extractors/others/iban_extractor.py +15 -0
  103. txt2stix/pattern/extractors/others/mac_address_extractor.py +13 -0
  104. txt2stix/pattern/extractors/others/phonenumber_extractor.py +41 -0
  105. txt2stix/pattern/extractors/others/user_agent_extractor.py +20 -0
  106. txt2stix/pattern/extractors/others/windows_registry_key_extractor.py +18 -0
  107. txt2stix/pattern/extractors/url/__init__.py +7 -0
  108. txt2stix/pattern/extractors/url/url_extractor.py +22 -0
  109. txt2stix/pattern/extractors/url/url_file_extractor.py +21 -0
  110. txt2stix/pattern/extractors/url/url_path_extractor.py +74 -0
  111. txt2stix/retriever.py +126 -0
  112. txt2stix/stix.py +1 -0
  113. txt2stix/txt2stix.py +336 -0
  114. txt2stix/utils.py +86 -0
  115. txt2stix-0.0.4.dist-info/METADATA +190 -0
  116. txt2stix-0.0.4.dist-info/RECORD +119 -0
  117. txt2stix-0.0.4.dist-info/WHEEL +4 -0
  118. txt2stix-0.0.4.dist-info/entry_points.txt +2 -0
  119. txt2stix-0.0.4.dist-info/licenses/LICENSE +202 -0
@@ -0,0 +1 @@
1
+ keygen
@@ -0,0 +1,695 @@
1
+ # ======= GENERIC EXTRACTIONS =======
2
+
3
+ ####### IPv4 extractions #######
4
+
5
+ generic_ipv4_address_only:
6
+ test_positive_examples:
7
+ - '1.1.1.1'
8
+ test_negative_examples:
9
+ - '1.1.1.2:80' # is port
10
+ - '1.1.1.3/8' # is cidr
11
+ - '900.1.4.1' # bad format
12
+
13
+ generic_ipv4_address_cidr:
14
+ test_positive_examples:
15
+ - '1.1.1.1/24'
16
+ test_negative_examples:
17
+ - '1.1.1.2'
18
+ - '1.1.1.3:80'
19
+ - '1.1.1.4/400000'
20
+
21
+ generic_ipv4_address_port:
22
+ test_positive_examples:
23
+ - '1.1.1.1:80'
24
+ test_negative_examples:
25
+ - '1.1.1.2'
26
+ - '1.1.1.3/24'
27
+ - '1.1.1.4:400000'
28
+
29
+ ####### IPv6 extractions #######
30
+
31
+ generic_ipv6_address_only:
32
+ test_positive_examples:
33
+ - '2001:0db8:85a3:0000:0000:8a2e:0370:7334'
34
+ - '2001:db8:3333:4444:5555:6666:7777:8888'
35
+ - '2001:db8:3333:4444:CCCC:DDDD:EEEE:FFFF'
36
+ test_negative_examples:
37
+ - '2001:db8::'
38
+ - '2001:db8k::1234:5678'
39
+ - '2001:0db8:85a3:0000:0000:8a2e:0370:7335/32'
40
+ - '[2001:0db8:85a3:0000:0000:8a2e:0370:7336]:80'
41
+
42
+ generic_ipv6_address_cidr:
43
+ test_positive_examples:
44
+ - '2001:0db8:85a3:0000:0000:8a2e:0370:7334/32'
45
+ - '2001:db8::/32' # actually valid
46
+ test_negative_examples:
47
+ - '2001:db8:/32'
48
+ - '2001:0db8:85a3:0000:0000:8a2e:0370:7335'
49
+ - '[2001:0db8:85a3:0000:0000:8a2e:0370:7336]:80'
50
+ - '2001:0db8:85a3:0000:0000:8a2e:0370:7337/400000'
51
+
52
+ generic_ipv6_address_port:
53
+ test_positive_examples:
54
+ - '[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:80'
55
+ test_negative_examples:
56
+ - '2001:0db8:85a3:0000:0000:8a2e:0370:7335/32'
57
+ - '2001:0db8:85a3:0000:0000:8a2e:0370:7336'
58
+ - '[2001:0db8:85a3:0000:0000:8a2e:0370:7336]:400000'
59
+
60
+ ####### Domain name extractions #######
61
+
62
+ generic_domain_name_only:
63
+ test_positive_examples:
64
+ - 'google.com'
65
+ - 'igvmwp3544wpnd6u.onion'
66
+ test_negative_examples:
67
+ - 'subdomain.google.com' # is subdomain
68
+ - 'example.nottld' # invalid TLD
69
+
70
+ generic_domain_name_subdomain:
71
+ test_positive_examples:
72
+ - 'subdomain.microsoft.com'
73
+ - 'deeper.subdomain.microsoft.com'
74
+ - 'even.deeper.subdomain.microsoft.com'
75
+ - 'something.igvmwp3544wpnd6u.onion'
76
+ test_negative_examples:
77
+ - 'microsoft.com'
78
+
79
+ ####### URL extractions #######
80
+
81
+ generic_url:
82
+ test_positive_examples:
83
+ - 'https://www.amazon.co.uk'
84
+ - 'http://3.3.3.3'
85
+ - 'https://fortinet.com/'
86
+ - 'http://igvmwp3544wpnd6u.onion'
87
+ test_negative_examples:
88
+ - 'https://amazon.co.uk/path/index.html'
89
+ - 'http://3.3.3.3/path/'
90
+
91
+ generic_url_file:
92
+ test_positive_examples:
93
+ - 'https://amazon.co.uk/path/index.html'
94
+ - 'http://3.3.3.3/path.exe'
95
+ - 'https://sub.fortinet.com/blog.html'
96
+ - 'http://igvmwp3544wpnd6u.onion/blog.html'
97
+ test_negative_examples:
98
+ - 'http://3.3.3.3/path/'
99
+ - 'https://www.amazon.co.uk'
100
+ - 'https://www.fakedomain.co.uk/badfile.wtf'
101
+
102
+ generic_url_path:
103
+ test_positive_examples:
104
+ - 'https://example.com/path/'
105
+ - 'http://3.3.3.3/path'
106
+ - 'https://sub.fortinet.com/blog'
107
+ - 'http://igvmwp3544wpnd6u.onion/blog'
108
+ test_negative_examples:
109
+ - 'https://example.com/path/index.html'
110
+ - 'https://isbaseurl.com/'
111
+
112
+ ####### Hostname extractions #######
113
+
114
+ generic_host_name:
115
+ test_positive_examples:
116
+ - 'example.nottld'
117
+ - 'example.local'
118
+ test_negative_examples:
119
+ - 'something.example.local' # is sub-host name
120
+ - '5.5.5.5'
121
+
122
+ generic_host_name_subdomain:
123
+ test_positive_examples:
124
+ - 'something.example.local'
125
+ test_negative_examples:
126
+ - 'example.local'
127
+ - '6.6.6.6'
128
+
129
+ generic_host_name_url:
130
+ test_positive_examples:
131
+ - 'http://example.nottld'
132
+ - 'https://example.local'
133
+ - 'https://www.another.faketld/'
134
+ test_negative_examples:
135
+ - 'example.nottld'
136
+ - 'http://example.nottld/path'
137
+ - 'http://example.nottld/file.exe'
138
+
139
+ generic_host_name_file:
140
+ test_positive_examples:
141
+ - 'http://example.nottld/file.exe'
142
+ test_negative_examples:
143
+ - 'http://example.nottld'
144
+ - 'https://example.local/path'
145
+ - 'http://6.6.6.6'
146
+ - 'https://not.nottld/badfile.wtf'
147
+
148
+ generic_host_name_path:
149
+ test_positive_examples:
150
+ - 'https://example.local/path'
151
+ - 'https://www.another.faketld/path/'
152
+ test_negative_examples:
153
+ - 'http://example.nottld'
154
+ - 'https://base.faketld/'
155
+ - 'http://example.nottld/file.exe'
156
+
157
+ ####### File name extractions #######
158
+
159
+ generic_file_name:
160
+ test_positive_examples:
161
+ - 'file.exe'
162
+ test_negative_examples:
163
+ - 'file.notvalid'
164
+ - 'badfile.wtf'
165
+
166
+ ####### Directory path extractions #######
167
+
168
+ generic_directory_windows:
169
+ test_positive_examples:
170
+ - '\a\path'
171
+ - 'C:\Windows\System64'
172
+ - '..\Publications'
173
+ - '\\system07\C$'
174
+ - '\\.\C:\Test'
175
+ - '\\?\C:\Test\Foo'
176
+ - '%SYSTEM32%\Test\Foo'
177
+ test_negative_examples:
178
+ - '/is/unix/path' # is unix path
179
+ - '\path\to\file.exe' # is path to file
180
+ - 'a\path' # not supported, must be absolute or have one of .. or .
181
+
182
+ generic_directory_windows_with_file:
183
+ test_positive_examples:
184
+ - '\path\to\file.exe'
185
+ test_negative_examples:
186
+ - '\path\to\file.blah' # is invalid file type
187
+ - 'a\path' # no file extension
188
+
189
+ generic_directory_unix:
190
+ test_positive_examples:
191
+ - '/a/file/path'
192
+ - '~/documents'
193
+ - '../directory'
194
+ - './downloads/directory'
195
+ test_negative_examples:
196
+ - '\a\path' # is windows
197
+ - '/a/file/path/file.sh' # is pattern_directory_unix_file
198
+ - 'a/file/path' # not supported, must be absolute or have one of .. or .
199
+
200
+ generic_directory_unix_file:
201
+ test_positive_examples:
202
+ - '/a/file/path/file.sh'
203
+ - './downloads/directory/with/file.pdf'
204
+ test_negative_examples:
205
+ - '\path\to\file.exe' # is windows file path
206
+ - '/a/file/path' # no file extension
207
+
208
+ ####### File hash extractions #######
209
+
210
+ generic_file_hash_md5:
211
+ test_positive_examples:
212
+ - '4ec503be252d765ea37621a629afdaa6'
213
+ test_negative_examples:
214
+ - '900zz11'
215
+
216
+ generic_file_hash_sha_1:
217
+ test_positive_examples:
218
+ - '86F7E437FAA5A7FCE15D1DDCB9EAEAEA377667B8'
219
+ test_negative_examples:
220
+ - '900zz11'
221
+
222
+ generic_file_hash_sha_256:
223
+ test_positive_examples:
224
+ - 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
225
+ test_negative_examples:
226
+ - '900zz11'
227
+
228
+ generic_file_hash_sha_512:
229
+ test_positive_examples:
230
+ - '75d527c368f2efe848ecf6b073a36767800805e9eef2b1857d5f984f036eb6df891d75f72d9b154518c1cd58835286d1da9a38deba3de98b5a53e5ed78a84976'
231
+ test_negative_examples:
232
+ - '900zz11'
233
+
234
+ ####### Email address extractions #######
235
+
236
+ generic_email_address:
237
+ test_positive_examples:
238
+ - 'example@example.com'
239
+ - 'test+1@google.com'
240
+ - 'test_2-1@google.com'
241
+ - 'test_2-1@subdomain.google.com'
242
+ test_negative_examples:
243
+ - 'example@example.blah' # tld is invalid
244
+
245
+ ####### MAC address extractions #######
246
+
247
+ generic_mac_address:
248
+ test_positive_examples:
249
+ - 'd2:fb:49:24:37:18'
250
+ - '00-B0-D0-63-C2-26'
251
+ test_negative_examples:
252
+ - '00-B0-D0-63' # not long enough
253
+ - 'd2:fb:49:24:37:18:98' # is too long
254
+
255
+ ####### Windows registry key extractions #######
256
+
257
+ generic_windows_registry_key:
258
+ test_positive_examples:
259
+ - 'HKEY_LOCAL_MACHINE\System\Foo\Bar'
260
+ - 'HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node'
261
+ - 'HKEY_CLASSES_ROOT\SYSTEM\system32\config\system'
262
+ - 'HKEY_CURRENT_USER\SYSTEM\system32\config\system'
263
+ - 'HKCU\SYSTEM'
264
+ - 'HKLM\Short\Name'
265
+ test_negative_examples:
266
+ - 'HKP\SYSTEM' # not a valid prefix
267
+
268
+ ####### User agent extractions #######
269
+
270
+ generic_user_agent:
271
+ test_positive_examples:
272
+ - 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113'
273
+ - 'Mozilla/5.0 (Linux; Android 11; Lenovo YT-J706X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36'
274
+ - 'Mozilla/5.0 (iPhone14,6; U; CPU iPhone OS 15_4 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/19E241 Safari/602.1'
275
+ test_negative_examples:
276
+ - 'not/a (valid) user/agent'
277
+
278
+ ####### ASN extractions #######
279
+
280
+ generic_autonomous_system_number:
281
+ test_positive_examples:
282
+ - 'ASN15139'
283
+ - 'AS 23434'
284
+ - 'ASN 53453'
285
+ - 'ASN13335'
286
+ test_negative_examples:
287
+ - 'ASN4294967295' # too long
288
+
289
+ ####### Cryptocurrency extractions #######
290
+
291
+ generic_cryptocurrency_btc_wallet:
292
+ test_positive_examples:
293
+ - '3Cwgr2g7vsi1bXDUkpEnVoRLA9w4FZfC69'
294
+ test_negative_examples:
295
+ - ''
296
+
297
+ generic_cryptocurrency_btc_transaction:
298
+ test_positive_examples:
299
+ - '8691f4cac0542ed1d1ae6c47bd5926e39d7911d9148e6ef64060c6ff5e245898'
300
+ test_negative_examples:
301
+ - ''
302
+
303
+ generic_cryptocurrency_eth_wallet:
304
+ test_positive_examples:
305
+ - '0xbce510348026e7a2249fdd868503c99c05fdab2b'
306
+ test_negative_examples:
307
+ - ''
308
+
309
+ generic_cryptocurrency_eth_transaction:
310
+ test_positive_examples:
311
+ - '0xe000ea1eaea92bc736d97a34bed331f0da4788b4c88368b3e277c82fdd7def7b'
312
+ test_negative_examples:
313
+ - ''
314
+
315
+ generic_cryptocurrency_xmr_wallet:
316
+ test_positive_examples:
317
+ - '9b669f6bf58e8ba5618a6ce3ce1afbee488898af6b79d0febd5b75177702291d'
318
+ test_negative_examples:
319
+ - ''
320
+
321
+ generic_cryptocurrency_xmr_transaction:
322
+ test_positive_examples:
323
+ - '3168d759a7c39676ee7f0c28eb8bc3a97b9cad5369d812680cf6a562cea6c662'
324
+ test_negative_examples:
325
+ - ''
326
+
327
+ ####### CVE extractions #######
328
+ ### YOU NEED TO ENSURE POSITIVE TESTS EXIST IN YOUR VULMATCH INSTALL
329
+
330
+ generic_cve_id:
331
+ test_positive_examples:
332
+ - 'CVE-2024-1135'
333
+ - 'CVE-2024-34508'
334
+ - 'CVE-2023-36665'
335
+ test_negative_examples:
336
+ - 'CVE-19999-0000' # too many digits in first part
337
+ - 'CVE-2022-000012' # too many digits in second part
338
+
339
+ generic_cpe_uri:
340
+ test_positive_examples:
341
+ - 'cpe:2.3:a:appcheap:app_builder:3.9.2:*:*:*:*:wordpress:*:*'
342
+ - 'cpe:2.3:a:yithemes:yith_woocommerce_tab_manager:1.29.0:*:*:*:*:wordpress:*:*'
343
+ test_negative_examples:
344
+ - '2.3:a:microsoft:365_apps:-:*:*:*:enterprise:*:x64:*' # start of string is incorrect
345
+ - 'cpe:2.3:a:microsoft' # is partial string
346
+
347
+ ####### Bank card extractions #######
348
+
349
+ generic_bank_card_all:
350
+ test_positive_examples:
351
+ - '5555555555554444'
352
+ - '5555555555554444'
353
+ - '4242424242424242'
354
+ - '376654224631002'
355
+ - '6220123456234563'
356
+ - '6036014561356399'
357
+ - '6219779456356356'
358
+ - '6033674535256453'
359
+ - '30569309025904'
360
+ - '38520000023237'
361
+ - '3530111333300000'
362
+ - '6011111111111117'
363
+ test_negative_examples:
364
+ -
365
+
366
+ generic_bank_card_mastercard:
367
+ test_positive_examples:
368
+ - '5555555555554444'
369
+ - '5555555555554444'
370
+ test_negative_examples:
371
+ - '4242424242424242' # is visa
372
+ - '5555 5555 5555 4443' # not currently smart enough to extract spaces
373
+
374
+ generic_bank_card_visa:
375
+ test_positive_examples:
376
+ - '4242424242424242'
377
+ test_negative_examples:
378
+ - '2223003122003222' # not valid number
379
+ - '424242424242424' # not long enough
380
+ - '4242 4242 4242 4243' # not currently smart enough to extract spaces
381
+
382
+ generic_bank_card_amex:
383
+ test_positive_examples:
384
+ - '376654224631002'
385
+ ignore_extractions:
386
+ - '4242424242424242' # is visa
387
+ - '3710 0400 1548 810' # not currently smart enough to extract spaces
388
+ - '3766 542246 31000' # not currently smart enough to extract spaces
389
+
390
+ generic_bank_card_union_pay:
391
+ test_positive_examples:
392
+ - '6220123456234563'
393
+ - '6036014561356399'
394
+ - '6219779456356356'
395
+ - '6033674535256453'
396
+ test_negative_examples:
397
+ - '4242424242424242' # is visa
398
+ - '6267 8710 2561 6714' # not currently smart enough to extract spaces
399
+
400
+ generic_bank_card_diners:
401
+ test_positive_examples:
402
+ - '30569309025904'
403
+ - '38520000023237'
404
+ test_negative_examples:
405
+ - '4242424242424242' # is visa
406
+ - '38520 0000 23236' # not currently smart enough to extract spaces
407
+
408
+ generic_bank_card_jcb:
409
+ test_positive_examples:
410
+ - '3530111333300000'
411
+ test_negative_examples:
412
+ - '4242424242424242' # is visa
413
+ - '3530 1113 3330 0003' # not currently smart enough to extract spaces
414
+
415
+ generic_bank_card_discover:
416
+ test_positive_examples:
417
+ - '6011111111111117'
418
+ test_negative_examples:
419
+ - '4242424242424242' # is visa
420
+ - '6011 1111 1111 1113' # not currently smart enough to extract spaces
421
+
422
+ ####### IBAN Extractions #######
423
+
424
+ generic_iban_number:
425
+ test_positive_examples:
426
+ - 'DE29100500001061045672'
427
+ - 'GB94BARC10201530093459'
428
+ test_negative_examples:
429
+ - 'XX94BARC10201530093459' # prefix is invalid
430
+
431
+ ####### Phone number Extractions #######
432
+
433
+ generic_phone_number:
434
+ test_positive_examples:
435
+ - '+442083661177'
436
+ - '0044 20836 61177'
437
+ test_negative_examples:
438
+ - '+4420836' # is not long enough
439
+
440
+ ####### County extractions #######
441
+ ### YOU NEED TO ENSURE POSITIVE TESTS EXIST IN YOUR CTIBUTLER INSTALL
442
+
443
+ # note we have ai and generic extractions because AI logic has possibility of detecting descriptions of objects, not just their explicit IDs (the limitation of pattern/lookup modes)
444
+
445
+ generic_country_alpha2:
446
+ test_positive_examples:
447
+ - 'AU'
448
+ - 'GB'
449
+ test_negative_examples:
450
+ - 'UK' # is not ISO 3166 complaint
451
+ - 'USA' # is alpha3, use lookup to convert to alpha2 if AI not convering as expected
452
+ - 'Belgium' # is name, use lookup to convert to alpha2 if AI not convering as expected
453
+
454
+ ai_country:
455
+ test_positive_examples:
456
+ - 'AU'
457
+ - 'GB'
458
+ - 'UK' # is not ISO 3166 complaint but should be converted
459
+ - 'USA' # is alpha3, but should be converted
460
+ - 'Belgium' # is name, but should be converted
461
+ test_negative_examples:
462
+ - ''
463
+
464
+ ####### MITRE ATT&CK #######
465
+ ### YOU NEED TO ENSURE POSITIVE TESTS EXIST IN YOUR CTIBUTLER INSTALL
466
+
467
+ # note we have ai and generic extractions because AI logic has possibility of detecting descriptions of objects, not just their explicit IDs (the limitation of pattern/lookup modes)
468
+
469
+ generic_mitre_attack_enterprise:
470
+ test_positive_examples:
471
+ - 'T1557' # course-of-action--00d7d21b-69d6-4797-88a2-c86f3fc97651 , attack-pattern--b8c5c9dd-a662-479d-9428-ae745872537c
472
+ - 'TA0006' # x-mitre-tactic--2558fd61-8c75-4730-94c4-11926db2a263
473
+ - 'TA0011' # x-mitre-tactic--f72804c5-f15a-449e-a5da-2eecd181f813
474
+ - 'G1006' # intrusion-set--cc613a49-9bfa-4e22-98d1-15ffbb03f034
475
+ - 'T1053.005' # attack-pattern--005a06c6-14bf-4118-afa0-ebcd8aebb0c9
476
+ - 'T1040' # attack-pattern--3257eb21-f9a7-4430-8de1-d8b6e288f529 , course-of-action--46b7ef91-4e1d-43c5-a2eb-00fa9444f6f4
477
+ - 'TA0003' # x-mitre-tactic--5bc1d813-693e-4823-9961-abf9af4b0e92
478
+ test_negative_examples:
479
+ - 'P1174' # not a valid id
480
+ - 'SolarWinds Compromise' # is a name
481
+
482
+ generic_mitre_attack_enterprise_name:
483
+ test_positive_examples:
484
+ - 'Rundll32' # attack-pattern--045d0922-2310-4e60-b5e4-3302302cb3c5
485
+ - 'OS Credential Dumping' # attack-pattern--0a3ead4e-6d47-4ccb-854c-a6a4f9d96b22
486
+ test_negative_examples:
487
+ - 'TA0006' # is id
488
+
489
+ ai_mitre_attack_enterprise:
490
+ test_positive_examples:
491
+ - 'TA0006' # x-mitre-tactic--2558fd61-8c75-4730-94c4-11926db2a263
492
+ - 'TA0011' # x-mitre-tactic--f72804c5-f15a-449e-a5da-2eecd181f813
493
+ - 'G1006' # intrusion-set--cc613a49-9bfa-4e22-98d1-15ffbb03f034
494
+ - 'T1053.005' # attack-pattern--005a06c6-14bf-4118-afa0-ebcd8aebb0c9
495
+ - 'T1040' # attack-pattern--3257eb21-f9a7-4430-8de1-d8b6e288f529 , course-of-action--46b7ef91-4e1d-43c5-a2eb-00fa9444f6f4
496
+ - 'TA0003' # x-mitre-tactic--5bc1d813-693e-4823-9961-abf9af4b0e92
497
+ # hidden as causes ai to get confused - 'Rundll32' # attack-pattern--045d0922-2310-4e60-b5e4-3302302cb3c5
498
+ # hidden as causes ai to get confused - 'OS Credential Dumping' # attack-pattern--0a3ead4e-6d47-4ccb-854c-a6a4f9d96b22
499
+ test_negative_examples:
500
+ - 'T019109'
501
+
502
+ generic_mitre_attack_mobile:
503
+ test_positive_examples:
504
+ - 'M1013' # course-of-action--25dc1ce8-eb55-4333-ae30-a7cb4f5894a1
505
+ - 'S0505' # malware--3271c107-92c4-442e-9506-e76d62230ee8
506
+ - 'T1630.001' # attack-pattern--0cdd66ad-26ac-4338-a764-4972a1e17ee3
507
+ - 'TA0029' # x-mitre-tactic--3e962de5-3280-43b7-bc10-334fbc1d6fa8
508
+ test_negative_examples:
509
+ - 'P1174' # not a valid id
510
+ - 'Use Recent OS Version' # is a name
511
+
512
+ generic_mitre_attack_mobile_name:
513
+ test_positive_examples:
514
+ - 'Impair Defenses' # attack-pattern--20b0931a-8952-42ca-975f-775bad295f1a
515
+ - 'Call Log' # attack-pattern--1d1b1558-c833-482e-aabb-d07ef6eae63d
516
+ test_negative_examples:
517
+ - 'M1013' # is id
518
+
519
+ ai_mitre_attack_mobile:
520
+ test_positive_examples:
521
+ - 'M1013' # course-of-action--25dc1ce8-eb55-4333-ae30-a7cb4f5894a1
522
+ - 'S0505' # malware--3271c107-92c4-442e-9506-e76d62230ee8
523
+ - 'T1630.001' # attack-pattern--0cdd66ad-26ac-4338-a764-4972a1e17ee3
524
+ - 'TA0029' # x-mitre-tactic--3e962de5-3280-43b7-bc10-334fbc1d6fa8
525
+ # hidden as causes ai to get confused - 'Impair Defenses' # attack-pattern--20b0931a-8952-42ca-975f-775bad295f1a
526
+ # hidden as causes ai to get confused - 'Call Log' # attack-pattern--1d1b1558-c833-482e-aabb-d07ef6eae63d
527
+ test_negative_examples:
528
+ - 'T019109'
529
+
530
+ generic_mitre_attack_ics:
531
+ test_positive_examples:
532
+ - 'TA0111' # x-mitre-tactic--33752ae7-f875-4f43-bdb6-d8d02d341046
533
+ test_negative_examples:
534
+ - 'Privilege Escalation' # is name
535
+
536
+ generic_mitre_attack_ics_name:
537
+ test_positive_examples:
538
+ - 'Scripting' # attack-pattern--2dc2b567-8821-49f9-9045-8740f3d0b958
539
+ - 'Program Upload' # attack-pattern--3067b85e-271e-4bc5-81ad-ab1a81d411e3
540
+ test_negative_examples:
541
+ - 'TA0111' # is id
542
+
543
+ ai_mitre_attack_ics:
544
+ test_positive_examples:
545
+ - 'TA0111' # x-mitre-tactic--33752ae7-f875-4f43-bdb6-d8d02d341046
546
+ # hidden as causes ai to get confused - 'Scripting' # attack-pattern--2dc2b567-8821-49f9-9045-8740f3d0b958
547
+ # hidden as causes ai to get confused - 'Program Upload' # attack-pattern--3067b85e-271e-4bc5-81ad-ab1a81d411e3
548
+ test_negative_examples:
549
+
550
+ ####### MITRE CAPEC #######
551
+ ### YOU NEED TO ENSURE POSITIVE TESTS EXIST IN YOUR CTIBUTLER INSTALL
552
+
553
+ # note we have ai and generic extractions because AI logic has possibility of detecting descriptions of objects, not just their explicit IDs (the limitation of pattern/lookup modes)
554
+
555
+ generic_mitre_capec:
556
+ test_positive_examples:
557
+ - 'CAPEC-110' # attack-pattern--7c90bef7-530c-427b-8fb7-f9d3eda9c26a
558
+ test_negative_examples:
559
+ - 'CAPEC-999' # invalid ID
560
+ - 'Brute Force' # is name
561
+
562
+ generic_mitre_capec_name:
563
+ test_positive_examples:
564
+ - 'Clickjacking' # attack-pattern--ec41b2b3-a3b6-4af0-be65-69e82907dfef
565
+ - 'Overflow Buffers' # attack-pattern--77e51461-7843-411c-a90e-852498957f76
566
+ test_negative_examples:
567
+ - 'CAPEC-110' # is id
568
+
569
+ ai_mitre_capec:
570
+ test_positive_examples:
571
+ - 'CAPEC-110' # attack-pattern--7c90bef7-530c-427b-8fb7-f9d3eda9c26a
572
+ # hidden as causes ai to get confused - 'Clickjacking' # attack-pattern--ec41b2b3-a3b6-4af0-be65-69e82907dfef
573
+ # hidden as causes ai to get confused - 'Overflow Buffers' # attack-pattern--77e51461-7843-411c-a90e-852498957f76
574
+ test_negative_examples:
575
+
576
+ ####### MITRE CWE #######
577
+ ### YOU NEED TO ENSURE POSITIVE TESTS EXIST IN YOUR CTIBUTLER INSTALL
578
+
579
+ # note we have ai and generic extractions because AI logic has possibility of detecting descriptions of objects, not just their explicit IDs (the limitation of pattern/lookup modes)
580
+
581
+ generic_mitre_cwe:
582
+ test_positive_examples:
583
+ - 'CWE-1023' # weakness--c122031a-5735-54f2-a80b-194da3a2c0e6
584
+ - 'CWE-102' # weakness--ad5b3e38-fdf2-5c97-90da-30dad0f1f016
585
+ test_negative_examples:
586
+ - 'CWE-999' # invalid id
587
+ - 'Destructor' # is name
588
+
589
+ generic_mitre_cwe_name:
590
+ test_positive_examples:
591
+ - 'Use of Redundant Code' # weakness--6dfb4e56-706d-5243-a3eb-6d4e49b16389
592
+ - 'Insufficient Encapsulation' # weakness--b0a3b7a9-fefa-5435-8336-4d2e019597f8
593
+ test_negative_examples:
594
+ - 'CWE-102' # is id
595
+
596
+ ai_mitre_cwe:
597
+ test_positive_examples:
598
+ - 'CWE-1023' # weakness--c122031a-5735-54f2-a80b-194da3a2c0e6
599
+ - 'CWE-102' # weakness--ad5b3e38-fdf2-5c97-90da-30dad0f1f016
600
+ # hidden as causes ai to get confused - 'Use of Redundant Code' # weakness--6dfb4e56-706d-5243-a3eb-6d4e49b16389
601
+ # hidden as causes ai to get confused - 'Insufficient Encapsulation' # weakness--b0a3b7a9-fefa-5435-8336-4d2e019597f8
602
+ test_negative_examples:
603
+
604
+ ####### MITRE ATLAS #######
605
+ ### YOU NEED TO ENSURE POSITIVE TESTS EXIST IN YOUR CTIBUTLER INSTALL
606
+
607
+ generic_mitre_atlas:
608
+ test_positive_examples:
609
+ - 'AML.M0015' # course-of-action--91d08908-dd7d-487c-b035-6f43f54f1855
610
+ - 'AML.T0050' # attack-pattern--3f58075b-fed5-49ad-b41d-b6f664678e24
611
+ test_negative_examples:
612
+ - 'AML.T0009' # invalid id
613
+ - 'Reconnaissance' # is name
614
+
615
+ generic_mitre_atlas_name:
616
+ test_positive_examples:
617
+ - 'Defense Evasion' # x-mitre-tactic--45d9ba3e-1656-4de1-b132-e9faa8f8c969
618
+ - 'Active Scanning' # attack-pattern--c3a26e3e-3220-422c-b4b4-3913820fe6cf
619
+ test_negative_examples:
620
+ - 'AML.T0050' # is id
621
+
622
+ ####### DISARM #######
623
+ ### YOU NEED TO ENSURE POSITIVE TESTS EXIST IN YOUR CTIBUTLER INSTALL
624
+
625
+ generic_disarm:
626
+ test_positive_examples:
627
+ - 'T0131.001' # attack-pattern--db0a00c8-7913-5895-b0a2-a7378eaab591
628
+ - 'TA01' # x-mitre-tactic--b977ad29-eb0c-5f09-bb2f-6d3f23e2a175
629
+ test_negative_examples:
630
+ - 'TA0001' # invalid id
631
+ - 'Reconnaissance' # is name
632
+
633
+ generic_disarm_name:
634
+ test_positive_examples:
635
+ - 'Microtarget' # x-mitre-tactic--10ccaa61-bf44-56ec-b1a7-3fc01942ec6d
636
+ - 'Develop Narratives' # x-mitre-tactic--ec5943c5-cf40-59dd-a7ed-c2175fc9727a
637
+ test_negative_examples:
638
+ - 'T0131.001' # is id
639
+
640
+ ####### Misc STIX Objects #######
641
+
642
+ lookup_attack_pattern:
643
+ test_positive_examples:
644
+ - 'Content Spoofer'
645
+ test_negative_examples:
646
+ - 'Attack Pattern2' # not in lookup
647
+
648
+ lookup_campaign:
649
+ test_positive_examples:
650
+ - 'Inspector-1'
651
+ test_negative_examples:
652
+ - 'Campaign' # not in lookup
653
+
654
+ lookup_course_of_action:
655
+ test_positive_examples:
656
+ - 'Patch server'
657
+ test_negative_examples:
658
+ - 'Course of Action' # not in lookup
659
+
660
+ lookup_identity:
661
+ test_positive_examples:
662
+ - 'Franistan Intelligence'
663
+ test_negative_examples:
664
+ - 'Identity' # not in lookup
665
+
666
+ lookup_infrastructure:
667
+ test_positive_examples:
668
+ - 'C2 Server'
669
+ test_negative_examples:
670
+ - 'Infrastructure' # not in lookup
671
+
672
+ lookup_intrusion_set:
673
+ test_positive_examples:
674
+ - 'APT BPP'
675
+ test_negative_examples:
676
+ - 'Intrustion Set' # not in lookup
677
+
678
+ lookup_malware:
679
+ test_positive_examples:
680
+ - 'revil'
681
+ - 'Sodinokibi'
682
+ test_negative_examples:
683
+ - 'Malware' # not in lookup
684
+
685
+ lookup_threat_actor:
686
+ test_positive_examples:
687
+ - 'APT9999'
688
+ test_negative_examples:
689
+ - 'Threat Actor' # not in lookups
690
+
691
+ lookup_tool:
692
+ test_positive_examples:
693
+ - 'keygen'
694
+ test_negative_examples:
695
+ - 'tool' # not in lookups