# iocextract

> Python library and CLI that extracts URLs, IPs, hashes, emails and YARA rules from text, including defanged indicators.

Source: https://osinttools.io/tools/iocextract/ (Markdown view of an OSINTtools.io page; append `.md` to any page URL for this format).

- **Inputs:** File
- **Category:** Threat intelligence
- **Pricing:** Open source (Free and open source (GPL-2.0).)
- **Footprint:** passive (does not contact the target)
- **Account required:** no
- **API:** yes
- **Platforms:** Python library · CLI
- **Website:** https://inquest.readthedocs.io/projects/iocextract/
- **Docs:** https://inquest.readthedocs.io/projects/iocextract/
- **Source code:** https://github.com/pedramamini/iocextract
- **GitHub:** pedramamini/iocextract, 581 stars · Python · GPL-2.0 · last commit 2024-08-28 · dormant (no commit on the default branch in 18 months)
- **Listed:** Nov 23
- **Last verified by an editor:** Nov 23, 2026

## What it does

iocextract pulls indicators of compromise such as URLs, IP addresses, MD5 and SHA hashes, email addresses and YARA rules out of text. Its regexes catch defanged forms such as example[.]com or hxxp:// and can refang them.

Threat analysts use it to turn reports, posts and other text into machine-readable indicator lists. It runs as a Python library or a command-line tool and works entirely offline.

Footprint is passive: it reads its own index or third-party records and does not contact the target. No account is needed. There is an API.

## Features

- URL, IP, hash and email extraction
- YARA rule extraction
- Defanged indicator detection
- Optional refanging
- Custom regex support
- Python library and CLI

## Pros

- Catches indicators that plain regexes miss
- Iterators handle very large inputs
- Offline, with no external calls
- Documented on Read the Docs

## Cons

- Some URLs may appear twice when several regexes match
- Extraction only; it does not enrich or score indicators

## When to use it

- Use it when you need indicators from a threat report in a usable list.
- Use it when building a pipeline that ingests defanged indicators from social posts.

## Quick start

Terminal · Python:

```
pip install iocextract
iocextract --input report.txt
```

## Alternatives

- [MalwareBazaar](https://osinttools.io/tools/malwarebazaar/): abuse.ch repository of malware samples searchable by hash, family, tag or signature, with free downloads for research. (Free · File · passive)
- [ANY.RUN](https://osinttools.io/tools/any-run/): Interactive malware sandbox where you watch and control a sample's execution in a live virtual machine. (Freemium · File, URL · depends)
- [Hybrid Analysis](https://osinttools.io/tools/hybrid-analysis/): Free malware sandbox from CrowdStrike that detonates files and URLs and publishes behaviour reports. (Free · File, URL · depends)
- [VirusTotal](https://osinttools.io/tools/virustotal/): Google-owned service that checks files, URLs, domains and IPs against many antivirus engines and threat feeds. (Freemium · File, URL, Domain, IP address · depends)
- [AlienVault OTX](https://osinttools.io/tools/alienvault-otx/): Free community threat intelligence platform where researchers share indicators in grouped 'pulses'. (Free · IP address, Domain, URL, File · passive)
- [IntelOwl](https://osinttools.io/tools/intelowl/): Self-hosted threat intelligence platform that enriches IPs, domains, URLs, hashes and files through many analyzers. (Open source · IP address, Domain, URL, File · depends · 4,831 GitHub stars)

All alternatives to iocextract in one table: https://osinttools.io/tools/iocextract/alternatives/

---

Listings on OSINTtools.io are reviewed by editors and re-verified on a schedule; check pricing and availability on the vendor's site before relying on them, and use OSINT tools only with a lawful basis.
Site index for agents: https://osinttools.io/llms.txt · Full catalog: https://osinttools.io/llms-full.txt · MCP server (Streamable HTTP, no auth): https://osinttools.io/mcp/
