File size: 425 Bytes
49aa045 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | """Harbor invokes this inside the puzzle service after stopping the agent."""
import json
import pathlib
import urllib.request
with urllib.request.urlopen("http://127.0.0.1:8000/state", timeout=10) as response:
state = json.load(response)
state["collected_from_live_service"] = True
target = pathlib.Path("/evidence/final.json")
temp = target.with_suffix(".tmp")
temp.write_text(json.dumps(state))
temp.replace(target)
|