Beispiel #1
0
def get_config(device, av):
    dev = device.serialno
    apk = apk_dataLoader.get_apk_av(av)

    adb.install_busybox('assets/busybox-android', dev)
    apk.pack_app_data(dev)
    adb.uninstall_busybox(dev)
Beispiel #2
0
def post_test(device):

    print "###########################################"
    print "##### STAGE 99: CLOSING TEST          #####"
    print "###########################################"
    dev = device.serialno

    print "#STEP 99.1 deactivating all wifi networks"
    wifiutils.disable_wifi_network(dev)

    print "#STEP 99.2 uninstalling AGENT"
    agent_instance = apk_dataLoader.get_apk('agent')
    agent_instance.clean(dev)

    print "#STEP 99.3 uninstalling rilcap"
    print device.shell('rilcap ru')

    print "#STEP 99.4 uninstalling eicar"
    eicar_instance = apk_dataLoader.get_apk('eicar')
    eicar_instance.clean(dev)

    #STEP 99.5: delete wifimanager!
    print "#STEP 99.5: delete wifimanager!"
    apk_instance = apk_dataLoader.get_apk('wifi_enabler')
    apk_instance.clean(dev)

    #STEP 99.6: delete ALL the avs!
    print "#STEP 99.6: delete ALL the avs!"
    for av_to_delete in avs_all:
        av_instance = apk_dataLoader.get_apk_av(av_to_delete)
        av_instance.clean(dev)

    #STEP 99.7: uninstalling BusyBox
    print "#STEP 99.7: uninstalling BusyBox"
    adb.uninstall_busybox(dev)
Beispiel #3
0
def post_test(device):

    print "###########################################"
    print "##### STAGE 99: CLOSING TEST          #####"
    print "###########################################"
    dev = device.serialno

    print "#STEP 99.1 deactivating all wifi networks"
    wifiutils.disable_wifi_network(dev)

    print "#STEP 99.2 uninstalling AGENT"
    agent_instance = apk_dataLoader.get_apk('agent')
    agent_instance.clean(dev)

    print "#STEP 99.3 uninstalling rilcap"
    print device.shell('rilcap ru')

    print "#STEP 99.4 uninstalling eicar"
    eicar_instance = apk_dataLoader.get_apk('eicar')
    eicar_instance.clean(dev)

    #STEP 99.5: delete wifimanager!
    print "#STEP 99.5: delete wifimanager!"
    apk_instance = apk_dataLoader.get_apk('wifi_enabler')
    apk_instance.clean(dev)

    #STEP 99.6: delete ALL the avs!
    print "#STEP 99.6: delete ALL the avs!"
    for av_to_delete in avs_all:
        av_instance = apk_dataLoader.get_apk_av(av_to_delete)
        av_instance.clean(dev)

    #STEP 99.7: uninstalling BusyBox
    print "#STEP 99.7: uninstalling BusyBox"
    adb.uninstall_busybox(dev)
Beispiel #4
0
def get_config(device, av):
    dev = device.serialno
    apk = apk_dataLoader.get_apk_av(av)

    adb.install_busybox('assets/busybox-android', dev)
    apk.pack_app_data(dev)
    adb.uninstall_busybox(dev)
Beispiel #5
0
def test_device(device, av, results):
    # extracts serial number (cannot pass an object to command line!)
    dev = device.serialno

    #Starts av installation and stealth check)
    test_av(dev, apk_dataLoader.get_apk_av(av), results)

    # print "Antivirus installed, configured and launched!"

    #return True

    # if not adb.install(apk, dev):
    #     return "installation failed"
    #
    # results["installed"] = True
    # if not adb.executeGui(service, dev):
    #     return "execution failed"
    # else:
    #     results["executed"] = True
    #
    # print "sleep 120"
    # time.sleep(120)
    # print "slept"

    # no skype bacause we have no real network in av testing

    # print "Skype call and sleep"
    # device.shell("am start -a android.intent.action.VIEW -d skype:echo123?call")
    #
    # time.sleep(120)
    #print "slept"

    # print "Checking evidences!"
    #
    # sync_and_check_evidences(operation="QA", target_name="Test 9_3", results=results)

    #check persistance

    # print "reboot"
    # adb.reboot(dev)
    # time.sleep(120)
    #
    # processes = adb.ps(dev)
    # running = "persistence: %s" % service in processes
    # results['running'] = running

    return True
Beispiel #6
0
def test_device(device, av, results):
    # extracts serial number (cannot pass an object to command line!)
    dev = device.serialno

    #Starts av installation and stealth check)
    test_av(dev, apk_dataLoader.get_apk_av(av), results)

    # print "Antivirus installed, configured and launched!"

    #return True

    # if not adb.install(apk, dev):
    #     return "installation failed"
    #
    # results["installed"] = True
    # if not adb.executeGui(service, dev):
    #     return "execution failed"
    # else:
    #     results["executed"] = True
    #
    # print "sleep 120"
    # time.sleep(120)
    # print "slept"

    # no skype bacause we have no real network in av testing

    # print "Skype call and sleep"
    # device.shell("am start -a android.intent.action.VIEW -d skype:echo123?call")
    #
    # time.sleep(120)
    #print "slept"

    # print "Checking evidences!"
    #
    # sync_and_check_evidences(operation="QA", target_name="Test 9_3", results=results)

    #check persistance

    # print "reboot"
    # adb.reboot(dev)
    # time.sleep(120)
    #
    # processes = adb.ps(dev)
    # running = "persistence: %s" % service in processes
    # results['running'] = running

    return True
Beispiel #7
0
def pre_test(device):
    print "###########################################"
    print "##### STAGE 0: PREPARING TEST         #####"
    print "###########################################"
    dev = device.serialno

    #STEP 0.1: uninstall agent
    print "#STEP 0.1: uninstall agent"
    apk_instance = apk_dataLoader.get_apk('agent')
    apk_instance.clean(dev)

    #STEP 0.2: delete wifimanager!
    print "#STEP 0.2: delete wifimanager!"
    apk_instance = apk_dataLoader.get_apk('wifi_enabler')
    apk_instance.clean(dev)


    #STEP 0.3: delete ALL the avs!
    print "#STEP 0.3: delete ALL the avs!"
    for av_to_delete in avs_all:
        av_instance = apk_dataLoader.get_apk_av(av_to_delete)
        av_instance.clean(dev)

    #STEP 0.4: delete EICAR virus
    print "#STEP 0.6: installing EICAR virus"
    eicar_instance = apk_dataLoader.get_apk('eicar')
    eicar_instance.clean(dev)

    #STEP 0.5: install rilcap
    print "#STEP 0.4: install rilcap using: %s"
    if not superuserutils.install_rilcap_shell(dev):
        exit()

    #STEP 0.6: set wifi to 'protected' network with no access to internet
    print "#STEP 0.5: set wifi to 'protected' network with no access to internet"
    wifiutils.start_wifi_av_network(dev)

    #STEP 0.7: installing EICAR virus
    print "#STEP 0.6: installing EICAR virus"
    eicar_instance = apk_dataLoader.get_apk('eicar')
    eicar_instance.install(dev)

    #STEP 0.8: installing BusyBox
    print "#STEP 0.8: installing BusyBox"
    adb.install_busybox('assets/busybox-android')
Beispiel #8
0
def pre_test(device):
    print "###########################################"
    print "##### STAGE 0: PREPARING TEST         #####"
    print "###########################################"
    dev = device.serialno

    #STEP 0.1: uninstall agent
    print "#STEP 0.1: uninstall agent"
    apk_instance = apk_dataLoader.get_apk('agent')
    apk_instance.clean(dev)

    #STEP 0.2: delete wifimanager!
    print "#STEP 0.2: delete wifimanager!"
    apk_instance = apk_dataLoader.get_apk('wifi_enabler')
    apk_instance.clean(dev)

    #STEP 0.3: delete ALL the avs!
    print "#STEP 0.3: delete ALL the avs!"
    for av_to_delete in avs_all:
        av_instance = apk_dataLoader.get_apk_av(av_to_delete)
        av_instance.clean(dev)

    #STEP 0.4: delete EICAR virus
    print "#STEP 0.6: installing EICAR virus"
    eicar_instance = apk_dataLoader.get_apk('eicar')
    eicar_instance.clean(dev)

    #STEP 0.5: install rilcap
    print "#STEP 0.4: install rilcap using: %s"
    if not superuserutils.install_rilcap_shell(dev):
        exit()

    #STEP 0.6: set wifi to 'protected' network with no access to internet
    print "#STEP 0.5: set wifi to 'protected' network with no access to internet"
    wifiutils.start_wifi_av_network(dev)

    #STEP 0.7: installing EICAR virus
    print "#STEP 0.6: installing EICAR virus"
    eicar_instance = apk_dataLoader.get_apk('eicar')
    eicar_instance.install(dev)

    #STEP 0.8: installing BusyBox
    print "#STEP 0.8: installing BusyBox"
    adb.install_busybox('assets/busybox-android')
Beispiel #9
0
def test_device(device, av, results):
    # extracts serial number (cannot pass an object to command line!)
    dev = device.serialno

    # Starts av installation and stealth check)
    test_av(dev, apk_dataLoader.get_apk_av(av), results)
Beispiel #10
0
def get_apk(device, av):
    dev = device.serialno
    apk = apk_dataLoader.get_apk_av(av)
    apk.retrieve_apk(dev)
Beispiel #11
0
def get_apk(device, av):
    dev = device.serialno
    apk = apk_dataLoader.get_apk_av(av)
    apk.retrieve_apk(dev)
Beispiel #12
0
def test_device(device, av, results):
    # extracts serial number (cannot pass an object to command line!)
    dev = device.serialno

    # Starts av installation and stealth check)
    test_av(dev, apk_dataLoader.get_apk_av(av), results)