Git Product home page Git Product logo

e2's People

Contributors

weslambert avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

e2's Issues

The hive problem..

Hello Wes,

I have some issues with extracting data from security onion to thehive. I am using your script with the configuration files, but nothing happens. There is connectivity between the onion and the hive and with a post request (the hive api) I can create a case. So probably the problem is the script, in my opinion. I am trying to execute it with data input by me and there aren't any errors. Still, no case is created.
TheHive version - 3.1.0
This is how I am testing it:
python e2hive_case.py "-t" "sometitle", "-d" "somedescription", "-s" "2" from cli in my security onion. I tried it from another test machine, still nothing and no error reported.
This is the script e2hive_case.py, not modified:

#!/usr/bin/python
# Modified from script by Keith Taylor, found here:
# http://informationonsecurity.blogspot.com/2015/10/automating-forensic-artifact-collection.html
import json, urllib2, base64, requests
import requests
import argparse
import sys
from ConfigParser import SafeConfigParser

parser = SafeConfigParser()
parser.read('/etc/elastalert/rules/e2hive.conf')

url = parser.get('config', 'url')
apikey = parser.get('config', 'apikey')

sys.stdout = open('/tmp/e2hive.log', 'w')

parser = argparse.ArgumentParser(description='Post a case to the Hive')
parser.add_argument('-t','--title', help='Title',required=True)
parser.add_argument('-d','--description',help='Description', required=True)
parser.add_argument('-s','--severity',help='Severity', required=False)
args = parser.parse_args()

title = args.title
description = args.description
severity = args.severity

authheader =  "Bearer" + apikey
headers = {
    "Authorization": authheader,
    "Content-Type": "application/json"
}

data = {
  "title": title,
  "description": description,
  "severity": int(severity)
}

response = requests.post(url + "/api/case",
                          headers=headers, data=json.dumps(data)
                        )
print response.content

Here is the conf file e2hive.conf:

[config]
url = AddressOfHivePlusPort
apikey = SomeKey

The apikey works with a normal request, like:

curl -XPOST -H 'Authorization: Bearer SomeKey' -H 'Content-Type: application/json' AddressOfHivePlusPort/api/case -d '{
"title": "My first case",
  "description": "This case has been created by my custom script"
}'

The files are in same directory.. Maybe it's because of the new version of TheHive or something else. I don't know..
I am not sure where to open such a request, but I hope you will see it and advice me.
Thanks in advance,
Antony

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.