forked from PowerScript/KatanaFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
linker.py
executable file
·39 lines (25 loc) · 972 Bytes
/
linker.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
#!/usr/bin/env python
#HEAD#########################################################
#
# Katana Framework | linker
# Last Modified: 15/09/2016
#
#########################################################HEAD#
from core.Function import (GetRootModules)
import importlib
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--module", help=" Script module to run.")
args = parser.parse_args()
if __name__=="__main__":
root=GetRootModules()
for modules in root.findall('module'):
if args.module == modules.get('name'):
category = modules.find('category').text
filename = modules.find('filename').text
ModuleToStart = importlib.import_module("modules."+category+"."+filename)
init=ModuleToStart.init()
output = ""
for VAR in init.options:
output += VAR+":_:"+str(init.options[VAR][0])+":_:"+str(init.options[VAR][1])+":_:"+str(init.options[VAR][2])+":_:_:"
print output[:-5]