forked from PowerScript/KatanaFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Beta
- Loading branch information
Showing
137 changed files
with
28,841 additions
and
3,340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/env python | ||
#HEAD######################################################### | ||
# | ||
# Katana Framework | Default | ||
# Settings and Default Variables of Framework, here you can | ||
# change value of variables for adapter to your system. | ||
# | ||
# | ||
# Last Modified: 01/06/2016 | ||
# | ||
#########################################################HEAD# | ||
|
||
|
||
### SETTING FRAMEWORK ### | ||
|
||
# Verbose Mode | ||
"""Show all the alert messages.""" | ||
VERBOSE =True | ||
|
||
# Errors Log | ||
"""Saves all error events in a log.""" | ||
ERROR_LOG =True | ||
|
||
# Apache Folder | ||
"""Path of Apache2""" | ||
PATCH_WWW ="/var/www/html/" | ||
|
||
# Enable Xterm | ||
"""It shows processes that are running through wires, shown with xterm""" | ||
XTERM_OPTION =False | ||
|
||
### END SETTING FRAMEWORK ### | ||
|
||
|
||
# DEFAULT VARIABLES | ||
"""Names of main files""" | ||
KTFCONSOLE ="ktf.console" | ||
KTFLINKER ="ktf.linker" | ||
KTFRUN ="ktf.run" | ||
KTFLAB ="ktf.lab" | ||
KTFGUI ="ktf.gui" | ||
"""References""" | ||
FOLDER_KATANA ="/usr/share/KatanaFramework/" | ||
KTF_REPO ="https://github.com/PowerScript/KatanaFramework/" | ||
KTF_LINCENSE ="https://github.com/PowerScript/KatanaFramework/blob/master/doc/LICENCE" | ||
TABLE_FOLDER_ADMIN ="files/db/commons-dir-admin.tbl" | ||
DITIONARY_PASSWORDS="files/db/pass.dicc" | ||
AGENTS_BROWSER ="files/db/headersbrowser.list" | ||
PATCH_INTALL ="/usr/share/" | ||
NMAP_PATH ="/usr/bin/nmap" | ||
"""Commons""" | ||
LOCAL_IP ="127.0.0.1" | ||
INTERFACE_DEVICE ="wlan0" | ||
INTERFACE_MONITOR ="wlan0mon" | ||
MAC_TARGET ="AA:A1:BB:B2:CC:C1" | ||
CHANNEL_TARGET ="9" | ||
ESSID_TARGET ="FUCK-ME" | ||
MY_IP ="192.168.1.225" | ||
GATEWAY_ADR ="192.168.1.254" | ||
EMAIL ="root@localhost" | ||
USERNAME ="root" | ||
PASSWORD ="toor" | ||
"""Ports""" | ||
FTP_PORT ="21" | ||
HTTP_PORT ="80" | ||
POP_PORT ="110" | ||
SQL_PORT ="3306" | ||
SSH_PORT ="22" | ||
SMTP_PORT ="25" | ||
# END DEFAULT VARIABLES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,66 @@ | ||
#!/usr/bin/env python | ||
#HEADER####################### | ||
# Katana framework # | ||
# Error file debug # | ||
# Last Modified: 03/05/2016 # | ||
# Review: 1 # | ||
#######################HEADER# | ||
|
||
from design import * | ||
#HEAD######################################################### | ||
# | ||
# Katana Framework | Errors | ||
# Register of Errors and Event | ||
# | ||
# | ||
# Last Modified: 01/06/2016 | ||
# | ||
#########################################################HEAD# | ||
|
||
from Design import * | ||
from Default import ERROR_LOG | ||
from Function import SaveErrorLog | ||
|
||
import sys | ||
d=DESIGN() | ||
|
||
def Errors(event, info): | ||
#DEBUG | ||
#print event, info | ||
info=str(info) | ||
string=str(event) | ||
if string.find("IOError") >= 0: | ||
return d.no_file_found(str(info)) | ||
if string.find("OperationalError(1045") >= 0: | ||
d.No_match() | ||
return | ||
if string.find("_mysql_exceptions.OperationalError") >= 0: | ||
print ' '+Bad+' Host '+info+' is not allowed to connect to this MySQL server.\n' | ||
return | ||
if string.find("password refused") >= 0: | ||
print ' '+Bad+' Host '+info+' is not allowed to connect to this MySQL server.\n' | ||
return | ||
if string.find("No such device") >= 0: | ||
return d.Nosuchdevice() | ||
if string.find("smtplib.SMTPServerDisconnected") >= 0: | ||
print ' '+Bad+' Host '+info+' Connection unexpectedly closed.\n' | ||
return | ||
if string.find("socket") >= 0: | ||
return d.target_off(str(info)) | ||
if string.find("KeyboardInterrupt") >= 0 and info!=False: | ||
d.kbi() | ||
return | ||
if string.find("KeyboardInterrupt") >= 0 and info==False: | ||
d.kbi() | ||
exit(0) | ||
if string.find("SystemExit") >= 0 and info==False: | ||
exit(0) | ||
if string.find("ValueError") >= 0: | ||
d.VError() | ||
else: | ||
print "\n Event : %s \n Info: %s " % (event,info) | ||
exit(0) | ||
def Errors(): | ||
try: | ||
event = sys.exc_info() | ||
Alert = "Nothing" | ||
Error = str(event[0]).replace("<class '","").replace("'>","").replace("<type '","") | ||
ClassError = Error.split(".") | ||
|
||
#DEBUG | ||
#print event | ||
#print sys.exc_traceback.tb_lineno | ||
#print sys.exc_traceback.tb_frame.f_code.co_filename | ||
|
||
if ClassError[0] == "socket" : | ||
if ClassError[1] == "error" : Alert = " ["+colors[3]+"Socket"+colors[0]+"]"+error | ||
elif ClassError[1] == "timeout" : Alert = " ["+colors[3]+"Socket"+colors[0]+"]"+warning | ||
elif ClassError[1] == "gaierror": Alert = " ["+colors[3]+"Socket"+colors[0]+"]"+warning | ||
|
||
elif ClassError[0] == "ftplib" : | ||
if ClassError[1] == "error_perm" : Alert = " ["+colors[3]+"Ftp"+colors[0]+"]"+warning | ||
|
||
elif ClassError[0] == "_mysql_exceptions": | ||
if ClassError[1] == "OperationalError" : Alert = " ["+colors[3]+"Sql"+colors[0]+"]"+error | ||
if ClassError[1] == "ProgrammingError" : Alert = " ["+colors[3]+"Sql"+colors[0]+"]"+error | ||
|
||
elif ClassError[0] == "exceptions" : | ||
if ClassError[1] == "ValueError" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+error | ||
elif ClassError[1] == "IOError" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+error | ||
elif ClassError[1] == "NameError" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+error+"[Line #"+str(sys.exc_traceback.tb_lineno)+"]" | ||
elif ClassError[1] == "UnboundLocalError" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+error+"[Line #"+str(sys.exc_traceback.tb_lineno)+"]" | ||
elif ClassError[1] == "AttributeError" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+error+"[Line #"+str(sys.exc_traceback.tb_lineno)+"]" | ||
elif ClassError[1] == "KeyboardInterrupt" : Alert = "\n ["+colors[3]+"Exception"+colors[0]+"]"+warning | ||
elif ClassError[1] == "DeprecationWarning" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+warning | ||
elif ClassError[1] == "PendingDeprecationWarning" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+warning | ||
elif ClassError[1] == "RuntimeWarning" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+warning | ||
elif ClassError[1] == "SyntaxWarning" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+warning | ||
elif ClassError[1] == "UserWarning" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+warning | ||
elif ClassError[1] == "FutureWarning" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+warning | ||
elif ClassError[1] == "ImportWarning" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+warning | ||
elif ClassError[1] == "UnicodeWarning" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+warning | ||
elif ClassError[1] == "BytesWarning" : Alert = " ["+colors[3]+"Exception"+colors[0]+"]"+warning | ||
else: | ||
print " ["+colors[3]+"Exception"+colors[0]+"]"+"("+str(event[1])+")\n" | ||
return | ||
|
||
print Alert+"("+str(event[1])+")\n" | ||
except Exception as E:print E | ||
finally: | ||
if ERROR_LOG:SaveErrorLog(str(event)+"#"+str(sys.exc_traceback.tb_lineno)+":"+str(sys.exc_traceback.tb_frame.f_code.co_filename)) |
Oops, something went wrong.