Merge branch 'master' into master

pull/1/head
Shiju Leon 6 years ago committed by GitHub
commit 58dff89e5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

3
.gitignore vendored

@ -0,0 +1,3 @@
# Jupyter Notebook
.ipynb_checkpoints
*.ipynb

@ -22,7 +22,7 @@ $ pip3 install -r requirements.txt
## Usage ## Usage
Just run ```python3 sherlock.py``` Just run ```python3 sherlock.py```
All of the accounts found will be stored in a text file with their usename (e.g ```user123.txt```) All of the accounts found will be stored in a text file with their username (e.g ```user123.txt```)
## License ## License

@ -11,8 +11,7 @@
}, },
"Facebook": { "Facebook": {
"url": "https://www.facebook.com/{}", "url": "https://www.facebook.com/{}",
"errorType": "message", "errorType": "status_code"
"errorMsg": "not found"
}, },
"YouTube": { "YouTube": {
"url": "https://www.youtube.com/{}", "url": "https://www.youtube.com/{}",
@ -21,7 +20,8 @@
}, },
"Blogger": { "Blogger": {
"url": "https://{}.blogspot.com", "url": "https://{}.blogspot.com",
"errorType": "status_code" "errorType": "status_code",
"noPeriod": "True"
}, },
"Google Plus": { "Google Plus": {
"url": "https://plus.google.com/+{}", "url": "https://plus.google.com/+{}",
@ -35,12 +35,12 @@
"Pinterest": { "Pinterest": {
"url": "https://www.pinterest.com/{}", "url": "https://www.pinterest.com/{}",
"errorType": "response_url", "errorType": "response_url",
"errorMsgInUrl": "?show_error" "errorUrl": "https://www.pinterest.com/?show_error=true"
}, },
"GitHub": { "GitHub": {
"url": "https://www.github.com/{}", "url": "https://www.github.com/{}",
"errorType": "message", "errorType": "status_code",
"errorMsg": "404 Not Found" "noPeriod": "True"
}, },
"Steam": { "Steam": {
"url": "https://steamcommunity.com/id/{}", "url": "https://steamcommunity.com/id/{}",
@ -54,18 +54,11 @@
}, },
"SoundCloud": { "SoundCloud": {
"url": "https://soundcloud.com/{}", "url": "https://soundcloud.com/{}",
"errorType": "message", "errorType": "status_code"
"errorMsg": "404 Not Found"
},
"Tumblr": {
"url": "https://{}.tumblr.com",
"errorType": "message",
"errorMsg": " There's nothing here"
}, },
"Disqus": { "Disqus": {
"url": "https://disqus.com/{}", "url": "https://disqus.com/{}",
"errorType": "message", "errorType": "status_code"
"errorMsg": "404 NOT FOUND"
}, },
"Medium": { "Medium": {
"url": "https://medium.com/@{}", "url": "https://medium.com/@{}",
@ -73,7 +66,8 @@
}, },
"DeviantART": { "DeviantART": {
"url": "https://{}.deviantart.com", "url": "https://{}.deviantart.com",
"errorType": "status_code" "errorType": "status_code",
"noPeriod": "True"
}, },
"VK": { "VK": {
"url": "https://vk.com/{}", "url": "https://vk.com/{}",
@ -89,7 +83,8 @@
}, },
"Flipboard": { "Flipboard": {
"url": "https://flipboard.com/@{}", "url": "https://flipboard.com/@{}",
"errorType": "status_code" "errorType": "message",
"errorMsg": "loading"
}, },
"SlideShare": { "SlideShare": {
"url": "https://slideshare.net/{}", "url": "https://slideshare.net/{}",
@ -128,13 +123,12 @@
}, },
"Gravatar": { "Gravatar": {
"url": "http://en.gravatar.com/{}", "url": "http://en.gravatar.com/{}",
"errorType": "message", "errorType": "status_code"
"errorMsg": "Were sorry, we couldn't find that profile"
}, },
"iMGSRC.RU": { "iMGSRC.RU": {
"url": "https://imgsrc.ru/main/user.php?user={}", "url": "https://imgsrc.ru/main/user.php?user={}",
"errorType": "message", "errorType": "response_url",
"errorMsg": "Rapidly growing community of over a million users, dedicated to sharing." "errorUrl": "https://imgsrc.ru/"
}, },
"DailyMotion": { "DailyMotion": {
"url": "https://www.dailymotion.com/{}", "url": "https://www.dailymotion.com/{}",
@ -147,8 +141,7 @@
}, },
"CashMe": { "CashMe": {
"url": "https://cash.me/{}", "url": "https://cash.me/{}",
"errorType": "message", "errorType": "status_code"
"errorMsg": "Oh no"
}, },
"Behance": { "Behance": {
"url": "https://www.behance.net/{}", "url": "https://www.behance.net/{}",
@ -157,8 +150,7 @@
}, },
"GoodReads": { "GoodReads": {
"url": "https://www.goodreads.com/{}", "url": "https://www.goodreads.com/{}",
"errorType": "message", "errorType": "status_code"
"errorMsg": "Sorry you lost your way."
}, },
"Instructables": { "Instructables": {
"url": "https://www.instructables.com/member/{}", "url": "https://www.instructables.com/member/{}",
@ -167,23 +159,23 @@
}, },
"Keybase": { "Keybase": {
"url": "https://keybase.io/{}", "url": "https://keybase.io/{}",
"errorType": "message", "errorType": "status_code"
"errorMsg": "Sorry, what you are looking for...it does not exist."
}, },
"Kongregate": { "Kongregate": {
"url": "https://www.kongregate.com/accounts/{}", "url": "https://www.kongregate.com/accounts/{}",
"errorType": "message", "errorType": "message",
"errorMsg": "Sorry, no account with that name was found." "errorMsg": "Sorry, no account with that name was found.",
"noPeriod": "True"
}, },
"LiveJournal": { "LiveJournal": {
"url": "https://{}.livejournal.com", "url": "https://{}.livejournal.com",
"errorType": "message", "errorType": "message",
"errorMsg": "Unknown Journal" "errorMsg": "Unknown Journal",
"noPeriod": "True"
}, },
"VSCO": { "VSCO": {
"url": "https://vsco.co/{}", "url": "https://vsco.co/{}",
"errorType": "message", "errorType": "status_code"
"errorMsg": "This page does not exist"
}, },
"AngelList": { "AngelList": {
"url": "https://angel.co/{}", "url": "https://angel.co/{}",
@ -198,7 +190,8 @@
"Dribbble": { "Dribbble": {
"url": "https://dribbble.com/{}", "url": "https://dribbble.com/{}",
"errorType": "message", "errorType": "message",
"errorMsg": "Whoops, that page is gone." "errorMsg": "Whoops, that page is gone.",
"noPeriod": "True"
}, },
"Codecademy": { "Codecademy": {
"url": "https://www.codecademy.com/{}", "url": "https://www.codecademy.com/{}",
@ -208,12 +201,11 @@
"Pastebin": { "Pastebin": {
"url": "https://pastebin.com/u/{}", "url": "https://pastebin.com/u/{}",
"errorType": "response_url", "errorType": "response_url",
"errorMsgInUrl": "index" "errorUrl": "https://pastebin.com/index"
}, },
"Foursquare": { "Foursquare": {
"url": "https://foursquare.com/{}", "url": "https://foursquare.com/{}",
"errorType": "message", "errorType": "status_code"
"errorMsg": "We couldn't find the page you're looking for."
}, },
"Gumroad": { "Gumroad": {
"url": "https://www.gumroad.com/{}", "url": "https://www.gumroad.com/{}",
@ -222,8 +214,8 @@
}, },
"Newgrounds": { "Newgrounds": {
"url": "https://{}.newgrounds.com", "url": "https://{}.newgrounds.com",
"errorType": "message", "errorType": "status_code",
"errorMsg": "ERROR — No user" "noPeriod": "True"
}, },
"Wattpad": { "Wattpad": {
"url": "https://www.wattpad.com/user/{}", "url": "https://www.wattpad.com/user/{}",
@ -258,12 +250,8 @@
"Contently": { "Contently": {
"url": "https://{}.contently.com/", "url": "https://{}.contently.com/",
"errorType": "message", "errorType": "message",
"errorMsg": "We can't find that page!" "errorMsg": "We can't find that page!",
}, "noPeriod": "True"
"Houzz": {
"url": "https://houzz.com/user/{}",
"errorType": "message",
"errorMsg": "The page you requested was not found."
}, },
"Houzz": { "Houzz": {
"url": "https://houzz.com/user/{}", "url": "https://houzz.com/user/{}",
@ -273,7 +261,7 @@
"BLIP.fm": { "BLIP.fm": {
"url": "https://blip.fm/{}", "url": "https://blip.fm/{}",
"errorType": "message", "errorType": "message",
"errorMsg": "404 Page Not Found" "errorMsg": "Page Not Found"
}, },
"HackerNews": { "HackerNews": {
"url": "https://news.ycombinator.com/user?id={}", "url": "https://news.ycombinator.com/user?id={}",
@ -317,8 +305,8 @@
}, },
"Slack": { "Slack": {
"url": "https://{}.slack.com", "url": "https://{}.slack.com",
"errorType": "message", "errorType": "status_code",
"errorMsg": "Theres been a glitch…" "noPeriod": "True"
}, },
"Trip": { "Trip": {
"url": "https://www.trip.skyscanner.com/user/{}", "url": "https://www.trip.skyscanner.com/user/{}",
@ -347,18 +335,17 @@
}, },
"Flickr": { "Flickr": {
"url": "https://www.flickr.com/people/{}", "url": "https://www.flickr.com/people/{}",
"errorType": "message", "errorType": "status_code"
"errorMsg": "This is not the page youre looking for"
}, },
"WordPress": { "WordPress": {
"url": "https://{}.wordpress.com", "url": "https://{}.wordpress.com",
"errorType": "message", "errorType": "response_url",
"errorMsg": "Do you want to register" "errorUrl": "wordpress.com/typo/?subdomain=",
"noPeriod": "True"
}, },
"Unsplash": { "Unsplash": {
"url": "https://unsplash.com/@{}", "url": "https://unsplash.com/@{}",
"errorType": "message", "errorType": "status_code"
"errorMsg": "Hm, the page you were looking for doesn't seem to exist anymore"
}, },
"Pexels": { "Pexels": {
"url": "https://www.pexels.com/@{}", "url": "https://www.pexels.com/@{}",

@ -6,6 +6,8 @@ import argparse
DEBUG = False DEBUG = False
# TODO: fix tumblr
def write_to_file(url, fname): def write_to_file(url, fname):
with open(fname, "a") as f: with open(fname, "a") as f:
f.write(url+"\n") f.write(url+"\n")
@ -39,8 +41,8 @@ def make_request(url, headers, error_type, social_network):
def sherlock(username): def sherlock(username):
# Not sure why, but the banner messes up if i put into one print function # Not sure why, but the banner messes up if i put into one print function
print(" .\"\"\"-.") print("\033[37;1m .\"\"\"-.")
print(" / \\") print("\033[37;1m / \\")
print("\033[37;1m ____ _ _ _ | _..--'-.") print("\033[37;1m ____ _ _ _ | _..--'-.")
print("\033[37;1m/ ___|| |__ ___ _ __| | ___ ___| |__ >.`__.-\"\"\;\"`") print("\033[37;1m/ ___|| |__ ___ _ __| | ___ ___| |__ >.`__.-\"\"\;\"`")
print("\033[37;1m\___ \| '_ \ / _ \ '__| |/ _ \ / __| |/ / / /( ^\\") print("\033[37;1m\___ \| '_ \ / _ \ '__| |/ _ \ / __| |/ / / /( ^\\")
@ -58,7 +60,7 @@ def sherlock(username):
print("\033[1;92m[\033[0m\033[1;77m*\033[0m\033[1;92m] Removing previous file:\033[1;37m {}\033[0m".format(fname)) print("\033[1;92m[\033[0m\033[1;77m*\033[0m\033[1;92m] Removing previous file:\033[1;37m {}\033[0m".format(fname))
print("\033[1;92m[\033[0m\033[1;77m*\033[0m\033[1;92m] Checking username\033[0m\033[1;37m {}\033[0m\033[1;92m on: \033[0m".format(username)) print("\033[1;92m[\033[0m\033[1;77m*\033[0m\033[1;92m] Checking username\033[0m\033[1;37m {}\033[0m\033[1;92m on: \033[0m".format(username))
raw = open("data.json", "r") raw = open("data.json", "r", encoding="utf-8")
data = json.load(raw) data = json.load(raw)
# User agent is needed because some sites does not # User agent is needed because some sites does not
@ -71,12 +73,17 @@ def sherlock(username):
for social_network in data: for social_network in data:
url = data.get(social_network).get("url").format(username) url = data.get(social_network).get("url").format(username)
error_type = data.get(social_network).get("errorType") error_type = data.get(social_network).get("errorType")
cant_have_period = data.get(social_network).get("noPeriod")
if cant_have_period == "True":
print("\033[37;1m[\033[91;1m-\033[37;1m]\033[92;1m {}:\033[93;1m Not Found!".format(social_network))
continue
r, error_type = make_request(url=url, headers=headers, error_type=error_type, social_network=social_network) r, error_type = make_request(url=url, headers=headers, error_type=error_type, social_network=social_network)
if error_type == "message": if error_type == "message":
error = data.get(social_network).get("errorMsg") error = data.get(social_network).get("errorMsg")
# Checks if the error message is in the HTML
if not error in r.text: if not error in r.text:
print("\033[37;1m[\033[92;1m+\033[37;1m]\033[92;1m {}:\033[0m".format(social_network), url) print("\033[37;1m[\033[92;1m+\033[37;1m]\033[92;1m {}:\033[0m".format(social_network), url)
write_to_file(url, fname) write_to_file(url, fname)
@ -85,7 +92,7 @@ def sherlock(username):
print("\033[37;1m[\033[91;1m-\033[37;1m]\033[92;1m {}:\033[93;1m Not Found!".format(social_network)) print("\033[37;1m[\033[91;1m-\033[37;1m]\033[92;1m {}:\033[93;1m Not Found!".format(social_network))
elif error_type == "status_code": elif error_type == "status_code":
# Checks if the status code of the repsonse is 404
if not r.status_code == 404: if not r.status_code == 404:
print("\033[37;1m[\033[92;1m+\033[37;1m]\033[92;1m {}:\033[0m".format(social_network), url) print("\033[37;1m[\033[92;1m+\033[37;1m]\033[92;1m {}:\033[0m".format(social_network), url)
write_to_file(url, fname) write_to_file(url, fname)
@ -94,8 +101,8 @@ def sherlock(username):
print("\033[37;1m[\033[91;1m-\033[37;1m]\033[92;1m {}:\033[93;1m Not Found!".format(social_network)) print("\033[37;1m[\033[91;1m-\033[37;1m]\033[92;1m {}:\033[93;1m Not Found!".format(social_network))
elif error_type == "response_url": elif error_type == "response_url":
error = data.get(social_network).get("errorMsgInUrl") error = data.get(social_network).get("errorUrl")
# Checks if the redirect url is the same as the one defined in data.json
if not error in r.url: if not error in r.url:
print("\033[37;1m[\033[92;1m+\033[37;1m]\033[92;1m {}:\033[0m".format(social_network), url) print("\033[37;1m[\033[92;1m+\033[37;1m]\033[92;1m {}:\033[0m".format(social_network), url)
write_to_file(url, fname) write_to_file(url, fname)
@ -107,7 +114,6 @@ def sherlock(username):
print("\033[1;92m[\033[0m\033[1;77m*\033[0m\033[1;92m] Saved: \033[37;1m{}\033[0m".format(username+".txt")) print("\033[1;92m[\033[0m\033[1;77m*\033[0m\033[1;92m] Saved: \033[37;1m{}\033[0m".format(username+".txt"))
class ArgumentParserError(Exception): pass class ArgumentParserError(Exception): pass
class ArgumentParser(argparse.ArgumentParser): class ArgumentParser(argparse.ArgumentParser):

Loading…
Cancel
Save