예제 #1
0
def _get_hash_type(hash_value):

    if util.is_md5(hash_value):
        return (phantom.APP_SUCCESS, "md5")

    if util.is_sha1(hash_value):
        return (phantom.APP_SUCCESS, "sha1")

    if util.is_sha256(hash_value):
        return (phantom.APP_SUCCESS, "sha256")

    return (phantom.APP_ERROR, None)
    def _set_email_id_contains(self, email_id):

        if not self._base_connector:
            return

        try:
            email_id = self._get_string(email_id, 'utf-8')
        except Exception:
            email_id = str(email_id)

        if self._base_connector.get_app_id(
        ) == EXCHANGE_ONPREM_APP_ID and email_id.endswith('='):
            self._email_id_contains = ["exchange email id"]
        elif self._base_connector.get_app_id(
        ) == OFFICE365_APP_ID and email_id.endswith('='):
            self._email_id_contains = ["office 365 email id"]
        elif self._base_connector.get_app_id(
        ) == IMAP_APP_ID and email_id.isdigit():
            self._email_id_contains = ["imap email id"]
        elif ph_utils.is_sha1(email_id):
            self._email_id_contains = ["vault id"]

        return