Skip to main content

IOC Typing (a classifier)

CI codecov PyPI Python versions Docs License Ruff

A Python library for identifying and classifying various types of Indicators of Compromise (IOCs). IOCs are forensic artifacts that indicate potential security breaches, malware infections, or other malicious activities in a system or network.

Installation

From PyPI (stable release):

pip install ioc-typing

For development:

git clone https://github.com/janwychowaniak/ioc-typing.git
cd ioc-typing
pipx install hatch         # or: uv tool install hatch
hatch shell                # drop into a managed dev env
pipx install pre-commit && pre-commit install   # activate git hooks

Usage

Basic usage:

from ioc_typing import IOCClassifier

classifier = IOCClassifier()

classifier.classify("192.168.1.1")
# {'query': '192.168.1.1', 'determined': True, 'type_pri': 'ip', 'type_sec': 'v4'}

classifier.classify("evil.com")
# {'query': 'evil.com', 'determined': True, 'type_pri': 'domain', 'type_sec': None}

classifier.classify("44d88612fea8a8f36de82e1278abb02f")
# {'query': '44d88612fea8a8f36de82e1278abb02f', 'determined': True, 'type_pri': 'hash', 'type_sec': 'md5'}

Batch classification:

iocs = [
    "192.168.1.1",
    "https://pages.info/malware.exe",
    "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824",
    "not an IOC"
]

for ioc in iocs:
    ioc_type = classifier.classify(ioc)
    print(f"{ioc}: {ioc_type['type_pri']}")

See examples/ for runnable scripts that use the API directly.

Command-line usage

Installing the package also exposes an ioc-classify command:

ioc-classify iocs.txt                # TSV (default)
ioc-classify --format json iocs.txt  # JSON Lines
cat iocs.txt | ioc-classify          # read from stdin
ioc-classify iocs.txt | awk -F'\t' '$3 == "hash"'  # pipeline-friendly

Blank lines and lines starting with # are skipped, so the input file can be commented.

Features

  • Identifies multiple IOC types:
    • IP addresses (IPv4 and IPv6)
    • Domain names
    • URLs
    • File hashes (MD5, SHA1, SHA256)
    • as well as non-IOCs (e.g. random strings)
  • Fast and accurate classification using optimized regex patterns
  • Zero dependencies for core functionality
  • Comprehensive test suite ensuring reliability
  • Easy integration with existing security tools and SIEM systems

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Metadata

Release files for ioc-typing 0.3.0

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

Source distribution (sdist)

Source distribution for ioc-typing 0.3.0
File Size Uploaded Provenance Actions
ioc_typing-0.3.0.tar.gz 19.2 kB With provenance Details for ioc_typing-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ioc-typing 0.3.0
File Interpreter ABI Platform Actions
ioc_typing-0.3.0-py3-none-any.whl Python 3 none any Details for ioc_typing-0.3.0-py3-none-any.whl

Total release size: 26.8 kB

Release files / ioc_typing-0.3.0.tar.gz

Download URL ioc_typing-0.3.0.tar.gz
Size 19.2 kB
Tags Source
SHA-256 checksum
How to use checksums
73b2996a0b8546c67ad0829b2114feccc7f069fbdc1767c84f64c70fedbe5bed
BLAKE2b-256 checksum
How to use checksums
4f8307397f6745b17451e8b2f008da2f15a13343ad1b124f83ec73e207ce726d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 6, 2026.

Transparency log

Release files / ioc_typing-0.3.0-py3-none-any.whl

Download URL ioc_typing-0.3.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d57417f0a253fe93a7ee78888a94ed1ab2d588501d3bbb3d970eda0af2164af8
BLAKE2b-256 checksum
How to use checksums
d1aae6c9168e6cdfc32a9f5cad14a66165719179b29063c472f6a0a4d056e28d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 6, 2026.

Transparency log

Security for ioc-typing 0.3.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ioc_typing-0.3.0.tar.gz

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 May 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

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