Created
December 26, 2017 14:59
-
-
Save chrisdoman/f9ef7c95c8fafc3255890f0cd1f1473e to your computer and use it in GitHub Desktop.
Get stats on bitly urls
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
# 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