예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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