removed option to present websites ordered by their Alexa.com global rank in popularity

refer to #610 for reason of removal
pull/704/head
Siddharth Dushantha 4 years ago
parent 73989aaf5f
commit cc8192f45c

@ -56,14 +56,12 @@ $ python3 -m pip install -r requirements.txt
```bash ```bash
$ python3 sherlock --help $ python3 sherlock --help
usage: sherlock [-h] [--version] [--verbose] [--rank] usage: sherlock [-h] [--version] [--verbose] [--folderoutput FOLDEROUTPUT] [--output OUTPUT]
[--folderoutput FOLDEROUTPUT] [--output OUTPUT] [--tor] [--tor] [--unique-tor] [--csv] [--site SITE_NAME] [--proxy PROXY_URL]
[--unique-tor] [--csv] [--site SITE_NAME] [--proxy PROXY_URL] [--json JSON_FILE] [--timeout TIMEOUT] [--print-found] [--no-color] [--browse]
[--json JSON_FILE] [--timeout TIMEOUT] [--print-found]
[--no-color] [--browse]
USERNAMES [USERNAMES ...] USERNAMES [USERNAMES ...]
Sherlock: Find Usernames Across Social Networks (Version 0.12.2) Sherlock: Find Usernames Across Social Networks (Version 0.12.3)
positional arguments: positional arguments:
USERNAMES One or more usernames to check with social networks. USERNAMES One or more usernames to check with social networks.
@ -73,33 +71,26 @@ optional arguments:
--version Display version information and dependencies. --version Display version information and dependencies.
--verbose, -v, -d, --debug --verbose, -v, -d, --debug
Display extra debugging information and metrics. Display extra debugging information and metrics.
--rank, -r Present websites ordered by their Alexa.com global
rank in popularity.
--folderoutput FOLDEROUTPUT, -fo FOLDEROUTPUT --folderoutput FOLDEROUTPUT, -fo FOLDEROUTPUT
If using multiple usernames, the output of the results If using multiple usernames, the output of the results will be saved to
will be saved to this folder. this folder.
--output OUTPUT, -o OUTPUT --output OUTPUT, -o OUTPUT
If using single username, the output of the result If using single username, the output of the result will be saved to this
will be saved to this file. file.
--tor, -t Make requests over Tor; increases runtime; requires --tor, -t Make requests over Tor; increases runtime; requires Tor to be installed and
Tor to be installed and in system path. in system path.
--unique-tor, -u Make requests over Tor with new Tor circuit after each --unique-tor, -u Make requests over Tor with new Tor circuit after each request; increases
request; increases runtime; requires Tor to be runtime; requires Tor to be installed and in system path.
installed and in system path.
--csv Create Comma-Separated Values (CSV) File. --csv Create Comma-Separated Values (CSV) File.
--site SITE_NAME Limit analysis to just the listed sites. Add multiple --site SITE_NAME Limit analysis to just the listed sites. Add multiple options to specify
options to specify more than one site. more than one site.
--proxy PROXY_URL, -p PROXY_URL --proxy PROXY_URL, -p PROXY_URL
Make requests over a proxy. e.g. Make requests over a proxy. e.g. socks5://127.0.0.1:1080
socks5://127.0.0.1:1080
--json JSON_FILE, -j JSON_FILE --json JSON_FILE, -j JSON_FILE
Load data from a JSON file or an online, valid, JSON Load data from a JSON file or an online, valid, JSON file.
file. --timeout TIMEOUT Time (in seconds) to wait for response to requests. Default timeout of
--timeout TIMEOUT Time (in seconds) to wait for response to requests. 60.0s.A longer timeout will be more likely to get results from slow
Default timeout of 60.0s.A longer timeout will be more sites.On the other hand, this may cause a long delay to gather all results.
likely to get results from slow sites.On the other
hand, this may cause a long delay to gather all
results.
--print-found Do not output sites where the username was not found. --print-found Do not output sites where the username was not found.
--no-color Don't color terminal output --no-color Don't color terminal output
--browse, -b Browse to all results on default browser. --browse, -b Browse to all results on default browser.

@ -438,9 +438,6 @@ def main():
action="store_true", dest="verbose", default=False, action="store_true", dest="verbose", default=False,
help="Display extra debugging information and metrics." help="Display extra debugging information and metrics."
) )
parser.add_argument("--rank", "-r",
action="store_true", dest="rank", default=False,
help="Present websites ordered by their Alexa.com global rank in popularity.")
parser.add_argument("--folderoutput", "-fo", dest="folderoutput", parser.add_argument("--folderoutput", "-fo", dest="folderoutput",
help="If using multiple usernames, the output of the results will be saved to this folder." help="If using multiple usernames, the output of the results will be saved to this folder."
) )
@ -557,15 +554,6 @@ def main():
f"Error: Desired sites not found: {', '.join(site_missing)}.") f"Error: Desired sites not found: {', '.join(site_missing)}.")
sys.exit(1) sys.exit(1)
if args.rank:
# Sort data by rank
site_dataCpy = dict(site_data)
ranked_sites = sorted(site_data, key=lambda k: ("rank" not in k, site_data[k].get("rank", sys.maxsize)))
site_data = {}
for site in ranked_sites:
site_data[site] = site_dataCpy.get(site)
#Create notify object for query results. #Create notify object for query results.
query_notify = QueryNotifyPrint(result=None, query_notify = QueryNotifyPrint(result=None,
verbose=args.verbose, verbose=args.verbose,

@ -11,9 +11,8 @@ import sys
class SiteInformation(): class SiteInformation():
def __init__(self, name, url_home, url_username_format, popularity_rank, def __init__(self, name, url_home, url_username_format, username_claimed,
username_claimed, username_unclaimed, username_unclaimed, information):
information):
"""Create Site Information Object. """Create Site Information Object.
Contains information about a specific web site. Contains information about a specific web site.
@ -32,10 +31,6 @@ class SiteInformation():
usernames would show up under the usernames would show up under the
"https://somesite.com/users/" area of "https://somesite.com/users/" area of
the web site. the web site.
popularity_rank -- Integer indicating popularity of site.
In general, smaller numbers mean more
popular ("0" or None means ranking
information not available).
username_claimed -- String containing username which is known username_claimed -- String containing username which is known
to be claimed on web site. to be claimed on web site.
username_unclaimed -- String containing username which is known username_unclaimed -- String containing username which is known
@ -58,11 +53,6 @@ class SiteInformation():
self.url_home = url_home self.url_home = url_home
self.url_username_format = url_username_format self.url_username_format = url_username_format
if (popularity_rank is None) or (popularity_rank == 0):
#We do not know the popularity, so make site go to bottom of list.
popularity_rank = sys.maxsize
self.popularity_rank = popularity_rank
self.username_claimed = username_claimed self.username_claimed = username_claimed
self.username_unclaimed = username_unclaimed self.username_unclaimed = username_unclaimed
self.information = information self.information = information
@ -169,14 +159,11 @@ class SitesInformation():
#Add all of site information from the json file to internal site list. #Add all of site information from the json file to internal site list.
for site_name in site_data: for site_name in site_data:
try: try:
#If popularity unknown, make site be at bottom of list.
popularity_rank = site_data[site_name].get("rank", sys.maxsize)
self.sites[site_name] = \ self.sites[site_name] = \
SiteInformation(site_name, SiteInformation(site_name,
site_data[site_name]["urlMain"], site_data[site_name]["urlMain"],
site_data[site_name]["url"], site_data[site_name]["url"],
popularity_rank,
site_data[site_name]["username_claimed"], site_data[site_name]["username_claimed"],
site_data[site_name]["username_unclaimed"], site_data[site_name]["username_unclaimed"],
site_data[site_name] site_data[site_name]
@ -189,32 +176,17 @@ class SitesInformation():
return return
def site_name_list(self, popularity_rank=False): def site_name_list(self):
"""Get Site Name List. """Get Site Name List.
Keyword Arguments: Keyword Arguments:
self -- This object. self -- This object.
popularity_rank -- Boolean indicating if list should be sorted
by popularity rank.
Default value is False.
NOTE: List is sorted in ascending
alphabetical order is popularity rank
is not requested.
Return Value: Return Value:
List of strings containing names of sites. List of strings containing names of sites.
""" """
if popularity_rank: site_names = sorted([site.name for site in self], key=str.lower)
#Sort in ascending popularity rank order.
site_rank_name = \
sorted([(site.popularity_rank,site.name) for site in self],
key=operator.itemgetter(0)
)
site_names = [name for _,name in site_rank_name]
else:
#Sort in ascending alphabetical order.
site_names = sorted([site.name for site in self], key=str.lower)
return site_names return site_names

Loading…
Cancel
Save