def run(self, conf, args, plugins): logging.getLogger("greynoise").setLevel(logging.CRITICAL) gn = GreyNoise(api_key=conf["GreyNoise"]["key"]) if args.ip: res = gn.ip(args.ip) self.print_results(res, args) elif args.query: res = gn.query(args.query) self.print_results(res, args) else: self.parser.print_help()
def run(self, conf, args, plugins): if conf["GreyNoise"]["key"] == "": print("You need to set your API key with GreyNoise") sys.exit() gn = GreyNoise(api_key=conf["GreyNoise"]["key"]) if args.ip: res = gn.ip(args.ip) self.print_results(res, args) elif args.query: res = gn.query(args.query) self.print_results(res, args) else: self.parser.print_help()
def run(self, conf, args, plugins): logging.getLogger("greynoise").setLevel(logging.CRITICAL) if conf["GreyNoise"]["api_type"].lower() == "community": gn = GreyNoise( api_key=conf["GreyNoise"]["key"], integration_name="Harpoon (https://github.com/Te-k/harpoon)", offering="community", ) else: gn = GreyNoise( api_key=conf["GreyNoise"]["key"], integration_name="Harpoon (https://github.com/Te-k/harpoon)", ) if args.ip: res = gn.ip(args.ip) self.print_results(res, args) elif args.query: res = gn.query(args.query) self.print_results(res, args) elif args.list: res = gn.metadata() self.print_results(res, args) else: self.parser.print_help()