generate_status.py 文件源码

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

项目:inshack-2017 作者: HugoDelval 项目源码 文件源码
def exploit_challenges():
    challenges = get_challenges_paths()
    status = {n: False for n,_ in challenges}
    start = time.time()
    results = []
    with Pool(processes=len(challenges)) as pool:
        multiple_results = [pool.apply_async(exploit, (name,path,)) for name, path in challenges]
        for res in multiple_results:
            try:
                results.append(res.get(timeout=timeout+1))
            except TimeoutError:
                print("Got a timeout.")
    duration = time.time() - start
    print("All challenges exploited in " + str(duration) + " sec.")
    for chall_name, exploitable in results:
        status[chall_name] = exploitable
    return status
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号