Beispiel #1
0
    def delete_alert(self, aid):
        """Delete the alert with the given ID."""
        func = '/shodan/alert/%s' % aid

        response = helpers.api_request(self.api_key, func, params={}, method='delete')

        return response
Beispiel #2
0
    def delete_alert(self, aid):
        """Delete the alert with the given ID."""
        func = '/shodan/alert/%s' % aid

        response = helpers.api_request(self.api_key,
                                       func,
                                       params={},
                                       method='delete')

        return response
Beispiel #3
0
    def alerts(self, aid=None, include_expired=True):
        """List all of the active alerts that the user created."""
        if aid:
            func = '/shodan/alert/%s/info' % aid
        else:
            func = '/shodan/alert/info'

        response = helpers.api_request(self.api_key, func, params={
            'include_expired': include_expired,
            })

        return response
Beispiel #4
0
    def alerts(self, aid=None, include_expired=True):
        """List all of the active alerts that the user created."""
        if aid:
            func = '/shodan/alert/%s/info' % aid
        else:
            func = '/shodan/alert/info'

        response = helpers.api_request(self.api_key,
                                       func,
                                       params={
                                           'include_expired': include_expired,
                                       })

        return response
Beispiel #5
0
    def create_alert(self, name, ip, expires=0):
        """Search the directory of saved search queries in Shodan.

        :param query: The number of tags to return
        :type page: int

        :returns: A list of tags.
        """
        data = {
            'name': name,
            'filters': {
                'ip': ip,
            },
            'expires': expires,
        }

        response = helpers.api_request(self.api_key, '/shodan/alert', data=data, params={}, method='post')

        return response
Beispiel #6
0
    def create_alert(self, name, ip, expires=0):
        """Search the directory of saved search queries in Shodan.

        :param query: The number of tags to return
        :type page: int

        :returns: A list of tags.
        """
        data = {
            'name': name,
            'filters': {
                'ip': ip,
            },
            'expires': expires,
        }

        response = helpers.api_request(self.api_key,
                                       '/shodan/alert',
                                       data=data,
                                       params={},
                                       method='post')

        return response