-
Notifications
You must be signed in to change notification settings - Fork 224
/
ktf.run
executable file
·51 lines (44 loc) · 2 KB
/
ktf.run
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python2
#HEAD#########################################################
#
# Katana Framework | ktf.run
# Last Modified: 27/12/2017
#
#########################################################HEAD#
from core.MainListLibrary import *
from core.Default import *
from core.Design import *
from core import Banner , Errors
LoadBuffer()
LoadGlobalVariables()
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--module", help=" Script module to run.")
parser.add_argument("-q", "--quit" , action='store_false', default=True, help="No show Banner")
args = parser.parse_args()
if args.quit:Banner.LoadBanner()
if args.module and __name__=="__main__":
for modules in GetRootModules().findall('module'):
if args.module == modules.get('name'):
InstanceModule = import_module("modules."+modules.find('category').text+"."+modules.find('filename').text)
init=InstanceModule.init()
real_init = init.options.copy()
init=LoadSession(init)
while True:
try:
actions=raw_input(Prompt(init.CodeName))
if KatanaCheckActionShowOptions(actions) :ShowOptions(init)
elif KatanaCheckActionShowMOptions(actions) :ShowFullOptions(init)
elif KatanaCheckActionExefunction(actions) :Executefunction(actions)
elif KatanaCheckActionInvoke(actions) :Invoke(actions)
elif KatanaCheckSession(actions) :init=SessionInterative(actions,init)
elif KatanaCheckActionSetValue(actions) :init=UpdateValue(actions,init,real_init)
elif KatanaCheckActionGetInfo(actions) :ShowInformationModule(init)
elif runModule(actions) :
init = UpdateInternalModule(init)
SaveSession(init)
InstanceModule.main(True)
elif KatanaCheckActionisBack(actions) :FunctionNoEnableForThisModule()
else :
if actions :KatanaCheckActionGlobalCommands(actions,"mdl")
except :Errors.Errors()
ModuleNotFound(args.module)