def __init__(self): baseOutputPlugin.__init__(self) # These attributes hold the file pointers self._file = None # User configured parameters self._file_name = "report.xml" self._timeFormat = "%a %b %d %H:%M:%S %Y" self._longTimestampString = str(time.strftime(self._timeFormat, time.localtime())) self._timestampString = str(int(time.time())) # List with additional xml elements self._errorXML = [] # xml self._xmldoc = xml.dom.minidom.Document() self._topElement = self._xmldoc.createElement("w3afrun") self._topElement.setAttribute("start", self._timestampString) self._topElement.setAttribute("startstr", self._longTimestampString) self._topElement.setAttribute("xmloutputversion", "2.0") # Add in the version details version_element = self._xmldoc.createElement("w3af-version") version_data = self._xmldoc.createTextNode(str(get_w3af_version.get_w3af_version())) version_element.appendChild(version_data) self._topElement.appendChild(version_element) self._scanInfo = self._xmldoc.createElement("scaninfo") # HistoryItem to get requests/responses self._history = HistoryItem()
def __init__(self): baseOutputPlugin.__init__(self) if not kb.kb.getData('gtkOutput', 'queue') == []: self.queue = kb.kb.getData('gtkOutput', 'queue') else: self.queue = Queue.Queue() kb.kb.save('gtkOutput', 'queue' , self.queue)
def __init__(self): baseOutputPlugin.__init__(self) # These attributes hold the file pointers self._file = None # User configured parameters self._file_name = 'report.xml' self._timeFormat = '%a %b %d %H:%M:%S %Y' self._longTimestampString = str(time.strftime(self._timeFormat, time.localtime())) self._timestampString = str(int(time.time())) # List with additional xml elements self._errorXML = [] # xml self._xmldoc = xml.dom.minidom.Document() self._topElement = self._xmldoc.createElement("w3afrun") self._topElement.setAttribute("start", self._timestampString) self._topElement.setAttribute("startstr", self._longTimestampString) self._topElement.setAttribute("xmloutputversion", "1.00") self._scanInfo = self._xmldoc.createElement("scaninfo") # HistoryItem to get requests/responses self._history = HistoryItem()
def __init__(self): baseOutputPlugin.__init__(self) self.targets = [] self.tpl = MSG_TMPL self.smtpServer = 'localhost' self.smtpPort = 25 self.toAddrs = '' self.fromAddr = '' self._exec = False
def __init__(self): baseOutputPlugin.__init__(self) # Internal variables self._initialized = False self._aditional_info_fh = None self._style_filename = 'plugins' + os.path.sep + 'output' + os.path.sep self._style_filename += 'htmlFile' + os.path.sep +'style.css' # These attributes hold the file pointers self._file = None # User configured parameters self._verbose = False self._file_name = 'report.html'
def __init__(self): baseOutputPlugin.__init__(self) # User configured parameters self._file_name = 'output.txt' self._http_file_name = 'output-http.txt' self.verbose = True # Internal variables self._flush_counter = 0 self._flush_number = 10 self._initialized = False # File handlers self._file = None self._http = None # XXX Only set '_show_caller' to True for debugging purposes. It # causes the execution of potentially slow code that handles # with introspection. self._show_caller = False
def __init__(self): baseOutputPlugin.__init__(self) # User configured parameters self._file_name = 'output.txt' self._http_file_name = 'output-http.txt' # I changed this to false because the performance is enhanced A LOT # Show Caller False: Performed 4001 requests in 10 seconds (400.100000 req/sec) # Show Caller True: Performed 4001 requests in 28 seconds (142.892857 req/sec) self._show_caller = False self.verbose = True # Internal variables self._flush_counter = 0 self._flush_number = 10 self._initialized = False # File handlers self._file = None self._http = None
def __init__(self): baseOutputPlugin.__init__(self) if not kb.kb.getData('gtkOutput', 'db') == []: # Restore it from the kb self._db = kb.kb.getData('gtkOutput', 'db') self.queue = kb.kb.getData('gtkOutput', 'queue') else: self.queue = Queue.Queue() kb.kb.save('gtkOutput', 'queue' , self.queue) # Create DB and add tables sessionName = cf.cf.getData('sessionName') dbName = os.path.join(get_home_dir(), 'sessions', 'db_' + sessionName) # Just in case the directory doesn't exist... try: os.mkdir(os.path.join(get_home_dir() , 'sessions')) except OSError, oe: # [Errno 17] File exists if oe.errno != 17: msg = 'Unable to write to the user home directory: ' + get_home_dir() raise w3afException( msg ) self._db = DB() # Check if the database already exists if os.path.exists(dbName): # Find one that doesn't exist for i in xrange(100): newDbName = dbName + '-' + str(i) if not os.path.exists(newDbName): dbName = newDbName break # Create DB! self._db.open(dbName) # Create table historyItem = HistoryItem(self._db) self._db.createTable(historyItem.getTableName(), historyItem.getColumns(), historyItem.getPrimaryKeyColumns()) kb.kb.save('gtkOutput', 'db', self._db)
def __init__(self): baseOutputPlugin.__init__(self) self.verbose = False
def __init__(self): baseOutputPlugin.__init__(self) self.output_file = 'output-requests.csv'
def __init__(self): baseOutputPlugin.__init__(self) self.output_file = 'output-w3af.csv'