Skip to content

Commit

Permalink
Merge branch '2205-target-debug' into release/0.15.0-rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
ppfeister committed Jul 8, 2024
2 parents 9a45a40 + 079f14e commit 9d94525
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions sherlock_project/sherlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def sherlock(
query_notify: QueryNotify,
tor: bool = False,
unique_tor: bool = False,
dump_response: bool = False,
proxy=None,
timeout=60,
):
Expand Down Expand Up @@ -470,6 +471,34 @@ def sherlock(
raise ValueError(
f"Unknown Error Type '{error_type}' for " f"site '{social_network}'"
)

if dump_response:
print("+++++++++++++++++++++")
print(f"TARGET NAME : {social_network}")
print(f"USERNAME : {username}")
print(f"TARGET URL : {url}")
print(f"TEST METHOD : {error_type}")
try:
print(f"STATUS CODES : {net_info['errorCode']}")
except KeyError:
pass
print("Results...")
try:
print(f"RESPONSE CODE : {r.status_code}")
except Exception:
pass
try:
print(f"ERROR TEXT : {net_info['errorMsg']}")
except KeyError:
pass
print(">>>>> BEGIN RESPONSE TEXT")
try:
print(r.text)
except Exception:
pass
print("<<<<< END RESPONSE TEXT")
print("VERDICT : " + str(query_status))
print("+++++++++++++++++++++")

# Notify caller about results of query.
result = QueryResult(
Expand Down Expand Up @@ -608,6 +637,13 @@ def main():
default=None,
help="Make requests over a proxy. e.g. socks5://127.0.0.1:1080",
)
parser.add_argument(
"--dump-response",
action="store_true",
dest="dump_response",
default=False,
help="Dump the HTTP response to stdout for targeted debugging.",
)
parser.add_argument(
"--json",
"-j",
Expand Down Expand Up @@ -793,6 +829,7 @@ def main():
query_notify,
tor=args.tor,
unique_tor=args.unique_tor,
dump_response=args.dump_response,
proxy=args.proxy,
timeout=args.timeout,
)
Expand Down

0 comments on commit 9d94525

Please sign in to comment.