Example #1
0
                'Session could not be found. Make sure it exists by making use of %s list'
                % __prog__)
            exit(1)
        sessionpath, sessiontype = tmp
        resolve = False
        resdb = None
        if sessiontype == 'svmap':
            dbloc = os.path.join(sessionpath, 'resultua')
            labels = ['Host', 'User Agent']
        elif sessiontype == 'svwar':
            dbloc = os.path.join(sessionpath, 'resultauth')
            labels = ['Extension', 'Authentication']
        elif sessiontype == 'svcrack':
            dbloc = os.path.join(sessionpath, 'resultpasswd')
            labels = ['Extension', 'Password']
        if not dbexists(dbloc):
            logging.error('The database could not be found: %s' % dbloc)
            exit(1)
        db = anydbm.open(dbloc, 'r')

        if options.resolve and sessiontype == 'svmap':
            resolve = True
            labels.append('Resolved')
            resdbloc = os.path.join(sessionpath, 'resolved')
            if not dbexists(resdbloc):
                logging.info('Performing DNS reverse lookup')
                resdb = anydbm.open(resdbloc, 'c')
                createReverseLookup(db, resdb)
            else:
                logging.info('Not Performing DNS lookup')
                resdb = anydbm.open(resdbloc, 'r')
Example #2
0
                if tmp is None:
                        parser.error('Session could not be found. Make sure it exists by making use of %s list' % __prog__)
                        exit(1)
                sessionpath,sessiontype = tmp
                resolve = False
                resdb = None
                if sessiontype == 'svmap':
                        dbloc = os.path.join(sessionpath,'resultua')
                        labels = ['Host','User Agent']
                elif sessiontype == 'svwar':
                        dbloc = os.path.join(sessionpath,'resultauth')
                        labels = ['Extension','Authentication']
                elif sessiontype == 'svcrack':
                        dbloc = os.path.join(sessionpath,'resultpasswd')
                        labels = ['Extension','Password']
                if not dbexists(dbloc):
                        logging.error('The database could not be found: %s'%dbloc)
                        exit(1)
                db = anydbm.open(dbloc,'r')

                if options.resolve and sessiontype == 'svmap':
                        resolve = True
                        labels.append('Resolved')                                
                        resdbloc = os.path.join(sessionpath,'resolved')
                        if not dbexists(resdbloc):
                                logging.info('Performing DNS reverse lookup')
                                resdb = anydbm.open(resdbloc,'c')
                                createReverseLookup(db,resdb)
                        else:
                                logging.info('Not Performing DNS lookup')
                                resdb = anydbm.open(resdbloc,'r')
Example #3
0
         logging.critical('A session with the name %s was not found'% options.resume)
         exit(1)
     optionssrc = os.path.join(exportpath,'options.pkl')
     previousresume = options.resume
     previousverbose = options.verbose
     options,args = pickle.load(open(optionssrc,'r'))        
     options.resume = previousresume
     options.verbose = previousverbose
 elif options.save is not None:
     exportpath = os.path.join('.sipvicious',__prog__,options.save)
 logging.basicConfig(level=calcloglevel(options))
 logging.debug('started logging')
 scanrandomstore = None 
 if options.input is not None:
     db = os.path.join('.sipvicious',__prog__,options.input,'resultua')
     if dbexists(db):
         scaniter = scanfromdb(db,options.method.split(','))
     else:
         logging.error("the session name does not exist. Please use svreport to list existing scans")
         exit(1)
 elif options.randomscan:
     logging.debug('making use of random scan')
     logging.debug('parsing range of ports: %s' % options.port)
     portrange = getRange(options.port)
     internetranges =[[16777216,167772159],
                     [184549376,234881023],
                     [251658240,2130706431],
                     [2147549184L,2851995647L],
                     [2852061184L,2886729727L],
                     [2886795264L,3221159935L],
                     [3221226240L,3227017983L],