Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This script helps you download all sessions from tanner if your API is accesible from outside
"""
This is a small script that will help you download
all your data from snare tanner using tanner's API.
Always remember to deploy the API if the honeypot is
being deployed in the real world environment.
"""
import json
import requests
SNARE_UUID = "<your snare uuid>"
SESSIONS_URL = "http://<Tanner API IP AND PORT>/{snare_uuid}/sessions"
SESSION_URL = "http://<TANNER API IP AND PORT>/session/{session_uuid}"
def main():
"""Download all the snare/tanner sessions and store
them into a single json file
"""
sessions_data = []
req = requests.get(SESSIONS_URL.format(snare_uuid=SNARE_UUID)).json()
session_ids = req["response"]["message"]
for sess in session_ids:
resp = requests.get(SESSION_URL.format(session_uuid=sess)).json()
sessions_data.append(resp["response"]["message"])
name = "tanner_{}".format(SNARE_UUID)
with open(name, 'w') as f:
f.write(json.dumps(sessions_data))
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment