ioc-finder


Nameioc-finder JSON
Version 4.0.1 PyPI version JSON
download
home_pagehttps://github.com/fhightower/ioc-finder
SummaryPython package for finding and parsing indicators of compromise from text.
upload_time2020-09-11 21:23:43
maintainer
docs_urlNone
authorFloyd Hightower
requires_python
licenseMIT
keywords iocs indicators of compromise parsing finding searching threat intelligence malware threat hunting observables domains domain names asns cidr cidr ranges ips ip addresses urls email addresses md5 sha1 sha256 google ads cve file paths
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Observable Finder (Formerly named "IOC Finder")

[![PyPi](https://img.shields.io/pypi/v/ioc_finder.svg)](https://pypi.python.org/pypi/ioc_finder)
![PyPI - Downloads](https://img.shields.io/pypi/dm/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)
[![live demo](https://img.shields.io/badge/live%20demo-%E2%86%92-green)](http://ioc-finder.hightower.space/)

Parse [indicators of compromise](https://searchsecurity.techtarget.com/definition/Indicators-of-Compromise-IOC) from text. You can test this project here: [http://ioc-finder.hightower.space/](http://ioc-finder.hightower.space/).

## Capabilities

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

- Autonomous System Numbers (ASNs) (in multiple formats such as `asn1234` and `as 1234`)
- Bitcoin addresses (P2PKH, P2SH, and Bech32)
- CIDR ranges (currently ipv4 ranges; ipv6 ranges coming soon)
- CVEs (e.g. `CVE-2014-1234`)
- Domain names (support for Unicode domain names (e.g. `»©xample.com`) is coming soon)
- 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]`))
- File hashes (md5, sha1, sha256, sha512, and [import hashes](https://www.fireeye.com/blog/threat-research/2014/01/tracking-malware-import-hashing.html), and [authentihashes](http://msdn.microsoft.com/en-us/library/windows/hardware/gg463180.aspx))
- File paths (*beta*)
- Google Adsense Publisher IDs
- Google Analytics Tracker IDs
- IP address (IPv4 and IPv6)
- MAC addresses (*beta*)
- Phone numbers (*beta*)
- Registry key paths (e.g. `"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows`)
- SSDeep hashes (*beta*)
- URLs (URLs with and without schemes)
- User agents (*beta*)
- XMPP addresses (basically, this captures email addresses whose domain names contain "jabber" or "xmpp")
- MITRE ATT&CK data (see [more info](https://attack.mitre.org/)):
    - Pre-attack tactics and techniques (and [sub-techniques](https://medium.com/mitre-attack/attack-subs-what-you-need-to-know-99bce414ae0b))
    - Enterprise mitigations, tactics, and techniques (and [sub-techniques](https://medium.com/mitre-attack/attack-subs-what-you-need-to-know-99bce414ae0b))
    - Mobile mitigations, tactics, and techniques (and [sub-techniques](https://medium.com/mitre-attack/attack-subs-what-you-need-to-know-99bce414ae0b))
- [TLP labels](https://www.us-cert.gov/tlp)
- 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:

- Option to parse domain name from a URL
- Option to parse domain name from an email address
- Option to parse IP address from a CIDR range
- Option to parse URLs without a scheme (e.g. without `https://`)
- Option to parse [import hashes](https://www.fireeye.com/blog/threat-research/2014/01/tracking-malware-import-hashing.html) and [authentihashes](http://msdn.microsoft.com/en-us/library/windows/hardware/gg463180.aspx)

## Known Limitations

- When parsing **registry key paths**, this library will NOT properly parse a registry key path where the last section contains a space. For example, `<HKCU>\software\microsoft\windows\currentversion\explorer\advanced on` will be parsed as `<HKCU>\software\microsoft\windows\currentversion\explorer\advanced` (the space in the final section is removed).
- The items listed above (in the "Capabilities" section) that are postceded by "(*beta*)" are not very robust and may still have major issues. Any feedback or issues related to these items are much appreciated.
- When parsing **markdown**, if there is a domain name that is surrounded by underscores (which would make the domain name italic in some flavours of markdown - e.g. `_google.com_`), the domain will be parsed *including* the leading underscore (e.g. `_google.com_` would be parsed as `_google.com`).

## Python2 Support

All versions of the IOC Finder package *before* version 2.x are compatible with python2.7 . **Beware: version 1.x of the IOC Finder package is no longer maintained.** This means that any bug fixes or improvements will **not** be back-ported to previous versions.

To install a specific version of the IOC Finder package (or any other one) via pip, use the following formula:

```
pip install ioc-finder==<VERSION NUMBER>
```

For example:

```
pip install ioc-finder==1.2.18
```

## Installation

To install this package:

```
pip install ioc-finder
```

## Usage

This package can be used in [python](#python) or via a [command-line interface](#command-line-interface).

### Python

The primary function in this package is the `ioc_finder.find_iocs()` function. A simple usage looks like:

```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']))
```

#### Inputs

You must pass some text into the `find_iocs()` function as string (the iocs will be parsed from this text). You can also provide the options detailed below.

##### Options

The `find_iocs` takes the following keywords (all of them default to `True`):

- `parse_domain_from_url` (default=True): Whether or not to parse domain names from URLs (e.g. `example.com` from `https://example.com/test`)
- `parse_from_url_path` (default=True): Whether or not to parse observables from URL paths (e.g. `2f3ec0e4998909bb0efab13c82d30708ca9f88679e42b75ef13ea0466951d862` from `https://www.virustotal.com/gui/file/2f3ec0e4998909bb0efab13c82d30708ca9f88679e42b75ef13ea0466951d862/detection`)
- `parse_domain_from_email_address` (default=True): Whether or not to parse domain names from email addresses (e.g. `example.com` from `foo@example.com`)
- `parse_address_from_cidr` (default=True): Whether or not to parse IP addresses from CIDR ranges (e.g. `0.0.0.1` from `0.0.0.1/24`)
- `parse_urls_without_scheme` (default=True): Whether or not to parse URLs without a scheme (see [https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Generic_syntax](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Generic_syntax)) (e.g. `hightower.space/projects`)
- `parse_imphashes` (default=True): Parse [import hashes](https://www.fireeye.com/blog/threat-research/2014/01/tracking-malware-import-hashing.html) (which look like md5s, but are preceded by 'imphash' or 'import hash')
- `parse_authentihashes` (default=True): Parse [authentihashes](http://msdn.microsoft.com/en-us/library/windows/hardware/gg463180.aspx) (which look like sha256s, but are preceded with 'authentihash')

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

#### Output

The `find_iocs()` returns a dictionary in the following structure:

```json
{
    "asns": [],
    "attack_mitigations": {
        "enterprise": [],
        "mobile": []
    },
    "attack_tactics": {
        "enterprise": [],
        "mobile": [],
        "pre_attack": []
    },
    "attack_techniques": {
        "enterprise": [],
        "mobile": [],
        "pre_attack": []
    },
    "authentihashes": [],
    "bitcoin_addresses": [],
    "cves": [],
    "domains": [],
    "email_addresses": [],
    "email_addresses_complete": [],
    "file_paths": [],
    "google_adsense_publisher_ids": [],
    "google_analytics_tracker_ids": [],
    "imphashes": [],
    "ipv4_cidrs": [],
    "ipv4s": [],
    "ipv6s": [],
    "mac_addresses": [],
    "md5s": [],
    "phone_numbers": [],
    "registry_key_paths": [],
    "sha1s": [],
    "sha256s": [],
    "sha512s": [],
    "ssdeeps": [],
    "tlp_labels": [],
    "urls": [],
    "user_agents": [],
    "xmpp_addresses": []
}

```

For example, running the example code shown at the start of the [usage](#usage) section above produces the following output:

```json
{
    "asns": [],
    "attack_mitigations": {
        "enterprise": [],
        "mobile": []
    },
    "attack_tactics": {
        "enterprise": [],
        "mobile": [],
        "pre_attack": []
    },
    "attack_techniques": {
        "enterprise": [],
        "mobile": [],
        "pre_attack": []
    },
    "authentihashes": [],
    "bitcoin_addresses": [],
    "cves": [],
    "domains": ["example.org", "example.com"],
    "email_addresses": [],
    "email_addresses_complete": [],
    "file_paths": [],
    "google_adsense_publisher_ids": [],
    "google_analytics_tracker_ids": [],
    "imphashes": [],
    "ipv4_cidrs": [],
    "ipv4s": [],
    "ipv6s": [],
    "mac_addresses": [],
    "md5s": [],
    "phone_numbers": [],
    "registry_key_paths": [],
    "sha1s": [],
    "sha256s": [],
    "sha512s": [],
    "ssdeeps": [],
    "tlp_labels": [],
    "urls": ["https://example.org/test/bingo.php"],
    "user_agents": [],
    "xmpp_addresses": []
}
```

##### Output Details

There are two grammars for email addresses. There is a fairly complete grammar to find email addresses matching the spec (which is very broad). Any of these complete email addresses (e.g. `foo"bar@gmail.com`) will be sent as output to in `email_addresses_complete` key.

Email addresses in the simple form we are familiar with (e.g. `bar@gmail.com`) will be sent as output in the `email_addresses` key.

### Command-Line Interface

The ioc-finder package can be used from a command line like:

```
ioc-finder "This is just an example.com https://example.org/test/bingo.php"
```

This will return:

```json
{
    "asns": [],
    "attack_mitigations": {
        "enterprise": [],
        "mobile": []
    },
    "attack_tactics": {
        "enterprise": [],
        "mobile": [],
        "pre_attack": []
    },
    "attack_techniques": {
        "enterprise": [],
        "mobile": [],
        "pre_attack": []
    },
    "authentihashes": [],
    "bitcoin_addresses": [],
    "cves": [],
    "domains": [
        "example.com",
        "example.org"
    ],
    "email_addresses": [],
    "email_addresses_complete": [],
    "file_paths": [],
    "google_adsense_publisher_ids": [],
    "google_analytics_tracker_ids": [],
    "imphashes": [],
    "ipv4_cidrs": [],
    "ipv4s": [],
    "ipv6s": [],
    "mac_addresses": [],
    "md5s": [],
    "phone_numbers": [],
    "registry_key_paths": [],
    "sha1s": [],
    "sha256s": [],
    "sha512s": [],
    "ssdeeps": [],
    "tlp_labels": [],
    "urls": [
        "https://example.org/test/bingo.php"
    ],
    "user_agents": [],
    "xmpp_addresses": []
}
```

Here are the usage instructions for the CLI:

```
Usage: ioc-finder [OPTIONS] TEXT

  CLI interface for parsing indicators of compromise.

Options:
  --no_url_domain_parsing         Using this flag will not parse domain names
                                  from URLs
  --no_email_addr_domain_parsing  Using this flag will not parse domain names
                                  from email addresses
  --no_cidr_address_parsing       Using this flag will not parse IP addresses
                                  from CIDR ranges
  --no_xmpp_addr_domain_parsing   Using this flag will not parse domain names
                                  from XMPP addresses
  --help                          Show this message and exit.
```

### Parsing Specific Indicator Types

If you need to parse a specific indicator type, you can do this using one of the parse functions that start with `parse_`. For example, the code below will parse URLs:

```python
from ioc_finder import parse_urls
results = parse_urls('https://google.com')
print(results)
```

**Warning:** It is recommended that you use the `ioc_finder.find_iocs` function rather than a parse function as `ioc_finder.find_iocs` handles some of the nuances of parsing indicator data. If you use specific functions, the text you provide will **not** be [fanged](https://ioc-fang.hightower.space/) and may not return the data you expect.

## Credits

This project uses the [ioc_fanger](https://github.com/ioc-fang/ioc_fanger) package to make sure that all indicators in the text are properly [fanged](https://ioc-fang.hightower.space/).

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).

### Other Helpful Projects

You may also be interested in [https://github.com/ioc-fang/ioc_fanger](https://github.com/ioc-fang/ioc_fanger), a project to fang and defang indicators of compromise. For example,

defanging:

```
example.com => example[.]com
https://example.com => hXXps://example[.]com
```

and fanging:

```
example[.]com => example.com
example(.)com => example.com
me AT example(.)com => me@example.com
```

### Similar Projects

There are a number of projects available to find Indicators of Compromise. Your mileage may vary with them. If there are things that another package can do that you would like to see in this package, [let me know](https://github.com/fhightower/ioc-finder/issues) (or [contact me](https://hightower.space/contact/)). Here are a few other ones:

- [https://github.com/InQuest/python-iocextract](https://github.com/InQuest/python-iocextract)
- [https://github.com/sroberts/cacador](https://github.com/sroberts/cacador)
- [https://github.com/armbues/ioc_parser](https://github.com/armbues/ioc_parser)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fhightower/ioc-finder",
    "name": "ioc-finder",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "iocs,indicators of compromise,parsing,finding,searching,threat intelligence,malware,threat hunting,observables,domains,domain names,asns,cidr,cidr ranges,ips,ip addresses,urls,email addresses,md5,sha1,sha256,google ads,cve,file paths",
    "author": "Floyd Hightower",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/27/0e/c35c840b90c31f7b12116e91046175238e42301173a90e94f2543c9f8c59/ioc_finder-4.0.1.tar.gz",
    "platform": "",
    "description": "# Observable Finder (Formerly named \"IOC Finder\")\n\n[![PyPi](https://img.shields.io/pypi/v/ioc_finder.svg)](https://pypi.python.org/pypi/ioc_finder)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/ioc-finder)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/4078c4e3e384431bbe69c35c7f6da7b7)](https://www.codacy.com/app/fhightower/ioc-finder)\n[![Build Status](https://travis-ci.org/fhightower/ioc-finder.svg?branch=master)](https://travis-ci.org/fhightower/ioc-finder)\n[![codecov](https://codecov.io/gh/fhightower/ioc-finder/branch/master/graph/badge.svg)](https://codecov.io/gh/fhightower/ioc-finder)\n[![live demo](https://img.shields.io/badge/live%20demo-%E2%86%92-green)](http://ioc-finder.hightower.space/)\n\nParse [indicators of compromise](https://searchsecurity.techtarget.com/definition/Indicators-of-Compromise-IOC) from text. You can test this project here: [http://ioc-finder.hightower.space/](http://ioc-finder.hightower.space/).\n\n## Capabilities\n\nCurrently, this package can the following items in a given text:\n\n- Autonomous System Numbers (ASNs) (in multiple formats such as `asn1234` and `as 1234`)\n- Bitcoin addresses (P2PKH, P2SH, and Bech32)\n- CIDR ranges (currently ipv4 ranges; ipv6 ranges coming soon)\n- CVEs (e.g. `CVE-2014-1234`)\n- Domain names (support for Unicode domain names (e.g. `\u0229xample.com`) is coming soon)\n- 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]`))\n- File hashes (md5, sha1, sha256, sha512, and [import hashes](https://www.fireeye.com/blog/threat-research/2014/01/tracking-malware-import-hashing.html), and [authentihashes](http://msdn.microsoft.com/en-us/library/windows/hardware/gg463180.aspx))\n- File paths (*beta*)\n- Google Adsense Publisher IDs\n- Google Analytics Tracker IDs\n- IP address (IPv4 and IPv6)\n- MAC addresses (*beta*)\n- Phone numbers (*beta*)\n- Registry key paths (e.g. `\"HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows`)\n- SSDeep hashes (*beta*)\n- URLs (URLs with and without schemes)\n- User agents (*beta*)\n- XMPP addresses (basically, this captures email addresses whose domain names contain \"jabber\" or \"xmpp\")\n- MITRE ATT&CK data (see [more info](https://attack.mitre.org/)):\n    - Pre-attack tactics and techniques (and [sub-techniques](https://medium.com/mitre-attack/attack-subs-what-you-need-to-know-99bce414ae0b))\n    - Enterprise mitigations, tactics, and techniques (and [sub-techniques](https://medium.com/mitre-attack/attack-subs-what-you-need-to-know-99bce414ae0b))\n    - Mobile mitigations, tactics, and techniques (and [sub-techniques](https://medium.com/mitre-attack/attack-subs-what-you-need-to-know-99bce414ae0b))\n- [TLP labels](https://www.us-cert.gov/tlp)\n- 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)!\n\nAlso provides some helpful features like:\n\n- Option to parse domain name from a URL\n- Option to parse domain name from an email address\n- Option to parse IP address from a CIDR range\n- Option to parse URLs without a scheme (e.g. without `https://`)\n- Option to parse [import hashes](https://www.fireeye.com/blog/threat-research/2014/01/tracking-malware-import-hashing.html) and [authentihashes](http://msdn.microsoft.com/en-us/library/windows/hardware/gg463180.aspx)\n\n## Known Limitations\n\n- When parsing **registry key paths**, this library will NOT properly parse a registry key path where the last section contains a space. For example, `<HKCU>\\software\\microsoft\\windows\\currentversion\\explorer\\advanced on` will be parsed as `<HKCU>\\software\\microsoft\\windows\\currentversion\\explorer\\advanced` (the space in the final section is removed).\n- The items listed above (in the \"Capabilities\" section) that are postceded by \"(*beta*)\" are not very robust and may still have major issues. Any feedback or issues related to these items are much appreciated.\n- When parsing **markdown**, if there is a domain name that is surrounded by underscores (which would make the domain name italic in some flavours of markdown - e.g. `_google.com_`), the domain will be parsed *including* the leading underscore (e.g. `_google.com_` would be parsed as `_google.com`).\n\n## Python2 Support\n\nAll versions of the IOC Finder package *before* version 2.x are compatible with python2.7 . **Beware: version 1.x of the IOC Finder package is no longer maintained.** This means that any bug fixes or improvements will **not** be back-ported to previous versions.\n\nTo install a specific version of the IOC Finder package (or any other one) via pip, use the following formula:\n\n```\npip install ioc-finder==<VERSION NUMBER>\n```\n\nFor example:\n\n```\npip install ioc-finder==1.2.18\n```\n\n## Installation\n\nTo install this package:\n\n```\npip install ioc-finder\n```\n\n## Usage\n\nThis package can be used in [python](#python) or via a [command-line interface](#command-line-interface).\n\n### Python\n\nThe primary function in this package is the `ioc_finder.find_iocs()` function. A simple usage looks like:\n\n```python\nfrom ioc_finder import find_iocs\ntext = \"This is just an example.com https://example.org/test/bingo.php\"\niocs = find_iocs(text)\nprint('Domains: {}'.format(iocs['domains']))\nprint('URLs: {}'.format(iocs['urls']))\n```\n\n#### Inputs\n\nYou must pass some text into the `find_iocs()` function as string (the iocs will be parsed from this text). You can also provide the options detailed below.\n\n##### Options\n\nThe `find_iocs` takes the following keywords (all of them default to `True`):\n\n- `parse_domain_from_url` (default=True): Whether or not to parse domain names from URLs (e.g. `example.com` from `https://example.com/test`)\n- `parse_from_url_path` (default=True): Whether or not to parse observables from URL paths (e.g. `2f3ec0e4998909bb0efab13c82d30708ca9f88679e42b75ef13ea0466951d862` from `https://www.virustotal.com/gui/file/2f3ec0e4998909bb0efab13c82d30708ca9f88679e42b75ef13ea0466951d862/detection`)\n- `parse_domain_from_email_address` (default=True): Whether or not to parse domain names from email addresses (e.g. `example.com` from `foo@example.com`)\n- `parse_address_from_cidr` (default=True): Whether or not to parse IP addresses from CIDR ranges (e.g. `0.0.0.1` from `0.0.0.1/24`)\n- `parse_urls_without_scheme` (default=True): Whether or not to parse URLs without a scheme (see [https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Generic_syntax](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Generic_syntax)) (e.g. `hightower.space/projects`)\n- `parse_imphashes` (default=True): Parse [import hashes](https://www.fireeye.com/blog/threat-research/2014/01/tracking-malware-import-hashing.html) (which look like md5s, but are preceded by 'imphash' or 'import hash')\n- `parse_authentihashes` (default=True): Parse [authentihashes](http://msdn.microsoft.com/en-us/library/windows/hardware/gg463180.aspx) (which look like sha256s, but are preceded with 'authentihash')\n\nSee [test_ioc_finder.py](https://github.com/fhightower/ioc-finder/blob/master/tests/test_ioc_finder.py) for more examples.\n\n#### Output\n\nThe `find_iocs()` returns a dictionary in the following structure:\n\n```json\n{\n    \"asns\": [],\n    \"attack_mitigations\": {\n        \"enterprise\": [],\n        \"mobile\": []\n    },\n    \"attack_tactics\": {\n        \"enterprise\": [],\n        \"mobile\": [],\n        \"pre_attack\": []\n    },\n    \"attack_techniques\": {\n        \"enterprise\": [],\n        \"mobile\": [],\n        \"pre_attack\": []\n    },\n    \"authentihashes\": [],\n    \"bitcoin_addresses\": [],\n    \"cves\": [],\n    \"domains\": [],\n    \"email_addresses\": [],\n    \"email_addresses_complete\": [],\n    \"file_paths\": [],\n    \"google_adsense_publisher_ids\": [],\n    \"google_analytics_tracker_ids\": [],\n    \"imphashes\": [],\n    \"ipv4_cidrs\": [],\n    \"ipv4s\": [],\n    \"ipv6s\": [],\n    \"mac_addresses\": [],\n    \"md5s\": [],\n    \"phone_numbers\": [],\n    \"registry_key_paths\": [],\n    \"sha1s\": [],\n    \"sha256s\": [],\n    \"sha512s\": [],\n    \"ssdeeps\": [],\n    \"tlp_labels\": [],\n    \"urls\": [],\n    \"user_agents\": [],\n    \"xmpp_addresses\": []\n}\n\n```\n\nFor example, running the example code shown at the start of the [usage](#usage) section above produces the following output:\n\n```json\n{\n    \"asns\": [],\n    \"attack_mitigations\": {\n        \"enterprise\": [],\n        \"mobile\": []\n    },\n    \"attack_tactics\": {\n        \"enterprise\": [],\n        \"mobile\": [],\n        \"pre_attack\": []\n    },\n    \"attack_techniques\": {\n        \"enterprise\": [],\n        \"mobile\": [],\n        \"pre_attack\": []\n    },\n    \"authentihashes\": [],\n    \"bitcoin_addresses\": [],\n    \"cves\": [],\n    \"domains\": [\"example.org\", \"example.com\"],\n    \"email_addresses\": [],\n    \"email_addresses_complete\": [],\n    \"file_paths\": [],\n    \"google_adsense_publisher_ids\": [],\n    \"google_analytics_tracker_ids\": [],\n    \"imphashes\": [],\n    \"ipv4_cidrs\": [],\n    \"ipv4s\": [],\n    \"ipv6s\": [],\n    \"mac_addresses\": [],\n    \"md5s\": [],\n    \"phone_numbers\": [],\n    \"registry_key_paths\": [],\n    \"sha1s\": [],\n    \"sha256s\": [],\n    \"sha512s\": [],\n    \"ssdeeps\": [],\n    \"tlp_labels\": [],\n    \"urls\": [\"https://example.org/test/bingo.php\"],\n    \"user_agents\": [],\n    \"xmpp_addresses\": []\n}\n```\n\n##### Output Details\n\nThere are two grammars for email addresses. There is a fairly complete grammar to find email addresses matching the spec (which is very broad). Any of these complete email addresses (e.g. `foo\"bar@gmail.com`) will be sent as output to in `email_addresses_complete` key.\n\nEmail addresses in the simple form we are familiar with (e.g. `bar@gmail.com`) will be sent as output in the `email_addresses` key.\n\n### Command-Line Interface\n\nThe ioc-finder package can be used from a command line like:\n\n```\nioc-finder \"This is just an example.com https://example.org/test/bingo.php\"\n```\n\nThis will return:\n\n```json\n{\n    \"asns\": [],\n    \"attack_mitigations\": {\n        \"enterprise\": [],\n        \"mobile\": []\n    },\n    \"attack_tactics\": {\n        \"enterprise\": [],\n        \"mobile\": [],\n        \"pre_attack\": []\n    },\n    \"attack_techniques\": {\n        \"enterprise\": [],\n        \"mobile\": [],\n        \"pre_attack\": []\n    },\n    \"authentihashes\": [],\n    \"bitcoin_addresses\": [],\n    \"cves\": [],\n    \"domains\": [\n        \"example.com\",\n        \"example.org\"\n    ],\n    \"email_addresses\": [],\n    \"email_addresses_complete\": [],\n    \"file_paths\": [],\n    \"google_adsense_publisher_ids\": [],\n    \"google_analytics_tracker_ids\": [],\n    \"imphashes\": [],\n    \"ipv4_cidrs\": [],\n    \"ipv4s\": [],\n    \"ipv6s\": [],\n    \"mac_addresses\": [],\n    \"md5s\": [],\n    \"phone_numbers\": [],\n    \"registry_key_paths\": [],\n    \"sha1s\": [],\n    \"sha256s\": [],\n    \"sha512s\": [],\n    \"ssdeeps\": [],\n    \"tlp_labels\": [],\n    \"urls\": [\n        \"https://example.org/test/bingo.php\"\n    ],\n    \"user_agents\": [],\n    \"xmpp_addresses\": []\n}\n```\n\nHere are the usage instructions for the CLI:\n\n```\nUsage: ioc-finder [OPTIONS] TEXT\n\n  CLI interface for parsing indicators of compromise.\n\nOptions:\n  --no_url_domain_parsing         Using this flag will not parse domain names\n                                  from URLs\n  --no_email_addr_domain_parsing  Using this flag will not parse domain names\n                                  from email addresses\n  --no_cidr_address_parsing       Using this flag will not parse IP addresses\n                                  from CIDR ranges\n  --no_xmpp_addr_domain_parsing   Using this flag will not parse domain names\n                                  from XMPP addresses\n  --help                          Show this message and exit.\n```\n\n### Parsing Specific Indicator Types\n\nIf you need to parse a specific indicator type, you can do this using one of the parse functions that start with `parse_`. For example, the code below will parse URLs:\n\n```python\nfrom ioc_finder import parse_urls\nresults = parse_urls('https://google.com')\nprint(results)\n```\n\n**Warning:** It is recommended that you use the `ioc_finder.find_iocs` function rather than a parse function as `ioc_finder.find_iocs` handles some of the nuances of parsing indicator data. If you use specific functions, the text you provide will **not** be [fanged](https://ioc-fang.hightower.space/) and may not return the data you expect.\n\n## Credits\n\nThis project uses the [ioc_fanger](https://github.com/ioc-fang/ioc_fanger) package to make sure that all indicators in the text are properly [fanged](https://ioc-fang.hightower.space/).\n\nThis 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.\n\nPrevious iterations of this package were inspired by [https://github.com/mosesschwartz/extract_iocs](https://github.com/mosesschwartz/extract_iocs).\n\n### Other Helpful Projects\n\nYou may also be interested in [https://github.com/ioc-fang/ioc_fanger](https://github.com/ioc-fang/ioc_fanger), a project to fang and defang indicators of compromise. For example,\n\ndefanging:\n\n```\nexample.com => example[.]com\nhttps://example.com => hXXps://example[.]com\n```\n\nand fanging:\n\n```\nexample[.]com => example.com\nexample(.)com => example.com\nme AT example(.)com => me@example.com\n```\n\n### Similar Projects\n\nThere are a number of projects available to find Indicators of Compromise. Your mileage may vary with them. If there are things that another package can do that you would like to see in this package, [let me know](https://github.com/fhightower/ioc-finder/issues) (or [contact me](https://hightower.space/contact/)). Here are a few other ones:\n\n- [https://github.com/InQuest/python-iocextract](https://github.com/InQuest/python-iocextract)\n- [https://github.com/sroberts/cacador](https://github.com/sroberts/cacador)\n- [https://github.com/armbues/ioc_parser](https://github.com/armbues/ioc_parser)\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python package for finding and parsing indicators of compromise from text.",
    "version": "4.0.1",
    "split_keywords": [
        "iocs",
        "indicators of compromise",
        "parsing",
        "finding",
        "searching",
        "threat intelligence",
        "malware",
        "threat hunting",
        "observables",
        "domains",
        "domain names",
        "asns",
        "cidr",
        "cidr ranges",
        "ips",
        "ip addresses",
        "urls",
        "email addresses",
        "md5",
        "sha1",
        "sha256",
        "google ads",
        "cve",
        "file paths"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "663734b614723c75437f052c635f6d9b",
                "sha256": "9a4dd3fab647696958eee1faef133f64c16ded9dd12d95a33286ddf0c8fae01e"
            },
            "downloads": -1,
            "filename": "ioc_finder-4.0.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "663734b614723c75437f052c635f6d9b",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 25464,
            "upload_time": "2020-09-11T21:23:42",
            "upload_time_iso_8601": "2020-09-11T21:23:42.131118Z",
            "url": "https://files.pythonhosted.org/packages/f0/c1/039c681b53bd74a3bcb0f9c8ea228c5a2b77609ef2fd8dec94170067a509/ioc_finder-4.0.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "a1914a3957944c05ff03d3b7482504b6",
                "sha256": "52e12123f949e4172b19f26c9f3aa1a3a9cfc383b548c6278969e9def9dbd787"
            },
            "downloads": -1,
            "filename": "ioc_finder-4.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a1914a3957944c05ff03d3b7482504b6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 50002,
            "upload_time": "2020-09-11T21:23:43",
            "upload_time_iso_8601": "2020-09-11T21:23:43.442890Z",
            "url": "https://files.pythonhosted.org/packages/27/0e/c35c840b90c31f7b12116e91046175238e42301173a90e94f2543c9f8c59/ioc_finder-4.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-09-11 21:23:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "fhightower",
    "error": "Could not fetch GitHub repository",
    "lcname": "ioc-finder"
}
        
Elapsed time: 0.14346s