<commit_before>#!/usr/bin/env python

#Maybe look into using this later??
#http://stackoverflow.com/questions/21613091/how-to-use-scapy-to-determine-wireless-encryption-type
from scapy.all import *
import cli
import signal

#Proto class
class Proto:
	pass

#create a structure to dump misc data that needs to persist across functions
stores = Proto()
stores.ap_list = []

#catch that control+c (SIGINT) input so we can exit gracefully
#Do this yourself: http://stackoverflow.com/questions/1112343/how-do-i-capture-sigint-in-python :D
def siginit_handler(signal, frame):
	print "One moment while we exit..."
	if stores.args.verbose: print('You pressed Ctrl+C. Gracefully exiting the program.')
	#get rid of the monitor interface
	DestoryMonitorInterface()
	#exit
	print "Exiting..."
	sys.exit(0)

#register the signal interupt handler
signal.signal(signal.SIGINT, siginit_handler)

#check to make sure the following dependencies are present. This should essentially echo the build.py
def check_dependencies():
	#CHECK FOR DEPENDENCIES
	if len(cli.check_sysfile('scapy'))==0:
		print 'scapy executable not found. Make sure you have installed scapy (pip install scapy) or this wont work.'
		return False
	else:
		return True

#could this be a simplier function? Probably...but then it wouldn't be as fun. :)
def ValidInterface():
	avail = False
	wlan = stores.args.interface
	if stores.args.verbose: print 'Looking for: ' + wlan
	if stores.args.alreadymon and not "mon" in wlan:
		print 'You must select a monitor interface (ie. mon0, mon1, etc/whatever) if you are are going to use -m as an option.'
		return
	if stores.args.verbose: print 'Verifying wireless interface is available...'
	s=cli.execute_shell('ifconfig | grep ' + wlan)
	lines = s.splitlines()
	if stores.args.verbose: print lines

	for line in lines:
		if wlan in line:
			avail = True
<commit_msg>Added tcpdump dep and re-worked dependecy function a little.<commit_after>#!/usr/bin/env python

#Maybe look into using this later??
#http://stackoverflow.com/questions/21613091/how-to-use-scapy-to-determine-wireless-encryption-type
from scapy.all import *
import cli
import signal

#Proto class
class Proto:
	pass

#create a structure to dump misc data that needs to persist across functions
stores = Proto()
stores.ap_list = []

#catch that control+c (SIGINT) input so we can exit gracefully
#Do this yourself: http://stackoverflow.com/questions/1112343/how-do-i-capture-sigint-in-python :D
def siginit_handler(signal, frame):
	print "One moment while we exit..."
	if stores.args.verbose: print('You pressed Ctrl+C. Gracefully exiting the program.')
	#get rid of the monitor interface
	DestoryMonitorInterface()
	#exit
	print "Exiting..."
	sys.exit(0)

#register the signal interupt handler
signal.signal(signal.SIGINT, siginit_handler)

#check to make sure the following dependencies are present. This should essentially echo the build.py
def check_dependencies():
	#CHECK FOR DEPENDENCIES
	errors=int(0)
	if len(cli.check_sysfile('scapy'))==0:
		print 'scapy executable not found. Make sure you have installed scapy (pip install scapy) or this wont work.'
		errors = errors+1
	if len(cli.check_sysfile('tcpdump'))==0:
		print 'tcpdump executable not found. Make sure you have installed tcpdump or this wont work.'
		errors = errors+1
	if errors > 0:
		return False
	else:
		return True

#could this be a simplier function? Probably...but then it wouldn't be as fun. :)
def ValidInterface():
	avail = False
	wlan = stores.args.interface
	if stores.args.verbose: print 'Looking for: ' + wlan
	if stores.args.alreadymon and not "mon" in wlan:
		print 'You must select a monitor interface (ie. mon0, mon1, etc/whatever) if you are are going to use -m as an option.'
		return
	if stores.args.verbose: print 'Verifying wireless interface is available...'
	s=cli.execute_shell('ifconfig | grep ' + wlan)
	lines = s.splitlines()
	if stores.args.verbose: print lines

	for line in lines:
		if wlan in line:
			avail = True

{'fraction_non_alphanumeric': 0.09874371859296482, 'fraction_numerical': 0.010804020100502512, 'mean_word_length': 4.387009472259811, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1800800', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1246, 'n_words': 463}