mirror of https://github.com/MISP/PyMISP
commit
4974a4dd62
|
@ -13,11 +13,12 @@ def init(url, key):
|
|||
|
||||
result = m.get_event(event)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='Get an event from a MISP instance.')
|
||||
parser.add_argument("-e", "--event", required=True, help="Event ID to get.")
|
||||
parser.add_argument("-a", "--attribute", help="Attribute ID to modify. A little dirty for now, argument need to be included in event")
|
||||
parser.add_argument("-t", "--tag", required=True, type=int, help="Attribute ID to modify.")
|
||||
parser.add_argument("-t", "--tag", required=True, type=int, help="Tag ID.")
|
||||
parser.add_argument("-m", "--modify_attribute", action='store_true', help="If set, the tag will be add to the attribute, otherwise to the event.")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
|
|
@ -12,12 +12,13 @@ def init(url, key):
|
|||
|
||||
result = m.get_event(event)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description='Tag something.')
|
||||
parser.add_argument("-u", "--uuid", help="UUID to tag.")
|
||||
parser.add_argument("-e", "--event", help="Event ID to tag.")
|
||||
parser.add_argument("-a", "--attribute", help="Attribute ID to tag")
|
||||
parser.add_argument("-t", "--tag", required=True, help="Attribute ID to modify.")
|
||||
parser.add_argument("-t", "--tag", required=True, help="Tag ID.")
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.event and not args.uuid and not args.attribute:
|
||||
|
@ -26,8 +27,6 @@ if __name__ == '__main__':
|
|||
|
||||
misp = init(misp_url, misp_key)
|
||||
|
||||
event = misp.get_event(args.event)
|
||||
|
||||
if args.event and not args.attribute:
|
||||
result = misp.search(eventid=args.event)
|
||||
data = result['response']
|
||||
|
@ -48,5 +47,5 @@ if __name__ == '__main__':
|
|||
if args.uuid:
|
||||
uuid = args.uuid
|
||||
|
||||
print("UUID tagged: %s"%uuid)
|
||||
print("UUID tagged: %s" % uuid)
|
||||
misp.tag(uuid, args.tag)
|
||||
|
|
Loading…
Reference in New Issue