@@ -176,6 +176,7 @@ def sherlock(
176176 query_notify : QueryNotify ,
177177 tor : bool = False ,
178178 unique_tor : bool = False ,
179+ dump_response : bool = False ,
179180 proxy = None ,
180181 timeout = 60 ,
181182):
@@ -465,6 +466,34 @@ def sherlock(
465466 raise ValueError (
466467 f"Unknown Error Type '{ error_type } ' for " f"site '{ social_network } '"
467468 )
469+
470+ if dump_response :
471+ print ("+++++++++++++++++++++" )
472+ print (f"TARGET NAME : { social_network } " )
473+ print (f"USERNAME : { username } " )
474+ print (f"TARGET URL : { url } " )
475+ print (f"TEST METHOD : { error_type } " )
476+ try :
477+ print (f"STATUS CODES : { net_info ['errorCode' ]} " )
478+ except KeyError :
479+ pass
480+ print ("Results..." )
481+ try :
482+ print (f"RESPONSE CODE : { r .status_code } " )
483+ except Exception :
484+ pass
485+ try :
486+ print (f"ERROR TEXT : { net_info ['errorMsg' ]} " )
487+ except KeyError :
488+ pass
489+ print (">>>>> BEGIN RESPONSE TEXT" )
490+ try :
491+ print (r .text )
492+ except Exception :
493+ pass
494+ print ("<<<<< END RESPONSE TEXT" )
495+ print ("VERDICT : " + str (query_status ))
496+ print ("+++++++++++++++++++++" )
468497
469498 # Notify caller about results of query.
470499 result = QueryResult (
@@ -603,6 +632,13 @@ def main():
603632 default = None ,
604633 help = "Make requests over a proxy. e.g. socks5://127.0.0.1:1080" ,
605634 )
635+ parser .add_argument (
636+ "--dump-response" ,
637+ action = "store_true" ,
638+ dest = "dump_response" ,
639+ default = False ,
640+ help = "Dump the HTTP response to stdout for targeted debugging." ,
641+ )
606642 parser .add_argument (
607643 "--json" ,
608644 "-j" ,
@@ -791,6 +827,7 @@ def main():
791827 query_notify ,
792828 tor = args .tor ,
793829 unique_tor = args .unique_tor ,
830+ dump_response = args .dump_response ,
794831 proxy = args .proxy ,
795832 timeout = args .timeout ,
796833 )
0 commit comments