Sinisterly
sunjester's username checker for social media - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Coding (https://sinister.li/Forum-Coding--71)
+--- Thread: sunjester's username checker for social media (/Thread-sunjester-s-username-checker-for-social-media)



sunjester's username checker for social media - sunjester - 01-11-2019

https://github.com/therealsunjester/userchecker

Introduction
There was a post about "sherlock" a python script for checking usernames on social media websites. They didn't want to fix their code and support my version of python, they suggested an upgrade. So I coded my own that uses NO DEPENDENCIES. I used bash 4.3, you can check your version using the bash --version command, as seen below (my version).

Code:
(xenial)root@localhost:~/Downloads# bash --version GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Adding Sites
To add your own social media site, add it to the already existing array in the script. The script will add the username from the argument to the link, do not add a trailing slash or the script may not get the right URL to check. For example, for Github, the link is https://github.com since github usernames are added to the base URL, like this, https://github.com/therealsunjester.

Code:
#!/bin/bash #sunjester echo "checking for username: "$@ RED=`tput setaf 1` GRN=`tput setaf 2` RST=`tput sgr0` sites=( "https://www.facebook.com" "https://www.instagram.com" "https://www.twitter.com" "https://www.youtube.com/user" "https://www.reddit.com/user" ) for site in "${sites[@]}" do res=$(curl -Is $site"/"$@"/" >social;head -n1 social) code=`echo $res|cut -d' ' -f2` case $code in 200) echo $GRN $site"/"$@"/" $RST ;; 404) echo $RED $site"/"$@"/" $RST ;; 301) echo $GRN $site"/"$@"/" $RST ;; 405) echo $RED $site"/"$@"/" $RST ;; esac done rm social

Example Usage
[Image: L8hs25m.gif]


RE: sunjester's username checker for social media - sunjester - 02-05-2019

added a video/image demo for clarification


RE: sunjester's username checker for social media - Cyb3rNuX - 02-16-2019

What if website returns 200 even though account is not found? That is possible too Smile


RE: sunjester's username checker for social media - sunjester - 02-16-2019

(02-16-2019, 08:55 PM)Cyb3rNuX Wrote: What if website returns 200 even though account is not found? That is possible too Smile

yep it happens, do you know which sites? I can for sure look into them.


RE: sunjester's username checker for social media - Cyb3rNuX - 02-17-2019

(02-16-2019, 11:07 PM)sunjester Wrote:
(02-16-2019, 08:55 PM)Cyb3rNuX Wrote: What if website returns 200 even though account is not found? That is possible too Smile

yep it happens, do you know which sites? I can for sure look into them.

Not sure to be honest, you could also check for website's html if it contains text such as "user not found". I think it would work better that way, though it will be lot slower.


RE: sunjester's username checker for social media - sunjester - 02-17-2019

(02-17-2019, 12:51 AM)Cyb3rNuX Wrote:
(02-16-2019, 11:07 PM)sunjester Wrote:
(02-16-2019, 08:55 PM)Cyb3rNuX Wrote: What if website returns 200 even though account is not found? That is possible too Smile

yep it happens, do you know which sites? I can for sure look into them.

Not sure to be honest, you could also check for website's html if it contains text such as "user not found". I think it would work better that way, though it will be lot slower.

sometimes the sites dont have a "not found" message. thats why i went with the http response code. i forget which site made me use the 200 request


RE: sunjester's username checker for social media - Cyb3rNuX - 02-17-2019

(02-17-2019, 05:23 AM)sunjester Wrote: sometimes the sites dont have a "not found" message. thats why i went with the http response code. i forget which site made me use the 200 request

Try searching response's cookies, they should contain something that might help you.


RE: sunjester's username checker for social media - sunjester - 02-17-2019

(02-17-2019, 12:29 PM)Cyb3rNuX Wrote:
(02-17-2019, 05:23 AM)sunjester Wrote: sometimes the sites dont have a "not found" message. thats why i went with the http response code. i forget which site made me use the 200 request

Try searching response's cookies, they should contain something that might help you.

there wouldnt be anything in the cookie im sure but who knows