How to use the passivetotal.libs.ssl.SslRequest function in passivetotal

To help you get started, we’ve selected a few passivetotal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github passivetotal / python_api / tests / test_ssl.py View on Github external
def setup_class(self):
        self.patcher = patch('passivetotal.api.Client._get', fake_request)
        self.patcher.start()
        self.client = SslRequest('--No-User--', '--No-Key--')
github PUNCH-Cyber / stoq-plugins-public / v1 / worker / passivetotal / passivetotal / passivetotal.py View on Github external
def get_ssl(self, **kwargs):
        client = SslRequest(self.username, self.apikey)

        keys = ['query', 'compact', 'field', 'type']

        params = self._cleanup_params(keys, **kwargs)

        if not params.get('type'):
            return client.get_ssl_certificate_details(**params)
        elif params.get('type') == 'history':
            return client.get_ssl_certificate_history(**params)
        elif params.get('type') == 'search' and params.get('field'):
            return client.search_ssl_certificate_by_field(**params)
        else:
            self.log.error("No SSL field provided.")
            return None
github passivetotal / python_api / passivetotal / libs / ssl.py View on Github external
def __init__(self, *args, **kwargs):
        """Setup the primary client instance."""
        super(SslRequest, self).__init__(*args, **kwargs)
github passivetotal / python_api / passivetotal / cli / client.py View on Github external
def call_ssl(args):
    """Abstract call to SSL-based queries."""
    client = SslRequest.from_config()
    pruned = prune_args(
        query=args.query,
        compact_record=args.compact,
        field=args.field,
        type=args.type
    )

    valid_types = ['search', 'history']
    if args.type and args.type not in valid_types:
        raise ValueError("Invalid type specified.")

    if not args.type:
        data = client.get_ssl_certificate_details(**pruned)
    elif args.type == 'history':
        data = client.get_ssl_certificate_history(**pruned)
    elif args.type == 'search' and args.field: