check_ioc.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:cbapi-examples 作者: cbcommunity 项目源码 文件源码
def main(argv):
    parser = build_cli_parser()
    opts, args = parser.parse_args(argv)
    if not opts.url or not opts.token or not opts.fname or not opts.type:
        print "Missing required param."
        sys.exit(-1)

    if not opts.type in ["md5", "domain", "ipaddr"]:
        print "Unknown type: ", opts.type
        sys.exit(-1)

    # setup the CbApi object
    cb = CBQuery(opts.url, opts.token, ssl_verify=opts.ssl_verify)

    # get the IOCs to check; this is a list of strings, one indicator
    # per line.  strip off the newlines as they come in
    vals = [val.strip() for val in open(opts.fname, "r")]

    # check each!
    cb.check(vals, opts.type, opts.detail)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号