Skip to content

Instantly share code, notes, and snippets.

@chrisdoman
Created December 26, 2017 14:59
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 chrisdoman/f9ef7c95c8fafc3255890f0cd1f1473e to your computer and use it in GitHub Desktop.
Save chrisdoman/f9ef7c95c8fafc3255890f0cd1f1473e to your computer and use it in GitHub Desktop.
Get stats on bitly urls
# Script to enumerate bit.ly data - suffers from strict rate limits
import requests, base62
#start = "1dstjX5"
start = 93340621247
def getUrl(url):
try:
r = requests.get(url)
html = r.text
if '"long_url": "' in html:
html = html.split('"long_url": "')[1]
html = html.split('"')[0]
return html
return ''
except Exception as ex:
return 'Error'
# Go through all bit.ly urls from the known malicious one printing output
x = start - 1000
while True:
url = "http://bit.ly/" + base62.encode(x) + "+"
print url + "," + getUrl(url)
x = x + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment