pull/1761/merge
Bhumin Solanki 8 months ago committed by GitHub
commit 4a7bb33c01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,6 +25,7 @@ from result import QueryStatus
from result import QueryResult
from notify import QueryNotifyPrint
from sites import SitesInformation
from urllib3.exceptions import InsecureRequestWarning
from colorama import init
module_name = "Sherlock: Find Usernames Across Social Networks"
@ -160,7 +161,7 @@ def MultipleUsernames(username):
return allUsernames
def sherlock(username, site_data, query_notify,
def sherlock(username, site_data, query_notify, ssl_verify,
tor=False, unique_tor=False,
proxy=None, timeout=60):
"""Run Sherlock Analysis.
@ -313,13 +314,15 @@ def sherlock(username, site_data, query_notify,
proxies=proxies,
allow_redirects=allow_redirects,
timeout=timeout,
json=request_payload
json=request_payload,
verify=ssl_verify
)
else:
future = request(url=url_probe, headers=headers,
allow_redirects=allow_redirects,
timeout=timeout,
json=request_payload
json=request_payload,
verify=ssl_verify
)
# Store future in data for access later
@ -564,16 +567,26 @@ def main():
parser.add_argument("--nsfw",
action="store_true", default=False,
help="Include checking of NSFW sites from default list.")
parser.add_argument("--no-ssl",
action="store_false", dest="ssl_verify", default=True,
help="Disable SSL certificate verification.")
args = parser.parse_args()
# Disable warnings for no-ssl
if args.ssl_verify==False:
print("Warning: SSL certificate verification disabled.")
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
# If the user presses CTRL-C, exit gracefully without throwing errors
signal.signal(signal.SIGINT, handler)
# Check for newer version of Sherlock. If it exists, let the user know about it
try:
r = requests.get(
"https://raw.githubusercontent.com/sherlock-project/sherlock/master/sherlock/sherlock.py")
"https://raw.githubusercontent.com/sherlock-project/sherlock/master/sherlock/sherlock.py",
verify=args.ssl_verify)
remote_version = str(re.findall('__version__ = "(.*)"', r.text)[0])
local_version = __version__
@ -620,10 +633,10 @@ def main():
# Create object with all information about sites we are aware of.
try:
if args.local:
sites = SitesInformation(os.path.join(
sites = SitesInformation(args.ssl_verify, os.path.join(
os.path.dirname(__file__), "resources/data.json"))
else:
sites = SitesInformation(args.json_file)
sites = SitesInformation(args.ssl_verify, args.json_file)
except Exception as error:
print(f"ERROR: {error}")
sys.exit(1)
@ -679,6 +692,7 @@ def main():
results = sherlock(username,
site_data,
query_notify,
args.ssl_verify,
tor=args.tor,
unique_tor=args.unique_tor,
proxy=args.proxy,

@ -72,7 +72,7 @@ class SiteInformation:
class SitesInformation:
def __init__(self, data_file_path=None):
def __init__(self, ssl_verify, data_file_path=None):
"""Create Sites Information Object.
Contains information about all supported websites.
@ -120,7 +120,7 @@ class SitesInformation:
if data_file_path.lower().startswith("http"):
# Reference is to a URL.
try:
response = requests.get(url=data_file_path)
response = requests.get(url=data_file_path, verify=ssl_verify)
except Exception as error:
raise FileNotFoundError(
f"Problem while attempting to access data file URL '{data_file_path}': {error}"

@ -7,7 +7,7 @@ import sherlock as sh
checksymbols = []
checksymbols = ["_", "-", "."]
"""Test for mulriple usernames.
"""Test for multiple usernames.
This test ensures that the function MultipleUsernames works properly. More specific,
different scenarios are tested and only usernames that contain this specific sequence: {?}

Loading…
Cancel
Save