2016-07-01 10:33:44 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2018-12-26 18:27:48 +01:00
|
|
|
from pymisp import ExpandedPyMISP
|
|
|
|
try:
|
|
|
|
from keys import url, key
|
2020-01-13 11:51:54 +01:00
|
|
|
verifycert = False
|
2018-12-26 18:27:48 +01:00
|
|
|
except ImportError:
|
2020-01-13 11:39:20 +01:00
|
|
|
url = 'https://localhost:8443'
|
|
|
|
key = 'd6OmdDFvU3Seau3UjwvHS1y3tFQbaRNhJhDX0tjh'
|
|
|
|
verifycert = False
|
2016-07-01 10:33:44 +02:00
|
|
|
import argparse
|
|
|
|
import tools
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
parser = argparse.ArgumentParser(description='Create a given number of event containing a given number of attributes eachh.')
|
|
|
|
parser.add_argument("-l", "--limit", type=int, help="Number of events to create (default 1)")
|
|
|
|
parser.add_argument("-a", "--attribute", type=int, help="Number of attributes per event (default 3000)")
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
2020-01-13 11:39:20 +01:00
|
|
|
misp = ExpandedPyMISP(url, key, verifycert)
|
2019-07-22 12:32:03 +02:00
|
|
|
misp.toggle_global_pythonify()
|
2016-07-01 10:33:44 +02:00
|
|
|
|
|
|
|
if args.limit is None:
|
|
|
|
args.limit = 1
|
|
|
|
if args.attribute is None:
|
|
|
|
args.attribute = 3000
|
|
|
|
|
|
|
|
for i in range(args.limit):
|
|
|
|
tools.create_massive_dummy_events(misp, args.attribute)
|