diff --git a/Responder.py b/Responder.py index ddb6d16..4e2761d 100644 --- a/Responder.py +++ b/Responder.py @@ -49,9 +49,11 @@ if options.OURIP is None: parser.print_help() exit(-1) +ResponderPATH = os.path.dirname(__file__) + #Config parsing config = ConfigParser.ConfigParser() -config.read('Responder.conf') +config.read(os.path.join(ResponderPATH,'Responder.conf')) # Set some vars. On_Off = config.get('Responder Core', 'HTTP').upper() @@ -108,7 +110,7 @@ def OsInterfaceIsSupported(INTERFACE): #Logger import logging -logging.basicConfig(filename=str(SessionLog),level=logging.INFO,format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p') +logging.basicConfig(filename=str(os.path.join(ResponderPATH,SessionLog)),level=logging.INFO,format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p') logging.warning('Responder Started') def Show_Help(ExtraHelpData): @@ -417,13 +419,13 @@ def ParseSMBHash(data,client): writehash = User+"::"+Domain+":"+LMHash+":"+NtHash+":"+NumChal if PrintData(outfile,User+"::"+Domain): print "[+]SMB-NTLMv1 hash captured from : ",client - outfile = "SMB-NTLMv1ESS-Client-"+client+".txt" + outfile = os.path.join(ResponderPATH,"SMB-NTLMv1ESS-Client-"+client+".txt") print "[+]SMB complete hash is :", writehash WriteData(outfile,writehash,User+"::"+Domain) logging.warning('[+]SMB-NTLMv1 complete hash is :%s'%(writehash)) if NthashLen > 60: - outfile = "SMB-NTLMv2-Client-"+client+".txt" + outfile = os.path.join(ResponderPATH,"SMB-NTLMv2-Client-"+client+".txt") NtHash = SSPIStart[NthashOffset:NthashOffset+NthashLen].encode("hex").upper() DomainLen = struct.unpack(' 25: Hash = data[65+LMhashLen:65+LMhashLen+NthashLen] logging.warning('[+]SMB-NTLMv2 hash captured from :%s'%(client)) - outfile = "SMB-NTLMv2-Client-"+client+".txt" + outfile = os.path.join(ResponderPATH,"SMB-NTLMv2-Client-"+client+".txt") pack = tuple(data[89+NthashLen:].split('\x00\x00\x00'))[:2] var = [e.replace('\x00','') for e in data[89+NthashLen:Bcc+60].split('\x00\x00\x00')[:2]] Username, Domain = tuple(var) @@ -461,7 +463,7 @@ def ParseLMNTHash(data,client): logging.warning('[+]SMB-NTLMv2 complete hash is :%s'%(Writehash)) if NthashLen == 24: logging.warning('[+]SMB-NTLMv1 hash captured from :%s'%(client)) - outfile = "SMB-NTLMv1-Client-"+client+".txt" + outfile = os.path.join(ResponderPATH,"SMB-NTLMv1-Client-"+client+".txt") pack = tuple(data[89+NthashLen:].split('\x00\x00\x00'))[:2] var = [e.replace('\x00','') for e in data[89+NthashLen:Bcc+60].split('\x00\x00\x00')[:2]] Username, Domain = tuple(var) @@ -651,7 +653,7 @@ def ParseSQLHash(data,client): UserLen = struct.unpack('