Skip to content

Commit 8e50ad6

Browse files
author
ekultek
committed
finished the '-e' argument, will now convert a text file containing exploits into a JSON file and save it into etc/json, will also prompt if more then one exploit file is found
1 parent 91ae0cf commit 8e50ad6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lib/cmdline/cmd.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import random
44
import argparse
55

6+
import lib.jsonize
7+
import lib.output
8+
69

710
class AutoSploitParser(argparse.ArgumentParser):
811

@@ -35,3 +38,11 @@ def single_run_args(opt):
3538
ethic = random.choice(ethics.readlines()).strip()
3639
print("Your ethic for the day:\n\n{}".format(ethic))
3740
sys.exit(0)
41+
if opt.exploitList:
42+
try:
43+
lib.output.info("converting {} to JSON format".format(opt.exploitList))
44+
done = lib.jsonize.text_file_to_dict(opt.exploitList)
45+
lib.output.info("converted successfully and saved under {}".format(done))
46+
except IOError as e:
47+
lib.output.error("caught IOError '{}' check the file path and try again".format(str(e)))
48+
sys.exit(0)

0 commit comments

Comments
 (0)