Example #1
0
	def server_bind(self):
		if utils.OsInterfaceIsSupported():
			try:
				self.socket.setsockopt(socket.SOL_SOCKET, 25, responder_settings.Config.Bind_To+'\0')
			except:
				pass
		TCPServer.server_bind(self)
Example #2
0
def serve_thread_tcp(host, port, handler):
	try:
		if utils.OsInterfaceIsSupported():
			server = ThreadingTCPServer((responder_settings.Config.Bind_To, port), handler)
			server.serve_forever()
		else:
			server = ThreadingTCPServer((host, port), handler)
			server.serve_forever()
	except:
		print utils.color("[!] ", 1, 1) + "Error starting TCP server on port " + str(port) + ", check permissions or other servers running."
Example #3
0
	def server_bind(self):
		MADDR = "224.0.0.252"

		self.socket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
		self.socket.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 255)
		
		Join = self.socket.setsockopt(socket.IPPROTO_IP,socket.IP_ADD_MEMBERSHIP,socket.inet_aton(MADDR) + responder_settings.Config.IP_aton)
		
		if utils.OsInterfaceIsSupported():
			try:
				self.socket.setsockopt(socket.SOL_SOCKET, 25, responder_settings.Config.Bind_To+'\0')
			except:
				pass
		UDPServer.server_bind(self)
Example #4
0
def serve_thread_SSL(host, port, handler):
	try:

		cert = os.path.join(responder_settings.Config.ResponderPATH, responder_settings.Config.SSLCert)
		key =  os.path.join(responder_settings.Config.ResponderPATH, responder_settings.Config.SSLKey)

		if utils.OsInterfaceIsSupported():
			server = ThreadingTCPServer((responder_settings.Config.Bind_To, port), handler)
			server.socket = ssl.wrap_socket(server.socket, certfile=cert, keyfile=key, server_side=True)
			server.serve_forever()
		else:
			server = ThreadingTCPServer((host, port), handler)
			server.socket = ssl.wrap_socket(server.socket, certfile=cert, keyfile=key, server_side=True)
			server.serve_forever()
	except:
		print utils.color("[!] ", 1, 1) + "Error starting SSL server on port " + str(port) + ", check permissions or other servers running."