Example #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
Example #2
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
Example #3
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
Example #4
0
	def __init__(self, ip="", context=[]):
		super(Ip, self).__init__()
		# check if url is valid
		if toolbox.is_ip(ip) != ip:
			return None
		else:
			self['value'] = ip
			self['context'] = context
			self['type'] = 'ip'
Example #5
0
 def __init__(self, ip="", context=[]):
     super(Ip, self).__init__()
     # check if url is valid
     if toolbox.is_ip(ip) != ip:
         return None
     else:
         self['value'] = ip
         self['context'] = context
         self['type'] = 'ip'