コード例 #1
0
ファイル: daemon.py プロジェクト: netspaces/beekeeperwids
 def enumerateInterfaces(self):
     self.logutil.log("Enumerating Interfaces")
     try:
         for interface in kbutils.devlist():
             device = interface[0]
             description = interface[1]
             self.logutil.log("Added new interface: {0}".format(device))
             self.interfaces[device] = KBInterface(device)
     except Exception:
         self.handleUnknownException()
コード例 #2
0
# Detects attached interfaces
# Initiates scanning using doScan()
def startScan(zbdb, currentGPS, verbose=False, dblog=False, agressive=False):
    try:
        kb = KillerBee()
    except usb.USBError, e:
        if e.args[0].find('Operation not permitted') >= 0:
            print 'Error: Permissions error, try running using sudo.'
        else:
            print 'Error: USBError:', e
        return False
    except Exception, e:
        #print 'Error: Missing KillerBee USB hardware:', e
        print 'Error: Issue starting KillerBee instance:', e
        return False
    for kbdev in kbutils.devlist():
        print 'Found device at %s: \'%s\'' % (kbdev[0], kbdev[1])
        zbdb.store_devices(
            kbdev[0],  #devid
            kbdev[1],  #devstr
            kbdev[2])  #devserial
    kb.close()
    doScan(zbdb, currentGPS, verbose=verbose, dblog=dblog, agressive=agressive)
    return True


# Command line main function
if __name__ == '__main__':
    # Command line parsing
    parser = argparse.ArgumentParser(description="""
Use any attached KillerBee-supported capture devices to preform a wardrive,
コード例 #3
0
# Detects attached interfaces
# Initiates scanning using doScan()
def startScan(zbdb, currentGPS, verbose=False, dblog=False, agressive=False):
    try:
        kb = KillerBee()
    except usb.USBError, e:
        if e.args[0].find('Operation not permitted') >= 0:
            print 'Error: Permissions error, try running using sudo.'
        else:
            print 'Error: USBError:', e
        return False
    except Exception, e:
        #print 'Error: Missing KillerBee USB hardware:', e
        print 'Error: Issue starting KillerBee instance:', e
        return False
    for kbdev in kbutils.devlist():
        print 'Found device at %s: \'%s\'' % (kbdev[0], kbdev[1])
        zbdb.store_devices(
            kbdev[0], #devid
            kbdev[1], #devstr
            kbdev[2]) #devserial
    kb.close()
    doScan(zbdb, currentGPS, verbose=verbose, dblog=dblog, agressive=agressive)
    return True

# Command line main function
if __name__=='__main__':
    # Command line parsing
    parser = argparse.ArgumentParser(description="""
Use any attached KillerBee-supported capture devices to preform a wardrive,
by using a single device to iterate through channels and send beacon requests
コード例 #4
0
            log_message = 'Error: USBError: {}'.format(e)
            logging.error(log_message)
            print log_message
        return False
    except Exception, e:
        log_message = 'Error: Issue starting KillerBee instance: {}'.format(e)
        logging.error(log_message)
        print log_message
        return False

    log_message = "gps: {}".format(ignore)
    if verbose:
        print log_message
    logging.info(log_message)

    devices = kbutils.devlist(gps=ignore, include=include)

    for kbdev in devices:
        log_message = 'Found device at %s: \'%s\'' % (kbdev[0], kbdev[1])
        logging.info(log_message)
        if verbose:
            print log_message

    log_message = "Sending output to {}".format(output)
    if verbose:
        print log_message
    logging.info(log_message)

    kb.close()
    doScan(devices,
           currentGPS,
コード例 #5
0
        return

# startScan
# Detects attached interfaces
# Initiates scanning using doScan()
def startScan(zbdb, currentGPS, verbose=False, dblog=False, agressive=False, include=[], ignore=None):
    try:
        kb = KillerBee()
    except USBError, e:
        if e.args[0].find('Operation not permitted') >= 0:
            print 'Error: Permissions error, try running using sudo.'
        else:
            print 'Error: USBError:', e
        return False
    except Exception, e:
        #print 'Error: Missing KillerBee USB hardware:', e
        print 'Error: Issue starting KillerBee instance:', e
        return False
    for kbdev in kbutils.devlist(gps=ignore, include=include):
        print 'Found device at %s: \'%s\'' % (kbdev[0], kbdev[1])
        zbdb.store_devices(
            kbdev[0], #devid
            kbdev[1], #devstr
            kbdev[2]) #devserial
    kb.close()
    doScan(zbdb, currentGPS, verbose=verbose, dblog=dblog, agressive=agressive)
    return True



コード例 #6
0
            log_message = 'Error: USBError: {}'.format(e)
            logging.error(log_message)
            print log_message
        return False
    except Exception, e:
        log_message = 'Error: Issue starting KillerBee instance: {}'.format(e)
        logging.error(log_message)
        print log_message
        return False

    log_message = "gps: {}".format(ignore)
    if verbose:
        print log_message
    logging.info(log_message)

    devices = kbutils.devlist(gps=ignore, include=include)

    for kbdev in devices:
        log_message = 'Found device at %s: \'%s\'' % (kbdev[0], kbdev[1])
        logging.info(log_message)
        if verbose:
            print log_message

    log_message = "Sending output to {}".format(output)
    if verbose:
        print log_message
    logging.info(log_message)

    kb.close()
    doScan(devices, currentGPS, verbose=verbose, dblog=dblog, agressive=agressive, 
           output=output, scanning_time=scanning_time, capture_time=capture_time)
コード例 #7
0
ファイル: zbwardrive.py プロジェクト: glwu/killerbee
            else:
                print "Waiting for a GPS fix."
                # TODO timeout lat/lng/alt values if too old...?
    except KeyboardInterrupt:
        print "Got KeyboardInterrupt in gpsdPoller, returning."
        return


# startScan
# Detects attached interfaces
# Initiates scanning using doScan()
def startScan(zbdb, currentGPS, verbose=False, dblog=False, agressive=False, include=[], ignore=None):
    try:
        kb = KillerBee()
    except USBError, e:
        if e.args[0].find("Operation not permitted") >= 0:
            print "Error: Permissions error, try running using sudo."
        else:
            print "Error: USBError:", e
        return False
    except Exception, e:
        # print 'Error: Missing KillerBee USB hardware:', e
        print "Error: Issue starting KillerBee instance:", e
        return False
    for kbdev in kbutils.devlist(gps=ignore, include=include):
        print "Found device at %s: '%s'" % (kbdev[0], kbdev[1])
        zbdb.store_devices(kbdev[0], kbdev[1], kbdev[2])  # devid  # devstr  # devserial
    kb.close()
    doScan(zbdb, currentGPS, verbose=verbose, dblog=dblog, agressive=agressive)
    return True