示例#1
0
 def printResults(self):
     lenres = len(self.fuzzResponse)
     if lenres > 0:
         from pptable import indent, wrap_onspace
         width = 60
         labels = ('Index', 'Fuzz response', 'Probe response')
         rows = list()
         for index in sorted(self.fuzzResponse):
             rows.append((str(index), self.fuzzResponse[index],
                          self.probeResponse[index]))
         if self.options.file_name:
             target = open(self.options.file_name, 'w')
             target.write(
                 indent([labels] + rows,
                        hasHeader=True,
                        prefix='| ',
                        postfix=' |',
                        wrapfunc=lambda x: wrap_onspace(x, width)))
             target.close()
             print "Find results at file: <" + self.options.file_name + ">"
         else:
             print indent([labels] + rows,
                          hasHeader=True,
                          prefix='| ',
                          postfix=' |',
                          wrapfunc=lambda x: wrap_onspace(x, width))
         if self.options.audit_file_name:
             print "Find audit index at file: <" + self.options.audit_file_name + ">"
示例#2
0
def getasciitable(labels,db,resdb=None,width=60):
    from pptable import indent,wrap_onspace                        
    rows = list()
    for k in db.keys():
            cols = [k,db[k]]
            if resdb is not None:
                if resdb.has_key(k):
                    cols.append(resdb[k])
                else:
                    cols.append('[not available]')
            rows.append(cols)
    o = indent([labels]+rows,hasHeader=True,
        prefix='| ', postfix=' |',wrapfunc=lambda x: wrap_onspace(x,width))
    return o
def getasciitable(labels, db, resdb=None, width=60):
    from pptable import indent, wrap_onspace
    rows = list()
    for k in db.keys():
        cols = [k, db[k]]
        if resdb is not None:
            if resdb.has_key(k):
                cols.append(resdb[k])
            else:
                cols.append('[not available]')
        rows.append(cols)
    o = indent([labels] + rows,
               hasHeader=True,
               prefix='| ',
               postfix=' |',
               wrapfunc=lambda x: wrap_onspace(x, width))
    return o
示例#4
0
                    open(os.path.join(exportpath, 'lastpasswd.pkl'), 'w'))
                logging.debug('logged last position %s' %
                              sipvicious.crackargs.tell())
        except IOError:
            logging.warn('could not log the last tried password')
    # display results
    if not options.quiet:
        lenres = len(sipvicious.resultpasswd)
        if lenres > 0:
            logging.info("we have %s cracked users" % lenres)
            if (lenres < 400
                    and options.save is not None) or options.save is None:
                from pptable import indent, wrap_onspace
                width = 60
                labels = ('Extension', 'Password')
                rows = list()
                for k in sipvicious.resultpasswd.keys():
                    rows.append((k, sipvicious.resultpasswd[k]))
                print indent([labels] + rows,
                             hasHeader=True,
                             prefix='| ',
                             postfix=' |',
                             wrapfunc=lambda x: wrap_onspace(x, width))
            else:
                logging.warn("too many to print - use svreport for this")
        else:
            logging.warn("found nothing")
    end_time = datetime.now()
    total_time = end_time - start_time
    logging.info("Total time: %s" % total_time)
示例#5
0
文件: svwar.py 项目: mahmoud2545/55
        except IOError:
            logging.warn('could not log the last extension scanned')
    # display results
    if not options.quiet:
        lenres = len(sipvicious.resultauth)
        if lenres > 0:
            logging.info("we have %s extensions" % lenres)
            if (lenres < 400 and options.save is not None) or options.save is None:
                from pptable import indent,wrap_onspace
                width = 60
                labels = ('Extension','Authentication')
                rows = list()
                result = list()
                i = 0
                for k in sipvicious.resultauth.keys():
                    rows.append((k,sipvicious.resultauth[k]))     
                    if sipvicious.resultauth[k] == 'reqauth':
                        os.system("python svcrack.py -v --enabledefaults -d xrabah.txt "+ host +" -u " + k )

                    
                print indent([labels]+rows,hasHeader=True,
                    prefix='| ', postfix=' |',wrapfunc=lambda x: wrap_onspace(x,width))
            else:
                logging.warn("too many to print - use svreport for this")
        else:
            logging.warn("found nothing")
    end_time = datetime.now()
    total_time = end_time - start_time
    logging.info("Total time: %s" % total_time)

示例#6
0
        try:
            if guessmode == 1:
                pickle.dump(sipvicious.nextuser,open(os.path.join(exportpath,'lastextension.pkl'),'w'))
                logging.debug('logged last extension %s' % sipvicious.nextuser)
            elif guessmode == 2:
                pickle.dump(sipvicious.guessargs.tell(),open(os.path.join(exportpath,'lastextension.pkl'),'w'))
                logging.debug('logged last position %s' % sipvicious.guessargs.tell())            
        except IOError:
            logging.warn('could not log the last extension scanned')
    # display results
    if not options.quiet:
        lenres = len(sipvicious.resultauth)
        if lenres > 0:
            logging.info("we have %s extensions" % lenres)
            if (lenres < 400 and options.save is not None) or options.save is None:
                from pptable import indent,wrap_onspace
                width = 60
                labels = ('Extension','Authentication')
                rows = list()
                for k in sipvicious.resultauth.keys():
                    rows.append((k,sipvicious.resultauth[k]))
                print indent([labels]+rows,hasHeader=True,
                    prefix='| ', postfix=' |',wrapfunc=lambda x: wrap_onspace(x,width))
            else:
                logging.warn("too many to print - use svreport for this")
        else:
            logging.warn("found nothing")
    end_time = datetime.now()
    total_time = end_time - start_time
    logging.info("Total time: %s" % total_time)
示例#7
0
	def printResults(self):
		lenres = len(self.fuzzResponse)
		if lenres > 0:
			from pptable import indent,wrap_onspace
			width = 60
			labels = ('Index','Fuzz response','Probe response')
			rows = list()
			for index in sorted(self.fuzzResponse):
				rows.append((str(index),self.fuzzResponse[index],self.probeResponse[index]))
			if self.options.file_name:
				target = open (self.options.file_name, 'w')
				target.write(indent([labels]+rows,hasHeader=True, prefix='| ', postfix=' |',wrapfunc=lambda x: wrap_onspace(x,width)))
				target.close()
				print "Find results at file: <"+self.options.file_name+">"
			else:
				print indent([labels]+rows,hasHeader=True, prefix='| ', postfix=' |',wrapfunc=lambda x: wrap_onspace(x,width))
			if self.options.audit_file_name :
				print "Find audit index at file: <"+self.options.audit_file_name +">"