Beispiel #1
0
def from_shodan_flattened(raw: Union[list, dict]) -> dict:
    """
    Turn an expected Shodan dictionary into a generic format
    :param raw: Shodan list or dictionary from host queries
    :return: Generic host describing dictionary, flattened
    """
    return flatten(from_shodan(raw))
Beispiel #2
0
def from_censys_certificates_flattened(raw: dict) -> dict:
    """
    Converts a censys certificates dictionary to the flattened common model format
    :param raw: Censys certificates dict
    :return: Common model dict
    """
    return flatten(from_censys_certificates(raw))
Beispiel #3
0
def from_censys_ipv4_flattened(raw: dict) -> dict:
    """
    Converts a Censys IPv4 dictionary into the common format
    :param raw: Censys IPv4 dict
    :return: Common format dict, flattened
    """
    return flatten(from_censys_ipv4(raw))
Beispiel #4
0
def from_x509_pem_flattened(pem: Union[str, bytes]) -> dict:
    """
    Wraps from_x509_pem and flattens the output dict
    :param pem: PEM certificates as either string or bytes
    :return: flattened dictionary in common format
    """
    return flatten(from_x509_pem(pem))