ioc-fanger
Python package to defang and fang indicators of compromise from text.
What it is and what it does
IOC Fanger is a Python library that bidirectionally transforms indicators of compromise (IOCs) between defanged and normal forms. Defanging is a common practice in threat intelligence to prevent accidental execution or lookup of malicious URLs, domains, and email addresses—replacing dots with `[.]`, colons with `[:]`, and using obfuscated URL schemes like `hXXp://`. This package reverses those transformations (fanging) and also applies them (defanging) using a conservative, unambiguous set of substitutions.
The library recognizes a wide range of defanging patterns: brackets, parentheses, and braces around special characters; literal words like `DOT` or `punto` substituted for dots; escaped characters; IPv4 addresses with commas; and malformed URL schemes. It combines these patterns, so complex inputs like `hXXp://bad[.]example[dot]com/file[.]php` are fully restored in a single call. The defang function applies the reverse—replacing dots between word characters with `[.]`, URL schemes with obfuscated variants, and `@` symbols with `(at)`—ensuring output that can be reliably re-fanged.
Use it for:
- Restore defanged IOCs from threat reports, security blogs, or social media posts for automated lookup and enrichment.
- Defang URLs and domains before sharing them in emails, Slack, or documentation to prevent accidental clicks.
- Normalize IOC formats in threat intelligence feeds or SIEM ingestion pipelines.
- Parse mixed defanged and normal IOCs from unstructured security alerts or incident notes.
- Build threat-hunting tools that accept user-pasted IOCs in either form and convert them for database queries.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts defanged indicators of compromise (IOCs) like `example[.]com` back to `example.com`, and conversely fangs normal IOCs to obfuscated forms for safe sharing in threat intelligence.
Yes. Active maintenance, no known vulnerabilities, permissive MIT license, and low install friction make it a safe choice. The package solves a real, recurring problem in threat intelligence workflows. Use it when you need to reliably convert between defanged and normal IOC forms.
Install
ioc-fanger on PyPI
pip
pip install ioc-fangeruv
uv add ioc-fangerpoetry
poetry add ioc-fangerInstalling ioc-fanger
Before you install
Low friction: pure Python wheel with a single runtime dependency (click). Active maintenance—last commit 2026-08-11, 58 days since latest release. Supports Python 3.10 through 3.14.
License in practice
MIT license (permissive). No restrictions on use, modification, or redistribution in commercial or proprietary projects.
Quickstart
pip install ioc-fanger
from ioc_fanger import fang, defang
defanged = defang('example.com')
restored = fang('example[.]com')
Requires Python 3.10 or later.
Verify before relying
- Whether the package is suitable for real-time processing of large IOC batches or primarily for ad-hoc text transformation.
- Performance characteristics when processing complex multi-pattern defanged strings (e.g., mixed escaping styles).
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — click |
| Maintenance | actively maintained — 58 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 113,267/month — #12,348 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ioc_fanger-5.1.1-py3-none-any.whl
Keywords: defang, defanging, fang, fanging, indicators of compromise, iocs, malware, observables, refang, threat hunting, threat intelligence
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
OTXv2OTXv2 is a Python client for AlienVault's Open…
unclear · top 15,000 on PyPI
threatwirethreatwire provides real-time network packet…
permissive · top 15,000 on PyPI
publicsuffixlistParses the Public Suffix List to extract the…
copyleft · top 5,000 on PyPI
urlcanonParses and normalizes URLs according to WHATWG…
permissive · top 15,000 on PyPI
publicsuffix2Extracts the public suffix and registrable…
copyleft · top 5,000 on PyPI
flake8-picky-parenthesesA flake8 plugin that detects and reports…
permissive · top 15,000 on PyPI
ada-urlParse, validate, and manipulate URLs according…
permissive · top 15,000 on PyPI
androguardAndroguard is a Python tool for analyzing,…
permissive · top 5,000 on PyPI
anyasciiConverts Unicode text to ASCII-only equivalents…
permissive · top 5,000 on PyPI
url-normalizeStandardizes URLs to a canonical form by…
permissive · top 1,000 on PyPI