forked from SniperOJ/Attack-Defense-Framework
-
Notifications
You must be signed in to change notification settings - Fork 6
/
exploit_all.py
37 lines (30 loc) · 1.05 KB
/
exploit_all.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
from core.exploit.submit_flag import *
from core.exploit.get_flag import *
token = "DqSXgARhK0brh2im8plcH4EdvluS2KmW8MpJCb0oeWQJoSYBrnLLdDtqzAbd78nAbZP9wFBjFEb"
def exploit(host, port):
flag = get_flag(host, port)
submit_flag(flag, token)
def exploit_all():
with open("targets") as f:
for line in f:
host = line.split(":")[0]
port = int(line.split(":")[1])
print "[+] Exploiting : %s:%d" % (host, port)
exploit(host, port)
def main():
print "[+] Starting attack framework..."
round_time = 60 * 5
print "[+] Round time : %s seconds..." % (round_time)
wait_time = round_time / 2
print "[+] Wait time : %s seconds..." % (wait_time)
while True:
exploit_all()
print "[+] This round is finished , waiting for the next round..."
for i in range(wait_time):
print "[+] The next attack is %d seconds later..." % (wait_time - i)
time.sleep(1)
if __name__ == "__main__":
main()