|
1 | 1 | import logging |
2 | 2 | import os |
| 3 | +import stat |
3 | 4 |
|
4 | 5 | import angr |
5 | 6 | import claripy |
@@ -54,6 +55,14 @@ def getOneGadget(properties): |
54 | 55 |
|
55 | 56 | def exploitOverflow(binary_name, properties, inputType): |
56 | 57 |
|
| 58 | + radare2_binary_name = "/radare2_binary" |
| 59 | + fin = open(binary_name, "rb") |
| 60 | + fout = open(radare2_binary_name, "wb") |
| 61 | + fout.write(fin.read()) |
| 62 | + fin.close() |
| 63 | + fout.close() |
| 64 | + os.chmod(radare2_binary_name, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) |
| 65 | + |
57 | 66 | run_environ = properties["pwn_type"].get("results", {}) |
58 | 67 | run_environ["type"] = run_environ.get("type", None) |
59 | 68 |
|
@@ -104,7 +113,7 @@ def exploitOverflow(binary_name, properties, inputType): |
104 | 113 | if inputType == "STDIN": |
105 | 114 | entry_addr = p.loader.main_object.entry |
106 | 115 | if not has_pie: |
107 | | - reg_values = getRegValues(binary_name, entry_addr) |
| 116 | + reg_values = getRegValues(radare2_binary_name, entry_addr) |
108 | 117 | state = p.factory.full_init_state( |
109 | 118 | args=argv, |
110 | 119 | add_options=extras, |
@@ -146,7 +155,7 @@ def exploitOverflow(binary_name, properties, inputType): |
146 | 155 | simgr.explore(find=lambda s: "type" in s.globals, step_func=step_func) |
147 | 156 | try: |
148 | 157 |
|
149 | | - @timeout_decorator.timeout(1200) |
| 158 | + @timeout_decorator.timeout(1200, use_signals=False) |
150 | 159 | def exploreBinary(simgr): |
151 | 160 | simgr.explore(find=lambda s: "type" in s.globals, step_func=step_func) |
152 | 161 |
|
|
0 commit comments