mirror of https://github.com/MISP/PyMISP
Auth parameters updated
parent
4c0ed124f5
commit
55ca454b92
|
@ -2,8 +2,7 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from pymisp import PyMISP
|
from pymisp import PyMISP
|
||||||
from keys import url_priv, key_priv
|
from keys import misp_url, misp_key
|
||||||
# from keys import url_cert, key_cert
|
|
||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
|
@ -15,11 +14,7 @@ def init(url, key):
|
||||||
|
|
||||||
def upload_files(m, eid, paths, distrib, ids, categ, info, analysis, threat):
|
def upload_files(m, eid, paths, distrib, ids, categ, info, analysis, threat):
|
||||||
out = m.upload_samplelist(paths, eid, distrib, ids, categ, info, analysis, threat)
|
out = m.upload_samplelist(paths, eid, distrib, ids, categ, info, analysis, threat)
|
||||||
if out.status_code == 200:
|
print(out)
|
||||||
print("Files uploaded sucessfully")
|
|
||||||
else:
|
|
||||||
print("Something failed: {}".format(out.text))
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description='Send malware sample to MISP.')
|
parser = argparse.ArgumentParser(description='Send malware sample to MISP.')
|
||||||
|
@ -33,8 +28,7 @@ if __name__ == '__main__':
|
||||||
parser.add_argument("-t", "--threat", type=int, help="The threat level ID of the newly created event, if applicatble. [0-3]")
|
parser.add_argument("-t", "--threat", type=int, help="The threat level ID of the newly created event, if applicatble. [0-3]")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
misp = init(url_priv, key_priv)
|
misp = init(misp_url, misp_key)
|
||||||
# misp = init(url_cert, key_cert)
|
|
||||||
|
|
||||||
files = []
|
files = []
|
||||||
if os.path.isfile(args.upload):
|
if os.path.isfile(args.upload):
|
||||||
|
|
Loading…
Reference in New Issue