MCPcopy
hub / github.com/NullArray/AutoSploit / load_exploit_file

Function load_exploit_file

lib/jsonize.py:23–40  ·  view source on GitHub ↗

load exploits from a given file

(path, node="exploits")

Source from the content-addressed store, hash-verified

21
22
23def load_exploit_file(path, node="exploits"):
24 """
25 load exploits from a given file
26 """
27 selected_file_path = path
28
29 retval = []
30 try:
31 with open(selected_file_path) as exploit_file:
32 # loading it like this has been known to cause Unicode issues later on down
33 # the road
34 _json = json.loads(exploit_file.read())
35 for item in _json[node]:
36 # so we'll reload it into a ascii string before we save it into the file
37 retval.append(str(item))
38 except IOError as e:
39 lib.settings.close(e)
40 return retval
41
42
43def load_exploits(path, node="exploits"):

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected