Skip to content

Instantly share code, notes, and snippets.

@haam3r
Created May 21, 2019 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haam3r/e4f49fdd03eb83c3978d2083dfd2bc2a to your computer and use it in GitHub Desktop.
Save haam3r/e4f49fdd03eb83c3978d2083dfd2bc2a to your computer and use it in GitHub Desktop.
The Hive - run Responder via API
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