forked from UbuntuEvangelist/KatanaFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ktf.console
executable file
·55 lines (51 loc) · 2.23 KB
/
ktf.console
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
52
53
54
55
#!/usr/bin/env python2
#HEAD#########################################################
#
# Katana Framework | ktf.console
# Last Modified: 27/12/2016
#
#########################################################HEAD#
from core.MainListLibrary import *
from core.GeneralCommands import *
from core import Banner , Errors
from core.Design import *
def katanaFrameworkConsole():
try:
action = raw_input(MainPrompt())
if KatanaCheckActionShowModules(action):
ListModules()
katanaFrameworkConsole()
if KatanaCheckActionUseModule(action):
for modules in GetRootModules().findall('module'):
if action[len(SELECT)+1:] == 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) :katanaFrameworkConsole()
else:KatanaCheckActionGlobalCommands(actions)
except:Errors.Errors()
katanaFrameworkConsole()
elif KatanaCheckActionExefunction(action) :Executefunction(action)
else :KatanaCheckActionGlobalCommands(action)
katanaFrameworkConsole()
except :Errors.Errors()
if __name__=="__main__":
LoadBuffer()
LoadGlobalVariables()
Banner.LoadBanner()
katanaFrameworkConsole()