Пример #1
0
def main():
    global kill_flag
    parser = argparse.ArgumentParser(description='Recording websites')
    parser.add_argument('permission_type',
                        nargs=1,
                        help='Type of permissions to use. Possible values '
                        'are: normal, dangerous, systemlevel')

    setConfig(parser.parse_args())

    print("Recording POI searches starts\n")

    lf.start_logging_procedure()

    # We need to perform searches before the first actual event trigger to enable
    # the automated detection of side channel candidates
    thread = Thread(target=init_maps)
    thread.start()
    lf.wait_for_logcat(lf.LOGCAT_INIT_DONE)
    kill_flag = True
    print("Init of APIHarvester done")

    lf.kill_app(GOOGLE_MAPS)
    time.sleep(2)

    if not CHECK_CONFIGURATION:
        randomized_record.acquire_data_randomized(
            POI_SEARCH_QUERIES, config.RECORDS_PER_POI_SEARCH,
            record_maps_poi_search)
    # else:
    #    check_config()

    lf.stop_logging_app()
def main():

    print("Record activity launches\n")

    lf.start_logging_procedure()

    if not CHECK_CONFIGURATION:
        randomized_record.acquire_data_randomized(TARGET_ACTIVITIES,
                                                  config.records_per_app(),
                                                  start_stop_activity)
    else:
        check_config()

    lf.stop_logging_app()
Пример #3
0
def main():

    print("Record in mode: " + str(config.RECORD_MODE) + "\n")

    lf.start_logging_procedure()

    # Detect changes in proc files before actually triggering events
    start_stop_target_app("com.android.chrome", trigger_event=False)

    if config.RECORD_MODE == config.RecordMode.MIXED_MODE:
        # The first starts for resume launches do not qualify as actual app resumes
        COLD_START_RECORDS_PER_APP = 7
        RESUME_RECORDS_PER_APP = 9
        randomized_record.acquire_data_randomized(config.TARGET_APPS, COLD_START_RECORDS_PER_APP, start_stop_target_app)
        acquire_resume_data(config.TARGET_APPS, RESUME_RECORDS_PER_APP)
    elif config.RECORD_MODE == config.RecordMode.APP_RESUMES:
        acquire_resume_data(config.TARGET_APPS, config.records_per_app())
    elif config.RECORD_MODE == config.RecordMode.COLD_STARTS:
        randomized_record.acquire_data_randomized(config.TARGET_APPS, config.records_per_app(), start_stop_target_app)

    lf.stop_logging_app()
Пример #4
0
def main():
    parser = argparse.ArgumentParser(description='Recording app launches')
    parser.add_argument('permission_type', nargs=1, help='Type of permissions to use. Possible values '
                                                         'are: normal, dangerous, systemlevel')
    setConfig(parser.parse_args())

    print("Record websites manually\n")
    ask_for_user_action("Start exploration phase\n")
    print("Please open different websites on the phone until instructed otherwise")

    lf.start_logging_procedure()
    lf.wait_for_logcat(lf.LOGCAT_INIT_DONE)
    print("Init of APIHarvester done")
    print("Stop opening websites")
    time.sleep(2)

    ask_for_user_action("Start logging procedure\n")
    randomized_record.acquire_data_randomized(config.TARGET_WEBSITES, config.RECORDS_PER_WEBSITE, instruct_manual_launch)
    ask_for_user_action("\nStop logging app")

    destination_folder = lf.stop_logging_app()
def main():
    print("Record website starts\n")

    lf.start_logging_procedure()

    # We need to perform website launches before the first actual event trigger to enable
    # the automated detection of side channel candidates
    start_website(TARGET_WEBSITES[0], trigger_event=False)
    time.sleep(2)
    start_website(TARGET_WEBSITES[1], trigger_event=False)
    time.sleep(2)
    start_website(TARGET_WEBSITES[2], trigger_event=False)
    time.sleep(2)

    if not CHECK_CONFIGURATION:
        randomized_record.acquire_data_randomized(TARGET_WEBSITES,
                                                  RECORDS_PER_WEBSITE,
                                                  record_website)
    else:
        check_config()

    lf.stop_logging_app()
def main():
    global kill_flag
    parser = argparse.ArgumentParser(description='Recording websites')
    parser.add_argument('permission_type',
                        nargs=1,
                        help='Type of permissions to use. Possible values '
                        'are: normal, dangerous, systemlevel')
    parser.add_argument('browser',
                        nargs=1,
                        help='Browser name. Possible values '
                        'are: fennec, firefox, klar, chromium, chrome')
    setConfig(parser.parse_args())

    print("Record website starts\n")

    lf.start_logging_procedure()

    # We need to perform website launches before the first actual event trigger to enable
    # the automated detection of side channel candidates
    thread = Thread(target=init_websites)
    thread.start()
    lf.wait_for_logcat(lf.LOGCAT_INIT_DONE)
    kill_flag = True
    print("Init of APIHarvester done")
    lf.kill_app(BROWSER)
    time.sleep(2)

    if not CHECK_CONFIGURATION:
        assert len(config.TARGET_WEBSITES) == 20
        randomized_record.acquire_data_randomized(config.TARGET_WEBSITES,
                                                  config.RECORDS_PER_WEBSITE,
                                                  record_website)
    else:
        check_config()

    lf.stop_logging_app()
Пример #7
0
def main():
    global kill_flag
    parser = argparse.ArgumentParser(description='Recording app launches')
    parser.add_argument('permission_type',
                        nargs=1,
                        help='Type of permissions to use. Possible values '
                        'are: normal, dangerous, systemlevel')
    setConfig(parser.parse_args())

    print('Recording app launches (', config.TARGET_APPS, ')')
    print("Record in mode: " + str(config.RECORD_MODE) + "\n")

    lf.start_logging_procedure()

    thread = Thread(target=init_websites)
    thread.start()
    lf.wait_for_logcat(lf.LOGCAT_INIT_DONE)
    kill_flag = True
    print("Init of APIHarvester done")

    if config.RECORD_MODE == config.RecordMode.MIXED_MODE:
        # The first starts for resume launches do not qualify as actual app resumes
        COLD_START_RECORDS_PER_APP = 7
        RESUME_RECORDS_PER_APP = 9
        randomized_record.acquire_data_randomized(config.TARGET_APPS,
                                                  COLD_START_RECORDS_PER_APP,
                                                  start_stop_target_app)
        acquire_resume_data(config.TARGET_APPS, RESUME_RECORDS_PER_APP)
    elif config.RECORD_MODE == config.RecordMode.APP_RESUMES:
        acquire_resume_data(config.TARGET_APPS, config.records_per_app())
    elif config.RECORD_MODE == config.RecordMode.COLD_STARTS:
        randomized_record.acquire_data_randomized(config.TARGET_APPS,
                                                  config.records_per_app(),
                                                  start_stop_target_app)

    destination_folder = lf.stop_logging_app()