1win7-agent -- remote computer-use listener for Windows 7 x64
2============================================================
3
4WHAT IT DOES
5 Listens on port 8777 and executes AutoHotkey scripts and shell commands sent
6 by the controller, returning their output plus a screenshot of this desktop.
7
8SETUP
9 1. Copy this whole folder anywhere on the machine, e.g. C:\win7-agent
10 (keep the vendor\ subfolder next to agent.py -- do not move pieces apart).
11 2. Double-click run.bat. A console window opens and prints "listening ...".
12 3. When Windows Firewall pops up, click "Allow access" so the controller can
13 reach port 8777.
14
15VM AUTOSTART
16 On the isolated QEMU build VM only, run install-autostart.cmd as administrator
17 and restart. It disables UAC, reads the clone hostname and token from its
18 instance CD, renames the guest on first boot, and starts this agent at login.
19 Do not use it on a physical or network-reachable Windows machine.
20
21IMPORTANT
22 - Must run in the interactive, logged-in desktop session (just double-click
23 it). Do NOT install it as a Windows service -- a service has no desktop and
24 AutoHotkey cannot move the mouse or type.
25 - The agent holds the display and the machine awake by itself while it runs,
26 so you do not need to change the power plan. Two things it CANNOT hold off,
27 which will silently break every screenshot and keystroke until someone logs
28 back in -- turn both off once:
29 * Screen saver: right-click desktop > Personalize > Screen Saver, set
30 "(None)", and clear "On resume, display logon screen".
31 * Lock: do not press Win+L, and if the machine is on a domain policy that
32 locks it, that policy has to go.
33 A locked session moves the desktop to Winlogon, where nothing this agent
34 does can reach. The monitor merely powering off is fine -- screenshots
35 still work with the screen dark.
36 - Set display scaling to 100%: Control Panel > Display > "Smaller - 100%",
37 then log out and back in. Any other scaling shifts screenshot pixels away
38 from click coordinates and every click lands in the wrong place.
39 - If python.exe fails complaining about api-ms-win-crt-runtime-l1-1-0.dll,
40 run vendor\vc_redist.x64.exe once, then start run.bat again.
41 - Leave the console window open; closing it stops the agent. A crash leaves
42 the window up (pause) so you can read the error.
43 - Everything is also written to agent.log beside agent.py: one timestamped
44 line per request, followed by the exact AutoHotkey script or cmd command
45 that ran, indented with "|". It appends forever and is never rotated, so
46 delete it yourself if it gets large.
47
48SHARE (needed for the OneNote work)
49 Map the NAS share to A: once, from a normal cmd window:
50 net use A: \\zenith\agent /user:agent agent /persistent:yes
51 If the hostname does not resolve, use \\10.0.0.1\agent instead. Check it
52 stuck with: net use
53
54TOKEN (optional)
55 To require a shared secret, put it in a file named token.txt beside run.bat
56 (single line). The controller must then send the same value. No file means
57 no authentication.