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
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
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
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'