Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions wifite/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def _add_global_args(self, glob):
action='store',
dest='channel',
metavar='[channel]',
type=int,
help=Color.s('Wireless channel to scan (default: {G}all 2Ghz channels{W})'))
help=Color.s('Wireless channel to scan e.g. {C}1,3-6{W} ' +
'(default: {G}all 2Ghz channels{W})'))
glob.add_argument('--channel', help=argparse.SUPPRESS, action='store',
dest='channel', type=int)
dest='channel')

glob.add_argument('-5',
'--5ghz',
Expand Down
5 changes: 5 additions & 0 deletions wifite/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-

import os
import re

from .util.color import Color
from .tools.macchanger import Macchanger
Expand Down Expand Up @@ -179,6 +180,10 @@ def parse_settings_args(cls, args):
'when scanning & attacking')

if args.channel:
chn_arg_re = re.compile("^[0-9]+((,[0-9]+)|(-[0-9]+,[0-9]+))*(-[0-9]+)?$")
if not chn_arg_re.match(args.channel):
raise ValueError("Invalid channel! The format must be 1,3-6,9")

cls.target_channel = args.channel
Color.pl('{+} {C}option:{W} scanning for targets on channel ' +
'{G}%s{W}' % args.channel)
Expand Down