Skip to main content

text2ioc banner

text2ioc

text2ioc extracts Indicators of Compromise (IoCs) from unstructured text such as articles, reports, logs, and threat-intelligence notes.

Disclaimer text2ioc is a deterministic pattern-extraction package, not a threat-intelligence validation engine. It combines regex matching with heuristic post-filtering, so many returned values are best understood as candidate IoC-like patterns rather than strict, confirmed IoCs.

Install from PyPI:

pip install text2ioc

Usage

import json

from text2ioc.ioc import extract_iocs

text = (
    "Download https://dpaste[.]com/9MQEJ6VYR.txt from 77.221.158[.]154, "
    "contact ops[at]example.org, and review T1059.001 linked to TA0002."
)

iocs = extract_iocs(text)
print(json.dumps(iocs, indent=2))

Expected output:

{
  "filepath": [],
  "file": [],
  "url": [
    "https://dpaste[.]com/9MQEJ6VYR.txt"
  ],
  "domain": [],
  "email": [
    "ops[at]example.org"
  ],
  "ipv4": [
    "77.221.158[.]154"
  ],
  "ipv6": [],
  "md5": [],
  "sha1": [],
  "sha256": [],
  "cve": [],
  "expressions": [],
  "attack_technique_id": [
    "T1059.001"
  ],
  "attack_tactic_id": [
    "TA0002"
  ],
  "registry_key": [],
  "cwe": [],
  "ghsa": [],
  "capec": []
}

Field Semantics

The extractor is regex-first, then removes false positives with explicit heuristics. It does not resolve domains, validate reachability, or decide whether an indicator is malicious. It only returns strings that match the current parsing rules.

  • filepath: Unix, Windows, UNC, and relative paths. It trims trailing punctuation, keeps quoted paths, and discards bare basenames without extensions, unlikely Linux roots, and slash-prefixed strings that do not appear in a path-like context.
  • file: File names and suspicious extensions, including defanged forms like cmd[dot]exe. It excludes obvious domains, version-like tokens, e.g / i.e, and many-segment dotted identifiers that look more like namespaces than files.
  • url: URLs with an explicit scheme, optional port, and optional path. It accepts normal and defanged separators, plus IPv4 hosts. It does not keep malformed schemes, malformed ports, or plain hostnames without a scheme.
  • domain: Plain domains, subdomains, wildcard domains, defanged domains, and .onion addresses. It excludes items with invalid or unsupported TLDs, file extensions, README.md, permission-style names, reverse-domain identifiers, EC2 shapes, Azure namespaces, ANY.RUN, code symbols like EndpointRequest.to(), markup/CMS fragments, and legal-entity strings like Co.LTD when the surrounding context looks organizational rather than web-related.
  • email: Standard and defanged email addresses. The domain part must end in a valid TLD and must not look like a file extension. Domain-like fragments that are only part of an email are intentionally not duplicated under domain.
  • ipv4: Standard and defanged IPv4 addresses. It excludes invalid octets, partial quads, and version-like quads in advisory/product contexts, including cases with leading-zero octets such as 16.03.08.12 or parenthetical build suffixes such as 1.2.0.14(408).
  • ipv6: Standard and compressed IPv6 forms such as ::1 and 2001:db8::1. It excludes malformed addresses with invalid hex groups or invalid double compression.
  • md5: Exactly 32 hexadecimal characters.
  • sha1: Exactly 40 hexadecimal characters.
  • sha256: Exactly 64 hexadecimal characters.
  • cve: Tokens matching CVE-YYYY-NNNN....
  • expressions: Template-like expressions in ${...} form.
  • attack_technique_id: MITRE ATT&CK technique IDs such as T1059 or T1059.001. It does not synthesize IDs from ATT&CK URL paths like /T1059/001/.
  • attack_tactic_id: MITRE ATT&CK tactic IDs such as TA0001.
  • registry_key: Windows registry paths rooted in a known hive such as HKLM, HKCU, or HKEY_LOCAL_MACHINE, with one or more subkeys. It avoids swallowing trailing command arguments.
  • cwe: Tokens matching CWE-N.
  • ghsa: GitHub advisory IDs such as GHSA-v63m-x9r9-8gqp.
  • capec: Tokens matching CAPEC-N.

General filtering that is already codified today:

  • Results are deduplicated, and shorter matches that are fully contained inside longer ones are dropped.
  • The extractor uses the Public Suffix List for domain and email TLD validation, with a built-in fallback set when the suffix list cannot be fetched or parsed.
  • For domain, if mixed defanged/plain candidates appear together, the code keeps the explicitly domain-like ones and avoids re-emitting noisy fragments.

Support & Connect

Release files for text2ioc 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for text2ioc 0.1.5
File Size Uploaded
text2ioc-0.1.5.tar.gz 2.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for text2ioc 0.1.5
File
text2ioc-0.1.5-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl PyPy 3.10 PyPy 3.10 7.3 Linux glibc 2.28+ ARM64 Details
text2ioc-0.1.5-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl PyPy 3.10 PyPy 3.10 7.3 Linux glibc 2.17+ ARMv7l Details
text2ioc-0.1.5-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl PyPy 3.9 PyPy 3.9 7.3 Linux glibc 2.28+ ARM64 Details
text2ioc-0.1.5-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl PyPy 3.9 PyPy 3.9 7.3 Linux glibc 2.17+ ARMv7l Details
text2ioc-0.1.5-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
text2ioc-0.1.5-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details
text2ioc-0.1.5-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details
text2ioc-0.1.5-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.10 abi3 Linux glibc 2.17+ ARMv7l Details
text2ioc-0.1.5-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
text2ioc-0.1.5-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 11.5 MB

Release files / text2ioc-0.1.5.tar.gz

Download URL text2ioc-0.1.5.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
5182acc94f01b1eebc02d6d6e8e337d7a6c91b53bd8be1c981f2f8836a513b97
BLAKE2b-256 checksum
How to use checksums
782f46704e3f5f96bec6aa7581af8bd05677d5e555f7a21774f17a01e5459dff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / text2ioc-0.1.5-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl

Download URL text2ioc-0.1.5-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl
Size 981.9 kB
Tags Linux glibc 2.28+ ARM64 PyPy 3.10 PyPy 3.10 7.3
SHA-256 checksum
How to use checksums
d7015a979dd78b13038af1ad61b5fdb83dc7692f165eafd38349cf63a3695a11
BLAKE2b-256 checksum
How to use checksums
b3f6101a3c238a303139ef395f55cadbd687d2ed03c015f84b72412e506f0d07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / text2ioc-0.1.5-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL text2ioc-0.1.5-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 940.8 kB
Tags Linux glibc 2.17+ ARMv7l PyPy 3.10 PyPy 3.10 7.3
SHA-256 checksum
How to use checksums
412a89913ecb9fd43f23bd82d387f8f9024ff64e220d25923feee8e44e4bced4
BLAKE2b-256 checksum
How to use checksums
ad67b88ce34d29a8f01207859f79437284a906b1b4d4f11b4c97a362192fe388
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / text2ioc-0.1.5-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl

Download URL text2ioc-0.1.5-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl
Size 983.7 kB
Tags Linux glibc 2.28+ ARM64 PyPy 3.9 PyPy 3.9 7.3
SHA-256 checksum
How to use checksums
0c10ba45147fc99233335b7c55cd374da5c26729c1231200caeb87145db3e5b4
BLAKE2b-256 checksum
How to use checksums
7bf59dab189fa23a0a59767d823df48bb5a9fa67a3285a5c89d9322e2e6b4ac2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / text2ioc-0.1.5-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL text2ioc-0.1.5-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 942.5 kB
Tags Linux glibc 2.17+ ARMv7l PyPy 3.9 PyPy 3.9 7.3
SHA-256 checksum
How to use checksums
47aedc743fc43fbd38e406dc4aa193d79a888248b6044f1b645c3f85363ae4c3
BLAKE2b-256 checksum
How to use checksums
aed6985f1e01a4f6189d81d4fbbecaf5aa7f0d27398a8bf9ff7d712bf9e683ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / text2ioc-0.1.5-cp310-abi3-win_amd64.whl

Download URL text2ioc-0.1.5-cp310-abi3-win_amd64.whl
Size 769.2 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
9e5b73aab42895f84606c694551d6b1a09f8aa25c7f5acb51017ee797f3097b8
BLAKE2b-256 checksum
How to use checksums
c71d358df6b92d83c28a58d8b55f0dc246db8dc398d69ded8be756feeab2954d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / text2ioc-0.1.5-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL text2ioc-0.1.5-cp310-abi3-manylinux_2_28_x86_64.whl
Size 1.0 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
9a8d1f4dc6861c3d1dce029362f939b6a83b961f6d026ac2311043553fe5ba63
BLAKE2b-256 checksum
How to use checksums
c5b461d8a0ebfc24823d244d4c696c4155c07d3f2de5661e2b57f4b01a50082d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / text2ioc-0.1.5-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL text2ioc-0.1.5-cp310-abi3-manylinux_2_28_aarch64.whl
Size 981.5 kB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
84ab50f0bef1f06f78a493b32594594fe2fb7086a87fff84e587f69c1b14480d
BLAKE2b-256 checksum
How to use checksums
0360b383f5232d6b08da6c3810b33b2a33f1ff16e9e9b441d1447f6338a97e03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / text2ioc-0.1.5-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL text2ioc-0.1.5-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 940.4 kB
Tags CPython 3.10 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
e052a04e28dd47744d70dce9a37654f5c69d1fa3df44d8f62fe69d281bd0d485
BLAKE2b-256 checksum
How to use checksums
1fc536638edb097293eee53562223b220787344993cd1277cb200e1c5d8a9e4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / text2ioc-0.1.5-cp310-abi3-macosx_11_0_arm64.whl

Download URL text2ioc-0.1.5-cp310-abi3-macosx_11_0_arm64.whl
Size 864.5 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
258f11e2f1fde879f223e186eee7c49cda96bc2613970677b4ac1a9d47ac00a6
BLAKE2b-256 checksum
How to use checksums
9e3a24baf943654b1c3ad647094f23d5055d44e6e8bf7060a971370173afdff1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / text2ioc-0.1.5-cp310-abi3-macosx_10_12_x86_64.whl

Download URL text2ioc-0.1.5-cp310-abi3-macosx_10_12_x86_64.whl
Size 911.5 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
4b4bdf649c41fde3807314eb7bd935e67b2f04375b0a3e5be324599c049f42b2
BLAKE2b-256 checksum
How to use checksums
4d36cf7ee29e0e3a2c678b8364cccfec8bf1146a37014fdaa842a982352c9e74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.5 This release

11 release files

0.1.2

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page