action="store_true", default=False, help="automatically process and save the fingerprint") (options, args) = parser.parse_args() if not options.force: parser.error( "This tool is not supported anymore and is being rewritten. If you really want to use it you need force ;-)" ) sys.exit() if len(args) < 1: parser.error("please specify a sip host") sys.exit(2) dsthosts = args servername = None logging.basicConfig(level=calcloglevel(options)) logging.debug('started logging') dstaddrs = map(lambda x: (x, int(options.port)), dsthosts) responses = list() method = 'OPTIONS' fromaddr = '"sipvicious"<sip:[email protected]>' toaddr = fromaddr try: collectpackets(dstaddrs, options.localport, fromaddr, toaddr, options.bindingip, selecttime=options.selecttime, method='OPTIONS',
parser.add_option("-n", dest="resolve", default=True, action="store_false", help="Do not resolve the ip address") parser.add_option("-c", "--count", dest="count", default=False, action="store_true", help="Used togather with 'list' command to count the number of entries") (options,args) = parser.parse_args() if len(args) < 1: parser.error("Please specify a command.\r\n") exit(1) command = args[0] from helper import listsessions,deletesessions,createReverseLookup, dbexists from helper import getsessionpath,getasciitable,outputtoxml,outputtopdf, calcloglevel validcommands = ['list','export','delete','stats','search'] if command not in validcommands: parser.error('%s is not a supported command' % command) exit(1) logging.basicConfig(level=calcloglevel(options)) sessiontypes = ['svmap','svwar','svcrack'] logging.debug('started logging') if command == 'list': listsessions(options.sessiontype,count=options.count) if command == 'delete': if options.session is None: parser.error("Please specify a valid session.") exit(1) sessionpath = deletesessions(options.session,options.sessiontype) if sessionpath is None: parser.error('Session could not be found. Make sure it exists by making use of %s.py list' % __prog__) exit(1) elif command == 'export': from datetime import datetime start_time = datetime.now()