<commit_before># Iocparser

iocparser is a command line utility to parse and query Mandiant XML Indicator of Compromise (IOC) files. 

## Installation

Download and unzip the master zip from github and execute the following into the iocparser directory

    $ gem build ./iocparser.gemspec
    # gem install iocparser-0.0.1.gem

Or install it yourself as:

    $ gem install iocparser

## Usage

Print the structure of the IOC file with the number of items embedded into it
    $ iocparser -f test.ioc
      +++ IOC Items +++
      Network => 3 
      PortItem => 2 
      UrlHistoryItem => 3 
      FileItem => 246 
      ProcessItem => 2 
      +++ END +++

Print the type of an IOC item

    $ iocparser -f test.ioc -t Network<commit_msg>README fix<commit_after># Iocparser

iocparser is a command line utility to parse and query Mandiant XML Indicator of Compromise (IOC) files. 

## Installation

Download and unzip the master zip from github and execute the following into the iocparser directory

    $ gem build ./iocparser.gemspec
    # gem install iocparser-0.0.1.gem

Or install it yourself as:

    $ gem install iocparser

## Usage

Print the structure of the IOC file with the number of items embedded into it

    $ iocparser -f test.ioc
      +++ IOC Items +++
      Network => 3 
      PortItem => 2 
      UrlHistoryItem => 3 
      FileItem => 246 
      ProcessItem => 2 
      +++ END +++

Print the type of an IOC item

    $ iocparser -f test.ioc -t Network
{'fraction_non_alphanumeric': 0.06891891891891892, 'fraction_numerical': 0.013513513513513514, 'mean_word_length': 2.674937965260546, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7107147', 'n_tokens_mistral': 466, 'n_tokens_neox': 434, 'n_words': 188}