Exemple #1
0
    call(['sudo', 'killall', 'gpsd'])
    call(['sudo', 'gpsd', '/dev/ttyUSB0', '-F', '/var/run/gpsd.sock'])

    # creates the folder which will contain all the logs if there isnt any yet
    if not os.path.exists(constants.logs_folder):
        os.makedirs(constants.logs_folder)

    logs = [log for log in os.listdir(constants.logs_folder) if is_log(log)]

    if logs:  # if there are any logs
        log_numbers = [get_log_number(log) for log in logs
                       ]  # get the numerical values of all such logs
        log_number = max(
            log_numbers
        ) + 1  # sets the new log number to be after the last log
    else:
        log_number = 1  # defaults to 1
    log_folder = constants.logs_folder + 'log-' + str(log_number) + '/'

    # creates the folder for the new log, assuming there is none (there shouldn't be any)
    if not os.path.exists(log_folder):
        os.makedirs(log_folder)

    gps = gps_thread.GPSThread(log_folder)  # apc edit, addded log_folder param
    gps.start()
    hop = hop_ch_thread.HopChThread()  # apc edit
    hop.start()  # apc edit
    sniffing = monitor.MonitorThread(log_folder, gps)
    sniffing.start()
    shark = trace_thread.TraceThread(log_folder)  # apc edit
    shark.start()  # apc edit
Exemple #2
0
        
    logs = [log for log in os.listdir(constants.logs_folder) if is_log(log)]

    if logs: # if there are any logs
        log_numbers = [get_log_number(log) for log in logs] # get the numerical values of all such logs
        log_number = max(log_numbers) + 1 # sets the new log number to be after the last log
    else:
        log_number = 1 # defaults to 1
    log_folder = constants.logs_folder + 'log-' + str(log_number) + '/'

        
    # creates the folder for the new log, assuming there is none (there shouldn't be any)
    if not os.path.exists(log_folder):
        os.makedirs(log_folder)
    
    gps = gps_thread.GPSThread(log_folder)
    gps.start()
    hop = hop_ch_thread.HopChThread()
    hop.start()
    sniffing = monitor.MonitorThread(log_folder, gps)
    sniffing.start()
    shark = trace_thread.TraceThread(log_folder)
    shark.start()

    #uncomment this block if you want to use 1-6-11 channel hopping scheme
    '''
    z_hop = z_hop_ch_thread.HopChThread()                  
    z_hop.start()                                          
    z_sniffing = z_monitor.MonitorThread(log_folder, gps)  
    z_sniffing.start()                                     
    z_shark = z_trace_thread.TraceThread(log_folder)       
Exemple #3
0
            ) + 1  # sets the new log number to be after the last log
        else:
            log_number = 1  # defaults to 1
        log_folder = constants.logs_folder + 'log-' + str(log_number) + '/'
# creates the folder for the new log, assuming there is none (there shouldn't be any)
    if not os.path.exists(log_folder):
        os.makedirs(log_folder)

    call(['airmon-ng', 'start',
          'wlan1'])  # will create a monitoring interface on mon0

    if role == "master":
        shark = trace_thread.SharkThread()  #apc edit
        shark.start()  #apc edit

        gps = gps_thread.GPSThread()
        gps.start()
        if wait_for_gps:
            print("Waiting for the GPS to initialize...")
            while gps.lat == 0 and gps.lon == 0:
                time.sleep(1)
        if settings.window_size:
            mastery = Mastery(log_folder, "mon0", gps)
        elif settings.dist_thresh:
            mastery = DistWinMastery(log_folder, "mon0", gps)
        else:  # should never happen
            print("what do i base windowing on???")
            exit()
        endpoint = TCP4ServerEndpoint(reactor, 8110)
        endpoint.listen(mastery)
    elif role == "slave":