Merge pull request #748 from sherlock-project/print-all-flag

added a --print-all flag
pull/749/head
Siddharth Dushantha 4 years ago committed by GitHub
commit 28073132d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -110,7 +110,7 @@ class QueryNotifyPrint(QueryNotify):
Query notify class that prints results. Query notify class that prints results.
""" """
def __init__(self, result=None, verbose=False, color=True): def __init__(self, result=None, verbose=False, color=True, print_all=False):
"""Create Query Notify Print Object. """Create Query Notify Print Object.
Contains information about a specific method of notifying the results Contains information about a specific method of notifying the results
@ -121,6 +121,7 @@ class QueryNotifyPrint(QueryNotify):
result -- Object of type QueryResult() containing result -- Object of type QueryResult() containing
results for this query. results for this query.
verbose -- Boolean indicating whether to give verbose output. verbose -- Boolean indicating whether to give verbose output.
print_all -- Boolean indicating whether to only print all sites, including not found.
color -- Boolean indicating whether to color terminal output color -- Boolean indicating whether to color terminal output
Return Value: Return Value:
@ -132,6 +133,7 @@ class QueryNotifyPrint(QueryNotify):
super().__init__(result) super().__init__(result)
self.verbose = verbose self.verbose = verbose
self.print_all = print_all
self.color = color self.color = color
return return
@ -197,7 +199,7 @@ class QueryNotifyPrint(QueryNotify):
print(f"[+]{response_time_text} {self.result.site_name}: {self.result.site_url_user}") print(f"[+]{response_time_text} {self.result.site_name}: {self.result.site_url_user}")
elif result.status == QueryStatus.AVAILABLE: elif result.status == QueryStatus.AVAILABLE:
if self.verbose: if self.print_all:
if self.color: if self.color:
print((Style.BRIGHT + Fore.WHITE + "[" + print((Style.BRIGHT + Fore.WHITE + "[" +
Fore.RED + "-" + Fore.RED + "-" +
@ -209,7 +211,7 @@ class QueryNotifyPrint(QueryNotify):
print(f"[-]{response_time_text} {self.result.site_name}: Not Found!") print(f"[-]{response_time_text} {self.result.site_name}: Not Found!")
elif result.status == QueryStatus.UNKNOWN: elif result.status == QueryStatus.UNKNOWN:
if self.verbose: if self.print_all:
if self.color: if self.color:
print(Style.BRIGHT + Fore.WHITE + "[" + print(Style.BRIGHT + Fore.WHITE + "[" +
Fore.RED + "-" + Fore.RED + "-" +
@ -221,7 +223,7 @@ class QueryNotifyPrint(QueryNotify):
print(f"[-] {self.result.site_name}: {self.result.context} ") print(f"[-] {self.result.site_name}: {self.result.context} ")
elif result.status == QueryStatus.ILLEGAL: elif result.status == QueryStatus.ILLEGAL:
if self.verbose: if self.print_all:
msg = "Illegal Username Format For This Site!" msg = "Illegal Username Format For This Site!"
if self.color: if self.color:
print((Style.BRIGHT + Fore.WHITE + "[" + print((Style.BRIGHT + Fore.WHITE + "[" +

@ -25,7 +25,7 @@ from notify import QueryNotifyPrint
from sites import SitesInformation from sites import SitesInformation
module_name = "Sherlock: Find Usernames Across Social Networks" module_name = "Sherlock: Find Usernames Across Social Networks"
__version__ = "0.12.7" __version__ = "0.12.8"
@ -475,6 +475,10 @@ def main():
"A longer timeout will be more likely to get results from slow sites." "A longer timeout will be more likely to get results from slow sites."
"On the other hand, this may cause a long delay to gather all results." "On the other hand, this may cause a long delay to gather all results."
) )
parser.add_argument("--print-all",
action="store_true", dest="print_all", default=False,
help="Output sites where the username was not found."
)
parser.add_argument("--no-color", parser.add_argument("--no-color",
action="store_true", dest="no_color", default=False, action="store_true", dest="no_color", default=False,
help="Don't color terminal output" help="Don't color terminal output"
@ -495,7 +499,6 @@ def main():
args = parser.parse_args() args = parser.parse_args()
# Check for newer version of Sherlock. If it exists, let the user know about it # Check for newer version of Sherlock. If it exists, let the user know about it
try: try:
r = requests.get("https://raw.githubusercontent.com/sherlock-project/sherlock/master/sherlock/sherlock.py") r = requests.get("https://raw.githubusercontent.com/sherlock-project/sherlock/master/sherlock/sherlock.py")
@ -579,6 +582,7 @@ def main():
#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,
print_all=args.print_all,
color=not args.no_color) color=not args.no_color)
# Run report on all specified users. # Run report on all specified users.

Loading…
Cancel
Save