Пример #1
0
    def analytics(self):
        debug_output("(url analytics for %s)" % self["value"])

        new = []
        # link with hostname
        # host = toolbox.url_get_host(self['value'])
        # if host == None:
        # 	self['hostname'] = "No hostname"
        # else:
        # 	self['hostname'] = host

        # find path
        path, scheme, hostname = toolbox.split_url(self["value"])
        self["path"] = path
        self["scheme"] = scheme
        self["hostname"] = hostname

        if toolbox.is_ip(self["hostname"]):
            new.append(("host", Ip(toolbox.is_ip(self["hostname"]))))
        elif toolbox.is_hostname(self["hostname"]):
            new.append(("host", Hostname(toolbox.is_hostname(self["hostname"]))))
        else:
            debug_output("No hostname found for %s" % self["value"], type="error")
            return

        self["last_analysis"] = datetime.datetime.utcnow()

        return new
Пример #2
0
 def __init__(self, hostname="", context=[]):
     super(Hostname, self).__init__()
     if toolbox.is_hostname(hostname) == hostname:
         self['context'] = context
         self['value'] = toolbox.is_hostname(hostname)
         if self['value'][-1:] == ".":
             self['value'] = self['value'][:-1]
         self['type'] = 'hostname'
     else:
         return None
Пример #3
0
	def __init__(self, hostname="", context=[]):
		super(Hostname, self).__init__()
		if toolbox.is_hostname(hostname) == hostname:
			self['context'] = context
			self['value'] = toolbox.is_hostname(hostname)
			if self['value'][-1:] == ".":
				self['value'] = self['value'][:-1]
			self['type'] = 'hostname'
		else:
			return None
Пример #4
0
 def __init__(self, hostname="", tags=[]):
     super(Hostname, self).__init__()
     if toolbox.is_hostname(hostname) == hostname:
         self["tags"] = tags
         self["value"] = toolbox.is_hostname(hostname)
         if self["value"][-1:] == ".":
             self["value"] = self["value"][:-1]
         self["type"] = "hostname"
     else:
         return None
Пример #5
0
    def analytics(self):
        debug_output("(url analytics for %s)" % self['value'])

        new = []
        #link with hostname
        # host = toolbox.url_get_host(self['value'])
        # if host == None:
        # 	self['hostname'] = "No hostname"
        # else:
        # 	self['hostname'] = host

        # find path
        path, scheme, hostname = toolbox.split_url(self['value'])
        self['path'] = path
        self['scheme'] = scheme
        self['hostname'] = hostname

        if toolbox.is_ip(self['hostname']):
            new.append(('host', Ip(self['hostname'])))
        elif toolbox.is_hostname(self['hostname']):
            new.append(('host', Hostname(self['hostname'])))
        else:
            debug_output("No hostname found for %s" % self['value'],
                         type='error')
            return

        self['last_analysis'] = datetime.datetime.utcnow()

        return new
Пример #6
0
	def analytics(self):
		debug_output("(url analytics for %s)" % self['value'])

		new = []
		#link with hostname
		# host = toolbox.url_get_host(self['value'])
		# if host == None:
		# 	self['hostname'] = "No hostname"
		# else:
		# 	self['hostname'] = host

		# find path
		path, scheme, hostname = toolbox.split_url(self['value'])
		self['path'] = path
		self['scheme'] = scheme
		self['hostname'] = hostname

		if toolbox.is_ip(self['hostname']):
			new.append(('host', Ip(self['hostname'])))
		elif toolbox.is_hostname(self['hostname']):
			new.append(('host', Hostname(self['hostname'])))

		self['last_analysis'] = datetime.datetime.utcnow()
		
		
		return new