示例#1
0
def main():

  if len(sys.argv) < 3:

    print("Usage: {0} <result-dump> <tp, tn, fp, fn>".format(sys.argv[0]))
    sys.exit()

  data = load_dump()
  ids = IDS()
  ids.logger = logging.getLogger('IDS')
  ids.extended = True
  ids.flags = flags
  ids.load_signature()
  ids.data = data[sys.argv[2]]
  if flags['threads'] == True:

    threads = int(flags['threads_value'])
  else:

    threads = int(multiprocessing.cpu_count())
    if threads < 1:

      threads = 1
  ids.threads = threads
  ids.process_match()
  ids.process_sort()

  # Create a printing object
  printer = Printer()
  printer.logger = logging.getLogger('Printer')
  printer.ids = ids

  
  ids.process_sort()
  printer.print_results()
示例#2
0
def main():

    if len(sys.argv) < 3:

        print("Usage: {0} <result-dump> <tp, tn, fp, fn>".format(sys.argv[0]))
        sys.exit()

    data = load_dump()
    ids = IDS()
    ids.logger = logging.getLogger('IDS')
    ids.extended = True
    ids.flags = flags
    ids.load_signature()
    ids.data = data[sys.argv[2]]
    if flags['threads'] == True:

        threads = int(flags['threads_value'])
    else:

        threads = int(multiprocessing.cpu_count())
        if threads < 1:

            threads = 1
    ids.threads = threads
    ids.process_match()
    ids.process_sort()

    # Create a printing object
    printer = Printer()
    printer.logger = logging.getLogger('Printer')
    printer.ids = ids

    ids.process_sort()
    printer.print_results()
示例#3
0
  def show_data(self):

    data_length = len(self.data[list(self.data.keys())[0]]['targets'][list(self.data[list(self.data.keys())[0]]['targets'])[0]])
    if data_length == 7 or data_length == 8 or data_length == 10:

      flags['absolom'] = True

    ids = IDS()
    ids.logger = logging.getLogger('IDS')
    ids.extended = True
    ids.flags = flags
    ids.load_signature()
    ids.data = self.data
    
    printer = Printer()
    printer.logger = logging.getLogger('Printer')
    printer.ids = ids

    ids.process_sort()
    printer.print_results()