Skip to content

Instantly share code, notes, and snippets.

@garanews
garanews / application.conf
Created August 20, 2020 11:49
docker compose for the hive 4
play.http.secret.key="Trvq8ZofCgSUvWBbQ4TFEaAtMQr7M3hks"
## For test only !
db.janusgraph {
storage.backend: berkeleyje
storage.directory: /data/
berkeleyje.freeDisk: 200
}
storage {
### Keybase proof
I hereby claim:
* I am garanews on github.
* I am garanews (https://keybase.io/garanews) on keybase.
* I have a public key ASAP3yAa19L9fdl450FsfPY4gXi-acbEzV4u4Ilcl25zwwo
@garanews
garanews / thehive_webhook_email_alert.py
Created May 21, 2020 08:18
The Hive webhook email alert
from flask import Flask, request
from flask_mail import Mail
import json
from flask_mail import Message
app = Flask(__name__)
app.config['MAIL_SERVER'] = "1.2.3.4"
app.config['MAIL_PORT'] = "25"
app.config['MAIL_USE_TLS'] = ""
app.config['MAIL_USE_SSL'] = ""
@garanews
garanews / dask_cupy_kern.py
Last active July 1, 2019 10:53
attempt to use dask and cupy with rawkernel to compute ruzicka similarity between a vector and a matrix
import time
import dask.array as da
import dask.dataframe as dd
import numpy as np
from dask.distributed import Client
from dask_cuda import LocalCUDACluster
import cupy as cp
ruzicka_kernel = cp.RawKernel(r'''
extern "C" __global__
import asyncio
import asyncpg
import cupy as cp
import numpy as np
from dask import dataframe as dd
from dask.distributed import Client
from dask_cuda import LocalCUDACluster
import time
async def read_async():
@garanews
garanews / test_load3.py
Created May 21, 2019 16:17
test_load3.py
import os
import hashlib
import glob
import magic
import peutils
import pefile
import sys
import tqdm
import dask
import pandas as pd
@garanews
garanews / analyzers_features_matrix.py
Last active March 4, 2019 07:55
Generate table with matrix of all features of all cortex analyzers
import json
from glob import glob
import pandas as pd
list_json = glob('**/*.json')
all = []
for jj in list_json:
command = jj.split("/")[-2]
@garanews
garanews / cuckoosandbox_analyzer.py
Created April 21, 2017 15:31
cuckoo cortex analyzer
#!/usr/bin/env python
# encoding: utf-8
from cortexutils.analyzer import Analyzer
import requests
import time
class CuckooSandboxAnalyzer(Analyzer):