dictionary.seek(previousposition)
     guessargs = dictionary
 else:
     guessmode = 1
     if options.resume is not None:
         lastextensionsrc = os.path.join(exportpath,'lastextension.pkl')
         try:
             previousextension = pickle.load(open(lastextensionsrc,'r'))
         except IOError:
             logging.critical('Could not read from %s' % lastipsrc)
             exit(1)
         logging.debug('Previous range: %s' % options.range)
         options.range = resumeFrom(previousextension,options.range)
         logging.debug('New range: %s' % options.range)
         logging.info('Resuming from %s' % previousextension)
     extensionstotry = getRange(options.range)
     guessargs = (extensionstotry,options.zeropadding,options.template)
 if options.save is not None:
     if options.resume is None:
         exportpath = os.path.join('.sipvicious',__prog__,options.save)
         if os.path.exists(exportpath):
             logging.warn('we found a previous scan with the same name. Please choose a new session name')
             exit(1)
         logging.debug('creating an export location %s' % exportpath)
         try:
             os.makedirs(exportpath,mode=0700)
         except OSError:
             logging.critical('could not create the export location %s' % exportpath)
             exit(1)
         optionsdst = os.path.join(exportpath,'options.pkl')
         logging.debug('saving options to %s' % optionsdst)
Esempio n. 2
0
         dictionary.seek(previousposition)
     guessargs = dictionary
 else:
     guessmode = 1
     if options.resume is not None:
         lastextensionsrc = os.path.join(exportpath,'lastextension.pkl')
         try:
             previousextension = pickle.load(open(lastextensionsrc,'r'))
         except IOError:
             logging.critical('Could not read from %s' % lastipsrc)
             exit(1)
         logging.debug('Previous range: %s' % options.range)
         options.range = resumeFrom(previousextension,options.range)
         logging.debug('New range: %s' % options.range)
         logging.info('Resuming from %s' % previousextension)
     extensionstotry = getRange(options.range)
     guessargs = (extensionstotry,options.zeropadding,options.template,options.defaults)
 if options.save is not None:
     if options.resume is None:
         exportpath = os.path.join('.sipvicious',__prog__,options.save)
         if os.path.exists(exportpath):
             logging.warn('we found a previous scan with the same name. Please choose a new session name')
             exit(1)
         logging.debug('creating an export location %s' % exportpath)
         try:
             os.makedirs(exportpath,mode=0700)
         except OSError:
             logging.critical('could not create the export location %s' % exportpath)
             exit(1)
         optionsdst = os.path.join(exportpath,'options.pkl')
         logging.debug('saving options to %s' % optionsdst)
Esempio n. 3
0
 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],
                     [3227018240L,3232235519L],
                     [3232301056L,3323068415L],
                     [3323199488L,3758096127L]
                     ]
     scanrandomstore = '.sipviciousrandomtmp'
     resumescan = False 
     if options.save is not None:
         scanrandomstore = os.path.join(exportpath,'random')
Esempio n. 4
0
         dictionary.seek(previousposition)
     crackargs = dictionary
 else:
     crackmode = 1
     if options.resume is not None:
         lastpasswdsrc = os.path.join(exportpath, 'lastpasswd.pkl')
         try:
             previouspasswd = pickle.load(open(lastpasswdsrc, 'r'))
         except IOError:
             logging.critical('Could not read from %s' % lastpasswdsrc)
             exit(1)
         logging.debug('Previous range: %s' % options.range)
         options.range = resumeFrom(previouspasswd, options.range)
         logging.debug('New range: %s' % options.range)
         logging.info('Resuming from %s' % previouspasswd)
     rangelist = getRange(options.range)
     crackargs = (rangelist, options.zeropadding, options.template)
 if options.save is not None:
     if options.resume is None:
         exportpath = os.path.join('.sipvicious', __prog__, options.save)
         if os.path.exists(exportpath):
             logging.warn(
                 'we found a previous scan with the same name. Please choose a new session name'
             )
             exit(1)
         logging.debug('creating an export location %s' % exportpath)
         try:
             os.makedirs(exportpath, mode=0700)
         except OSError:
             logging.critical('could not create the export location %s' %
                              exportpath)
Esempio n. 5
0
         dictionary.seek(previousposition)
     crackargs = dictionary
 else:
     crackmode = 1
     if options.resume is not None:
         lastpasswdsrc = os.path.join(exportpath,'lastpasswd.pkl')
         try:
             previouspasswd = pickle.load(open(lastpasswdsrc,'r'))
         except IOError:
             logging.critical('Could not read from %s' % lastpasswdsrc)
             exit(1)
         logging.debug('Previous range: %s' % options.range)
         options.range = resumeFrom(previouspasswd,options.range)
         logging.debug('New range: %s' % options.range)
         logging.info('Resuming from %s' % previouspasswd)
     rangelist = getRange(options.range)        
     crackargs = (rangelist,options.zeropadding,options.template)
 if options.save is not None:
     if options.resume is None:
         exportpath = os.path.join('.sipvicious',__prog__,options.save)
         if os.path.exists(exportpath):
             logging.warn('we found a previous scan with the same name. Please choose a new session name')
             exit(1)
         logging.debug('creating an export location %s' % exportpath)
         try:
             os.makedirs(exportpath,mode=0700)
         except OSError:
             logging.critical('could not create the export location %s' % exportpath)
             exit(1)
         optionsdst = os.path.join(exportpath,'options.pkl')
         logging.debug('saving options to %s' % optionsdst)