From 7105cd7c1c0dd53313c0608856e3a5ae38f07256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=CC=94=CD=AF=CD=86=CC=86=CD=8C=CC=88=CD=8C=CC=9A=CC=BD?= =?UTF-8?q?=CD=92=CC=BF=CD=AF=CD=A4=CD=82=CC=AD=CC=AE=CC=97=CC=AF=CC=B3?= =?UTF-8?q?=CC=AF=CC=9C=CC=B3=CC=B1=CD=85=CC=B0=CD=85=CC=AE=CD=8D=CC=AF?= =?UTF-8?q?=CC=AF=CC=B2=CC=9D=CC=A5e=CC=87=CC=94=CD=AC=CD=A7=CC=8D=CD=A3?= =?UTF-8?q?=CC=9A=CC=89=CC=A5=CC=9C=CC=97=CD=89=CC=A6=CC=B0=CD=88=CC=BA?= =?UTF-8?q?=CC=9F=CC=BB=CC=A6d=CC=8F=CD=AB=CC=8C=CD=83=CC=81=CD=A6=CC=86?= =?UTF-8?q?=CC=8B=CC=85=CD=AF=CC=8C=CD=86=CD=82=CD=91=CC=8A=CC=91=CC=84?= =?UTF-8?q?=CC=8A=CC=A6=CC=A6=CC=AF=CC=A9=CC=A0=CC=97=CD=94=CC=9C=CC=BC?= =?UTF-8?q?=CC=ACT=CC=8F=CC=86=CD=AE=CC=BD=CC=81=CD=AB=CC=8E=CC=96=CC=B1?= =?UTF-8?q?=CD=95=CC=AC=CC=AC=CD=88=CC=B9oor?= <09890@hotmail.com> Date: Tue, 27 Dec 2016 11:09:34 -0800 Subject: [PATCH] Update Function.py --- core/Function.py | 54 ++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/core/Function.py b/core/Function.py index b82d5fe..0d61fae 100755 --- a/core/Function.py +++ b/core/Function.py @@ -2,7 +2,7 @@ #HEAD######################################################### # # Katana Framework | API functions -# Last Modified: 24/12/2016 +# Last Modified: 23/12/2016 # #########################################################HEAD# @@ -33,29 +33,6 @@ NUMBER_AGENTS=0 ap_list = [] -### API EXECUTE FUNCTION #################################################################################################### -def Executefunction(query): - try: - - if query[len("f::"):len("get_aps")+len("f::")] == "get_aps": - query = query[len("f::")+len("get_aps"):].replace("(","").replace(")","").split(",") - get_aps(str(query[0]),int(query[1])) - - elif query[len("f::"):len("start_monitor")+len("f::")]== "start_monitor": - query = query[len("f::")+len("start_monitor"):].replace("(","").replace(")","").split(",") - - if start_monitor(query[0]):printk.suff(query[0]+" now is in monitor mode.") - else:NoDeviceFound(query[0]) - - elif query[len("f::"):len("get_interfaces")+len("f::")] == "get_interfaces": print " ",get_interfaces() - elif query[len("f::"):len("get_monitors_mode")+len("f::")] == "get_monitors_mode": print " ",get_monitors_mode() - elif query[len("f::"):len("get_local_ip")+len("f::")] == "get_local_ip": print " ",get_local_ip() - elif query[len("f::"):len("get_external_ip")+len("f::")] == "get_external_ip": print " ",get_external_ip() - elif query[len("f::"):len("get_gateway")+len("f::")] == "get_gateway": print " ",get_gateway() - - else:functionNotFound() - except:printk.war("Check Again your Functions command.") -############################################################################################################################## class NET: @@ -408,4 +385,31 @@ def RamdonAgent(self): File_Agent_Open=True Generate = 0 Generate = random.randint(0, NUMBER_AGENTS) - return AGENT_ARRAY[Generate] \ No newline at end of file + return AGENT_ARRAY[Generate] + + +### API EXECUTE FUNCTION #################################################################################################### +def Executefunction(query): + NET_API = NET() + try: + + if query[len("f::"):len("get_aps")+len("f::")] == "get_aps": + query = query[len("f::")+len("get_aps"):].replace("(","").replace(")","").split(",") + get_aps(str(query[0]),int(query[1])) + + elif query[len("f::"):len("start_monitor")+len("f::")]== "start_monitor": + query = query[len("f::")+len("start_monitor"):].replace("(","").replace(")","").split(",") + + if start_monitor(query[0]):printk.suff(query[0]+" now is in monitor mode.") + else:NoDeviceFound(query[0]) + + elif query[len("f::"):len("get_interfaces")+len("f::")] == "get_interfaces": print " ",NET_API.GetInterfacesOnSystem() + elif query[len("f::"):len("get_monitors_mode")+len("f::")] == "get_monitors_mode": print " ",NET_API.GetMonitorInterfaces() + elif query[len("f::"):len("get_local_ip")+len("f::")] == "get_local_ip": print " ",NET_API.GetLocalIp() + elif query[len("f::"):len("get_external_ip")+len("f::")] == "get_external_ip": print " ",NET_API.GetPublicIp() + elif query[len("f::"):len("get_gateway")+len("f::")] == "get_gateway": print " ",NET_API.GetGateway() + + else:functionNotFound() + except:print " "+warning+" Check Again your Functions command." +############################################################################################################################## +