Skip to content

Commit

Permalink
Update mysql_client.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 61fa949 commit 1066fa3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/clt/mysql_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@

# :-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-: #
# Katana Core import #
from core.KATANAFRAMEWORK import * #
from core.KatanaFramework import * #
# :-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-: #

# LIBRARIES
from core.Function import MakeTable
import MySQLdb
# END LIBRARIES

Expand All @@ -29,7 +28,7 @@ def init():
'target':[LOCAL_IP ,True ,'Host Target'],
'port' :[SQL_PORT ,False,'Port Target'],
'user' :[USERNAME ,True ,'Username'],
'pass' :[PASSWORD ,True ,'Password'],
'pass' :[PASSWORD ,True ,'Password']
}
return init
# END INFORMATION MODULE
Expand All @@ -40,7 +39,7 @@ def main(run):
con=MySQLdb.connect(init.var['target'], init.var['user'], init.var['pass'],"",int(init.var['port']))
cmd="nop"
current = "sql"
printAlert(2, msg="SQL Console")
printk.inf("SQL Console")
HelpBanner = [["Commands","Description","Example"]]
HelpBanner += [["show databases","show databases","show databases"]]
HelpBanner += [["use","select database","use USERS"]]
Expand All @@ -52,10 +51,11 @@ def main(run):
HelpBanner += [["insert","insert data","insert into EMAILS values ( '2', '[email protected]')"]]
HelpBanner += [["update","update data","update EMAILS set name='Willy' where id=1"]]
HelpBanner += [["select","select data","select id, name from EMAILS"]]
MakeTable(HelpBanner)
GRAPHICAL.CreateTable(HelpBanner)

while(cmd!="exit"):
cmd = raw_input(ClientPrompt(init.CodeName,current))
if cmd == "help":MakeTable(HelpBanner)
if cmd == "help":GRAPHICAL.CreateTable(HelpBanner)
else:
try:
cur = con.cursor()
Expand All @@ -64,6 +64,6 @@ def main(run):
print (" -%s") % cur.fetchone()
if cmd[:3] == "use": current = "sql:"+cmd[4:]
if True:printAlert(3,"------- > OK.")
except Exception , e:printAlert(6,e)
except Exception , e:printk.err(e)

# END CODE MODULE ############################################################################################
# END CODE MODULE ############################################################################################

0 comments on commit 1066fa3

Please sign in to comment.