def __init__(self, target, script, exception): target = Encode(target) script = Encode(script) exception = Encode(exception) warning_msg = "Warning in scanner! target: {0} poc: {1} msg: {2}" message = warning_msg.format(target, script, exception) msg = OutPutPadding(message, MESSAGE_LEVEL.WARNING_LEVEL) InfoOutPut2Console(msg, MESSAGE_LEVEL.WARNING_LEVEL) WriteLogToFile(msg, MESSAGE_LEVEL.WARNING_LEVEL)
def __init__(self, exception, position, error_level, target, script=None): self.exception = Encode(repr(exception)) self.position = Encode(position) self.target = Encode(target) self.script = Encode(script) self.error_level = Encode(error_level) if 'ConnectionError' in self.exception: self.OutPutMessage('ConnectionError') if 'ConnectTimeout' in self.exception or 'ReadTimeout' in self.exception: self.OutPutMessage('ConnectTimeout')
def __init__(self, message): message = Encode(message) msg = OutPutPadding(message, MESSAGE_LEVEL.ERROR_LEVEL) InfoOutPut2Console(msg, MESSAGE_LEVEL.ERROR_LEVEL) WriteLogToFile(msg, MESSAGE_LEVEL.ERROR_LEVEL) from database import SaveWarningToDatabase, SaveStatusToDatabase SaveStatusToDatabase(STATUS.FAIL) SaveWarningToDatabase(message)
def __init__(self, message): message = Encode(message) msg = OutPutPadding(message, MESSAGE_LEVEL.ERROR_LEVEL) InfoOutPut2Console(msg, MESSAGE_LEVEL.ERROR_LEVEL) WriteLogToFile(msg, MESSAGE_LEVEL.ERROR_LEVEL)