Skip to content

Instantly share code, notes, and snippets.

@takeshixx
Created January 30, 2014 23:51
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 takeshixx/8722655 to your computer and use it in GitHub Desktop.
Save takeshixx/8722655 to your computer and use it in GitHub Desktop.
Small leakdb script for a $SHELL alias
#!/usr/bin/env python2
import sys,requests
DEBUG = False
try:
lines = sys.stdin.read().split('\n')
for h in lines:
if not h: continue
r = requests.get('https://api.leakdb.net/?j={}'.format(h)).json()
if r['found'] == 'true':
func = r['hashes'][0].keys()[r['hashes'][0].values().index(h)]
print '{}({}) = {}'.format(func,r['hashes'][0]['plaintext'],h)
else:
raise Exception('not found')
except Exception as e:
if DEBUG: print str(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment