-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdir_exploit_all.py
More file actions
34 lines (30 loc) · 1.4 KB
/
dir_exploit_all.py
File metadata and controls
34 lines (30 loc) · 1.4 KB
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
import sys
# import consecutive_call_exploit
import combined_call_exploit, replay_exploit
import time
if (True):
base_name = "_R.contract.code"
base_dir = "../teether-test/eval/JSON/"
for numb in range(int(sys.argv[1]), int(sys.argv[2]) + 1):
# sys.argv[1:] = arg.split()
reload(combined_call_exploit)
# Wait for seconds
# time.sleep(2)
queried_addr = base_dir + hex(numb)[-1].upper()+ base_name
# print("\n================Run exploit on %s\n" % hex(base_addr))
# print("\n ----------[ %s ]-----------" % hex(queried_addr)[:-1])
# do_RPC 0x3cc7c038f7eea1b70014b788b821d675b13b8760 +1
combined_call_exploit.main(str(queried_addr), ('0x3cc7c038f7eea1b70014b788b821d675b13b8760'), '+1')
else:
base_name = "_R.contract.code" #.project.json"
# base_explopit = "_R.contract.code.exploit.json"
base_dir = "../teether-test/eval/JSON/"
for numb in range(int(sys.argv[1]), int(sys.argv[2]) + 1):
# sys.argv[1:] = arg.split()
reload(replay_exploit)
queried_project = base_dir + hex(numb)[-1].upper() + base_name
replay_exploit.__main__(str(queried_project + ".project.json"), str(queried_project + ".exploit.json"),
('0x3cc7c038f7eea1b70014b788b821d675b13b8760'), '+1')
# Wait for 2 seconds
# time.sleep(5)
# print("================Finished running on %s\n" % base_addr)