lookyloo/lookyloo.py
def _normalize_known_content(self, h: str, /, known_content: Dict[str, Any], url: URLNode) -> Tuple[Optional[Union[str, List[Any]]], Optional[Tuple[bool, Any]]]:
        ''' There are a few different sources to figure out known vs. legitimate content,
        this method normalize it for the web interface.'''
        known: Optional[Union[str, List[Any]]] = None
        legitimate: Optional[Tuple[bool, Any]] = None
        if h not in known_content:
            return known, legitimate

        if known_content[h]['type'] in ['generic', 'sanejs']:
            known = known_content[h]['details']
        elif known_content[h]['type'] == 'legitimate_on_domain':
            legit = False
            if url.hostname in known_content[h]['details']:
                legit = True
            legitimate = (legit, known_content[h]['details'])
        elif known_content[h]['type'] == 'malicious':
            legitimate = (False, known_content[h]['details'])

        return known, legitimate
 There are a few different sources to figure out known vs. legitimate content,
        this method normalize it for the web interface.
There are a few different sources to figure out known vs. legitimate content,
this method normalize it for the web interface.
There are a few different sources to figure out known vs . legitimate content this method normalize it for the web interface .
def _normalize_known_content(self, h: str, /, known_content: Dict[str, Any], url: URLNode) -> Tuple[Optional[Union[str, List[Any]]], Optional[Tuple[bool, Any]]]:
        known: Optional[Union[str, List[Any]]] = None
        legitimate: Optional[Tuple[bool, Any]] = None
        if h not in known_content:
            return known, legitimate
        if known_content[h]['type'] in ['generic', 'sanejs']:
            known = known_content[h]['details']
        elif known_content[h]['type'] == 'legitimate_on_domain':
            legit = False
            if url.hostname in known_content[h]['details']:
                legit = True
            legitimate = (legit, known_content[h]['details'])
        elif known_content[h]['type'] == 'malicious':
            legitimate = (False, known_content[h]['details'])
        return known, legitimate
def _normalize_known_content ( self , h : str , / , known_content : Dict [ str , Any ] , url : URLNode ) -> Tuple [ Optional [ Union [ str , List [ Any ] ] ] , Optional [ Tuple [ bool , Any ] ] ] : known : Optional [ Union [ str , List [ Any ] ] ] = None legitimate : Optional [ Tuple [ bool , Any ] ] = None if h not in known_content : return known , legitimate if known_content [ h ] [ 'type' ] in [ 'generic' , 'sanejs' ] : known = known_content [ h ] [ 'details' ] elif known_content [ h ] [ 'type' ] == 'legitimate_on_domain' : legit = False if url . hostname in known_content [ h ] [ 'details' ] : legit = True legitimate = ( legit , known_content [ h ] [ 'details' ] ) elif known_content [ h ] [ 'type' ] == 'malicious' : legitimate = ( False , known_content [ h ] [ 'details' ] ) return known , legitimate
There are a few different sources to figure out known vs. legitimate content,
this method normalize it for the web interface.
There are a few different sources to figure out known vs . legitimate content this method normalize it for the web interface .
''' There are a few different sources to figure out known vs. legitimate content,
        this method normalize it for the web interface.'''
self
h
str
known_content
Dict[str, Any]
url
URLNode