예제 #1
0
파일: ap_scan.py 프로젝트: NullMode/zarp
                return None
            util.Msg('(ctrl^c) when finished.')
            iface = util.get_monitor_adapter()
            if iface is None:
                util.Msg('No devices found in monitor mode.  Enabling...')
                iface = util.enable_monitor(self.channel)
            util.debug('Using interface %s' % iface)
            self.ap_scan(iface)
        except Exception:
            return

    def ap_scan(self, adapt):
        """ Sniff on the monitoring adapter
        """
        try:
            util.Msg('Scanning for access points...')
            if self.channel is None:
                os.system('airodump-ng %s' % adapt)
            else:
                os.system('airodump-ng --channel %s %s' % (self.channel, adapt))
        except Exception, j:
            util.Error('Error scanning: %s' % j)
        finally:
            util.disable_monitor()

    def cli(self, parser):
        """ Add the CLI options
        """
        parser.add_argument('-w', help='Wireless AP Scan', action='store_true',
                            default=False, dest=self.which)
예제 #2
0
                util.Msg('No devices found in monitor mode.  Enabling...')
                iface = util.enable_monitor(self.channel)
            util.debug('Using interface %s' % iface)
            self.ap_scan(iface)
        except Exception:
            return

    def ap_scan(self, adapt):
        """ Sniff on the monitoring adapter
        """
        try:
            util.Msg('Scanning for access points...')
            if self.channel is None:
                os.system('airodump-ng %s' % adapt)
            else:
                os.system('airodump-ng --channel %s %s' %
                          (self.channel, adapt))
        except Exception, j:
            util.Error('Error scanning: %s' % j)
        finally:
            util.disable_monitor()

    def cli(self, parser):
        """ Add the CLI options
        """
        parser.add_argument('-w',
                            help='Wireless AP Scan',
                            action='store_true',
                            default=False,
                            dest=self.which)