Auth parameters updated

pull/3/head
Alexandre Dulaunoy 2015-11-06 11:22:38 +01:00
parent 4c0ed124f5
commit 55ca454b92
1 changed files with 3 additions and 9 deletions

View File

@ -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):