Example #1
0
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')
Example #2
0
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')
Example #3
0
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 ... ')
Example #4
0
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 ... ')