Skip to main content

Python package for finding and parsing indicators of compromise from text.

Project description

Copyright (c) 2018, Floyd Hightower

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Description: # IOC Finder

[![PyPi](https://img.shields.io/pypi/v/ioc_finder.svg)](https://pypi.python.org/pypi/ioc_finder) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/4078c4e3e384431bbe69c35c7f6da7b7)](https://www.codacy.com/app/fhightower/ioc-finder) [![Build Status](https://travis-ci.org/fhightower/ioc-finder.svg?branch=master)](https://travis-ci.org/fhightower/ioc-finder) [![codecov](https://codecov.io/gh/fhightower/ioc-finder/branch/master/graph/badge.svg)](https://codecov.io/gh/fhightower/ioc-finder)

Parse [indicators of compromise](https://searchsecurity.techtarget.com/definition/Indicators-of-Compromise-IOC) from text.

## Capabilities

Currently, this package can the following items in a given text:

  • IP address (IPv4 and IPv6)

  • Email addresses (both standard format (e.g. test@example.com) and an email with an IP address as the domain (e.g. test@[192.168.0.1]))

  • Domain names (support for Unicode domain names (e.g. ȩxample.com) is coming soon)

  • URLs

  • File hashes (md5, sha1, sha256, and sha512)

  • Registry Key paths (e.g. “HKEY_LOCAL_MACHINESoftwareMicrosoftWindows)

  • Autonomous System Numbers (ASNs) (in multiple formats such as asn1234 and as 1234)

  • CVEs (e.g. CVE-2014-1234)

  • CIDR ranges (currently ipv4 ranges; ipv6 ranges coming soon)

  • Google Adsense Publisher IDs

  • Google Analytics Tracker IDs

  • Bitcoin addresses (P2PKH, P2SH, and Bech32)

  • Others… if you have any requests, [let me know](https://github.com/fhightower/ioc-finder) (or you can contact me [here](https://hightower.space/contact/) to make private suggestions)!

Also provides some helpful features like:

  • Ability to remove an indicator type after it is parsed - For example, if you would like to parse all URLs, but do not want to parse the domain name from each URL, you specify this.

## Installation

To install this package:

` pip install ioc-finder `

## Usage

To use this package:

`python from ioc_finder import find_iocs text = "This is just an example.com https://example.org/test/bingo.php" iocs = find_iocs(text) print('Domains: {}'.format(iocs['domains'])) print('URLs: {}'.format(iocs['urls'])) `

See [test_ioc_finder.py](https://github.com/fhightower/ioc-finder/blob/master/tests/test_ioc_finder.py) for more examples.

## Credits

This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and Floyd Hightower’s [python-project-template](https://gitlab.com/fhightower-templates/python-project-template) project template.

Previous iterations of this package were inspired by [https://github.com/mosesschwartz/extract_iocs](https://github.com/mosesschwartz/extract_iocs).

Keywords: iocs indicators of compromise parsing finding searching threat intelligence Platform: UNKNOWN

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ioc_finder-1.0.8.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ioc_finder-1.0.8-py2.py3-none-any.whl (13.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ioc_finder-1.0.8.tar.gz.

File metadata

  • Download URL: ioc_finder-1.0.8.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.6

File hashes

Hashes for ioc_finder-1.0.8.tar.gz
Algorithm Hash digest
SHA256 a33b1821dee549282b7922a37c6ed3ace17b3b275e6580c375328ad9ef97599b
MD5 492690e81ea05498320e74587e1090aa
BLAKE2b-256 907acf9c3cbd740eddd13c8d5c1f5268b75579c6e8461d2f24f07ebff588d8e5

See more details on using hashes here.

File details

Details for the file ioc_finder-1.0.8-py2.py3-none-any.whl.

File metadata

  • Download URL: ioc_finder-1.0.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.6

File hashes

Hashes for ioc_finder-1.0.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 941e0c7d32b85d97e3d955f723485097f6a07791f98ac038f01fbef94a834c2a
MD5 2f74c7ae75f9aa1a72d0b069cacc711c
BLAKE2b-256 7a3432fc5ef9bf24b56609d480a9ba484918981124b1bb8b46e6aa5b5db229aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page