def main(): # handle inputs args = handleArgs() # check for sudo/root privileges ?? if checkSudo(): exit('You need to be root/sudo ... exiting') try: CapturePackets(args['interface'], args['save'], args['filter']) except KeyboardInterrupt: exit('You hit ^C, exiting ... bye')
def main(): # handle inputs args = handleArgs() # check for sudo/root privileges if not checkSudo(): exit('You need to be root/sudo ... exiting') try: am = ActiveMapper(range(1, int(args['range']))) hosts = am.scan(args['interface']) pp.pprint(hosts) # save file if args['save']: with open(args['save'], 'w') as fp: json.dump(hosts, fp) return hosts except KeyboardInterrupt: exit('You hit ^C, exiting PassiveMapper ... bye') except: print "Unexpected error:", sys.exc_info() exit('bye ... ')