Skip to content

Commit

Permalink
Update Function.py
Browse files Browse the repository at this point in the history
  • Loading branch information
R̭̮̗̯̳̯̜̳̱̰̮͍̯̯̲̝̥̔ͯ͆̆͌̈͌̽͒̿ͯͤ͂̚ͅͅė̥̜̗͉̦̰͈̺̟̻̦̔ͬͧ̍ͣ̉̚d̦̦̯̩̠̗͔̜̼̬̏ͫ̌̓́ͦ̆̋̅ͯ̌͆͂͑̊̑̄̊T̖̱͕̬̬͈̹̏̆ͮ̽́ͫ̎oor authored Dec 27, 2016
1 parent b9f1b29 commit 7105cd7
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions core/Function.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#HEAD#########################################################
#
# Katana Framework | API functions
# Last Modified: 24/12/2016
# Last Modified: 23/12/2016
#
#########################################################HEAD#

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -408,4 +385,31 @@ def RamdonAgent(self):
File_Agent_Open=True
Generate = 0
Generate = random.randint(0, NUMBER_AGENTS)
return AGENT_ARRAY[Generate]
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."
##############################################################################################################################

0 comments on commit 7105cd7

Please sign in to comment.