cinnapwn.py 文件源码

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

项目:cinnapwn 作者: nnamon 项目源码 文件源码
def status_loop(self):
        x = self.targets
        status = ""
        for i in range(0, len(x), 3):
            a1 = "%d. %s (%s)" % (i+1, x[i]['team'], x[i]['ip'])
            if i + 1 < len(x):
                a2 = "%d. %s (%s)" % (i+2, x[i+1]['team'], x[i+1]['ip'])
            else:
                a2 = ""
            if i + 2 < len(x):
                a3 = "%d. %s (%s)" % (i+3, x[i+2]['team'], x[i+2]['ip'])
            else:
                a3 = ""
            a1f = Fore.GREEN if x[i]['compromised'] else Fore.RED
            if i + 1 < len(x):
                a2f = Fore.GREEN if x[i+1]['compromised'] else Fore.RED
            if i + 2 < len(x):
                a3f = Fore.GREEN if x[i+2]['compromised'] else Fore.RED
            a1 = a1f + a1.ljust(45, " ") + Style.RESET_ALL
            a2 = a2f + a2.ljust(45, " ") + Style.RESET_ALL
            a3 = a3f + a3.ljust(20, " ") + Style.RESET_ALL
            status += ("%s%s%s\n" % (a1, a2, a3))
        open("status", 'w').write(status)
        self.loop.call_later(self.detect_interval, self.status_work)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号