Created
May 21, 2019 07:25
-
-
Save haam3r/e4f49fdd03eb83c3978d2083dfd2bc2a to your computer and use it in GitHub Desktop.
The Hive - run Responder via API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def responder(objectId, objectType): | |
''' | |
Run responder via API | |
''' | |
post_data = { | |
'objectId': objectId, | |
'objectType': objectType, | |
'responderId': cfg['responderIds']['<responder_name>'] | |
} | |
response = requests.post( | |
'{0}://{1}/api/connector/cortex/action'.format(cfg['hive']['proto'], | |
cfg['hive']['host']), | |
json=post_data, | |
headers={'Authorization': 'Bearer {0}'.format(cfg['hive']['token'])} | |
) | |
if response.status_code != 200: | |
logging.error('Could not run responder: {0}'.format(response.text)) | |
else: | |
logging.info('Responder fired') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment