Don't kill conflicting processes by-default, require --kill

Shows warning to user that the processes may conflict with Wifite, & how to kill them.

Should resolve #57
This commit is contained in:
derv82
2018-03-10 21:18:20 -05:00
parent e95b4a99a0
commit 697207f11b
3 changed files with 44 additions and 25 deletions

View File

@@ -246,14 +246,19 @@ class Airmon(object):
continue continue
match = re.search('^[ \t]*(\d+)[ \t]*([a-zA-Z0-9_\-]+)[ \t]*$', line) match = re.search('^[ \t]*(\d+)[ \t]*([a-zA-Z0-9_\-]+)[ \t]*$', line)
if match: if match:
# Found process to kill # Found process
pid = match.groups()[0] pid = match.groups()[0]
pname = match.groups()[1] pname = match.groups()[1]
Color.pl('{!} {R}terminating {O}conflicting process' + if Configuration.kill_conflicting_processes:
' {R}%s{O} (PID {R}%s{O})' % (pname, pid)) Color.pl('{!} {R}terminating {O}conflicting process {R}%s{O} (PID {R}%s{O})' % (pname, pid))
os.kill(int(pid), signal.SIGTERM) os.kill(int(pid), signal.SIGTERM)
if pname == 'NetworkManager': if pname == 'NetworkManager':
Airmon.killed_network_manager= True Airmon.killed_network_manager= True
else:
Color.pl('{!} {O}conflicting process: {R}%s{O} (PID {R}%s{O})' % (pname, pid))
if not Configuration.kill_conflicting_processes:
Color.pl('{!} {O}if you have problems, try killing these processes ({R}kill -9 PID{O}){W}')
@staticmethod @staticmethod
def put_interface_up(iface): def put_interface_up(iface):

View File

@@ -17,65 +17,67 @@ class Arguments(object):
# Global variables # Global variables
glob = parser.add_argument_group('SETTINGS') glob = parser.add_argument_group('SETTINGS')
glob.add_argument('-i', glob.add_argument('-i',
action='store', action='store',
dest='interface', dest='interface',
metavar='[interface]', metavar='[interface]',
type=str, type=str,
help=Color.s('Wireless interface to use (default: {G}ask{W})')) help=Color.s('Wireless interface to use (default: {G}ask{W})'))
glob.add_argument('--kill',
action='store_true',
dest='kill_conflicting_processes',
help=Color.s('Kill processes that conflict with Airmon/Airodump (default: {G}off{W})'))
glob.add_argument('--channel', help=argparse.SUPPRESS, action='store', dest='channel', type=int)
glob.add_argument('-c', glob.add_argument('-c',
action='store', action='store',
dest='channel', dest='channel',
metavar='[channel]', metavar='[channel]',
type=int, type=int,
help=Color.s('Wireless channel to scan (default: {G}all channels{W})')) help=Color.s('Wireless channel to scan (default: {G}all channels{W})'))
glob.add_argument('--channel', help=argparse.SUPPRESS, action='store', dest='channel', type=int)
glob.add_argument('-mac', glob.add_argument('-mac',
'---random-mac', '---random-mac',
action='store_true', action='store_true',
dest='random_mac', dest='random_mac',
help=Color.s('Randomize wireless card MAC address (default: {G}off{W})')) help=Color.s('Randomize wireless card MAC address (default: {G}off{W})'))
glob.add_argument('-5', glob.add_argument('-5',
'--5ghz', '--5ghz',
action='store_true', action='store_true',
dest='five_ghz', dest='five_ghz',
help=Color.s('Include 5Ghz channels (default: {G}off{W})')) help=Color.s('Include 5Ghz channels (default: {G}off{W})'))
glob.add_argument('--bssid', help=argparse.SUPPRESS, action='store', dest='target_bssid', type=str)
glob.add_argument('-b', glob.add_argument('-b',
action='store', action='store',
dest='target_bssid', dest='target_bssid',
metavar='[bssid]', metavar='[bssid]',
type=str, type=str,
help=Color.s('BSSID (e.g. {GR}AA:BB:CC:DD:EE:FF{W}) of access point to attack')) help=Color.s('BSSID (e.g. {GR}AA:BB:CC:DD:EE:FF{W}) of access point to attack'))
glob.add_argument('--bssid', help=argparse.SUPPRESS, action='store', dest='target_bssid', type=str)
glob.add_argument('--essid', help=argparse.SUPPRESS, action='store', dest='target_essid', type=str)
glob.add_argument('-e', glob.add_argument('-e',
action='store', action='store',
dest='target_essid', dest='target_essid',
metavar='[essid]', metavar='[essid]',
type=str, type=str,
help=Color.s('ESSID (e.g. {GR}NETGEAR07{W}) of access point to attack')) help=Color.s('ESSID (e.g. {GR}NETGEAR07{W}) of access point to attack'))
glob.add_argument('--essid', help=argparse.SUPPRESS, action='store', dest='target_essid', type=str)
glob.add_argument('--showb', glob.add_argument('--showb',
action='store_true', action='store_true',
dest='show_bssids', dest='show_bssids',
help=Color.s('Show BSSIDs of targets while scanning')) help=Color.s('Show BSSIDs of targets while scanning'))
glob.add_argument('-v',
'--verbose',
action='count',
default=0,
dest='verbose',
help=Color.s('Verbose mode, prints more lines (default: {G}quiet{W})'))
glob.add_argument('--nodeauths', glob.add_argument('--nodeauths',
action='store_true', action='store_true',
dest='no_deauth', dest='no_deauth',
help=Color.s('Do not deauthenticate clients *EVER* (default: {G}off{W})')) help=Color.s('Do not deauthenticate clients *EVER* (default: {G}off{W})'))
glob.add_argument('--no-deauths', glob.add_argument('--no-deauths', action='store_true', dest='no_deauth', help=argparse.SUPPRESS)
action='store_true', glob.add_argument('-nd', action='store_true', dest='no_deauth', help=argparse.SUPPRESS)
dest='no_deauth',
help=argparse.SUPPRESS)
glob.add_argument('-nd',
action='store_true',
dest='no_deauth',
help=argparse.SUPPRESS)
glob.add_argument('--num-deauths', glob.add_argument('--num-deauths',
action='store', action='store',
type=int, type=int,
@@ -83,6 +85,8 @@ class Arguments(object):
metavar="[num]", metavar="[num]",
default=None, default=None,
help=Color.s('Number of deauth packets to send (default: {G}%d{W})' % Configuration.num_deauths)) help=Color.s('Number of deauth packets to send (default: {G}%d{W})' % Configuration.num_deauths))
glob.add_argument('--pillage', help=argparse.SUPPRESS, action='store', dest='scan_time', nargs='?', const=10, type=int)
glob.add_argument('-p', glob.add_argument('-p',
action='store', action='store',
dest='scan_time', dest='scan_time',
@@ -91,7 +95,13 @@ class Arguments(object):
metavar='scantime', metavar='scantime',
type=int, type=int,
help=Color.s('{G}Pillage{W}: Attack all targets after {C}scantime{W} seconds')) help=Color.s('{G}Pillage{W}: Attack all targets after {C}scantime{W} seconds'))
glob.add_argument('--pillage', help=argparse.SUPPRESS, action='store', dest='scan_time', nargs='?', const=10, type=int)
glob.add_argument('-v',
'--verbose',
action='count',
default=0,
dest='verbose',
help=Color.s('Verbose mode, prints more lines (default: {G}quiet{W})'))
# WEP # WEP
wep = parser.add_argument_group('WEP-RELATED') wep = parser.add_argument_group('WEP-RELATED')

View File

@@ -28,6 +28,8 @@ class Configuration(object):
Configuration.verbose = 0 # Verbosity level. Configuration.verbose = 0 # Verbosity level.
Configuration.kill_conflicting_processes = False
Configuration.scan_time = 0 # Time to wait before attacking all targets Configuration.scan_time = 0 # Time to wait before attacking all targets
Configuration.all_targets = False # Run attacks against all targets automatically Configuration.all_targets = False # Run attacks against all targets automatically
@@ -149,7 +151,9 @@ class Configuration(object):
if args.verbose: if args.verbose:
Configuration.verbose = args.verbose Configuration.verbose = args.verbose
Color.pl('{+} {C}option:{W} verbosity level {G}%d{W}' % args.verbose) Color.pl('{+} {C}option:{W} verbosity level {G}%d{W}' % args.verbose)
if args.kill_conflicting_processes:
Configuration.kill_conflicting_processes = True
Color.pl('{+} {C}option:{W} kill conflicting processes {G}enabled{W}')
# WEP # WEP
if args.wep_filter: if args.wep_filter: