Coder Social home page Coder Social logo

pycrits's Introduction

pycrits

Python interface to the CRITs API.

This is currently very minimal. Fetching data is pretty stable but the API for submitting data to CRITs is still alpha.

I'll write docs once things become stable, but for now here is some basic usage:

You will need the Requests Python module to use this.

from pycrits import pycrits

crits = pycrits('http://localhost:8000', 'wxs', '<api_key>')
for obj in crits.indicators():
    print(obj['value']) 

Here's an example of how to fetch a PCAP. If nothing is found you will get an empty list back. These are all fetching the same file.

>>> from pycrits import pycrits
>>> crits = pycrits('http://localhost:8000', 'wxs', '<api_key>')
>>> x = crits.fetch_pcap(md5='67cc75e608b4f37ed993bf84fafafb9d')
>>> print(len(x[0]['data'])) 
22279
>>> x = crits.fetch_pcap(id_='51ac0abcd6fa25ca9d2d277f')
>>> print(len(x[0]['data'])) 
22279
>>> x = crits.fetch_pcap(params={'c-filename': 'sedtest.pcap'})
>>> print(len(x[0]['data'])) 
22279
>>>

Here's an example of using sample_count() to get a count of number of samples that are over 1MB in size:

from pycrits import pycrits
crits = pycrits('http://localhost:8000', 'wxs', '<api_key>')
params = {'c-size__gte': 1024 * 1024}
print(crits.sample_count(params=params)) 

pycrits's People

Contributors

wxsbsd avatar apolkosnik-old avatar mgoffin avatar wick2o avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.