@letitbexai_root/lexxit-automation-framework 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -237,14 +237,57 @@ New-NetFirewallRule -DisplayName "Lexxit Agent" -Direction Inbound -Protocol TCP
|
|
|
237
237
|
Write-Host "[lexxit] Installing TightVNC..."
|
|
238
238
|
$tvncMsi = Join-Path $env:TEMP "tightvnc.msi"
|
|
239
239
|
Invoke-WebRequest -Uri $TightVncMsiUrl -OutFile $tvncMsi -UseBasicParsing
|
|
240
|
+
|
|
241
|
+
# Confirmed on a real Windows EC2 AMI: REINSTALL=ALL + REINSTALLMODE=vomus
|
|
242
|
+
# (tried first, see git history) does NOT reliably make TightVNC's MSI
|
|
243
|
+
# reapply VALUE_OF_PASSWORD on top of an already-installed copy - verified
|
|
244
|
+
# by decrypting the backend's actual stored password for a freshly
|
|
245
|
+
# re-registered agent and running it through the real VNC auth handshake
|
|
246
|
+
# directly: still rejected, even with REINSTALLMODE=vomus on the reinstall
|
|
247
|
+
# that supposedly set it. TightVNC's password-setting custom action
|
|
248
|
+
# evidently gates on something REINSTALLMODE doesn't override. An explicit
|
|
249
|
+
# uninstall first removes that "already installed" state entirely, so the
|
|
250
|
+
# following /i is always a genuine fresh install, which does apply every
|
|
251
|
+
# property correctly. /x against the same MSI package is a no-op (not an
|
|
252
|
+
# error) when TightVNC isn't installed yet, so this is safe on every run.
|
|
253
|
+
Start-Process msiexec.exe -ArgumentList @("/x", "`"$tvncMsi`"", "/quiet", "/norestart") -Wait -NoNewWindow
|
|
254
|
+
|
|
240
255
|
$msiArgs = @(
|
|
241
256
|
"/i", "`"$tvncMsi`"", "/quiet", "/norestart",
|
|
242
257
|
"ADDLOCAL=Server",
|
|
243
258
|
"SERVER_REGISTER_AS_SERVICE=1",
|
|
244
259
|
"SERVER_ADD_FIREWALL_EXCEPTION=1",
|
|
245
260
|
"SET_USEVNCAUTHENTICATION=1", "VALUE_OF_USEVNCAUTHENTICATION=1",
|
|
261
|
+
# VALUE_OF_PASSWORD on an msiexec command line is readable in plaintext
|
|
262
|
+
# by any other local user/process on this VM for the few seconds this
|
|
263
|
+
# install runs (Task Manager's "Command line" column, Get-CimInstance
|
|
264
|
+
# Win32_Process, etc.) - TightVNC's MSI has no encrypted/file-based way
|
|
265
|
+
# to set this property, only this one. Accepted deliberately: the
|
|
266
|
+
# password is random and single-use per VM (generated fresh per install
|
|
267
|
+
# token, encrypted at rest in Mongo), the exposure window is brief, and
|
|
268
|
+
# exploiting it needs local access to this exact VM during that window -
|
|
269
|
+
# not a remote or persistent risk. A real fix exists (write TightVNC's
|
|
270
|
+
# registry password directly using its fixed-key DES obfuscation,
|
|
271
|
+
# bypassing this property entirely) but was deliberately not done here:
|
|
272
|
+
# hand-rolling that obfuscation wrong fails silently into the exact same
|
|
273
|
+
# "VNC authentication failed" this script already had to debug once.
|
|
246
274
|
"SET_PASSWORD=1", "VALUE_OF_PASSWORD=$VncPassword",
|
|
247
|
-
"SET_ALLOWLOOPBACK=1", "VALUE_OF_ALLOWLOOPBACK=1"
|
|
275
|
+
"SET_ALLOWLOOPBACK=1", "VALUE_OF_ALLOWLOOPBACK=1",
|
|
276
|
+
# Without these, `msiexec /i` on a TightVNC that is ALREADY installed at
|
|
277
|
+
# the same product version silently no-ops instead of reapplying
|
|
278
|
+
# properties - VALUE_OF_PASSWORD included. That left a real VM with
|
|
279
|
+
# TightVNC still on an old password after this script re-ran (e.g. after
|
|
280
|
+
# someone changed it by hand via TightVNC's own config UI in between),
|
|
281
|
+
# while the backend had already stored the new one from this run's
|
|
282
|
+
# install token, causing the live-view proxy's VNC auth to fail with no
|
|
283
|
+
# indication why. REINSTALL=ALL + REINSTALLMODE=vomus forces msiexec to
|
|
284
|
+
# treat this as a genuine reinstall - v: run from source, o: reinstall
|
|
285
|
+
# if older/missing, m/u: rewrite machine+user registry (where TightVNC's
|
|
286
|
+
# password actually lives), s: rewrite shortcuts - so the password (and
|
|
287
|
+
# every other property above) is guaranteed to re-apply every single
|
|
288
|
+
# time this script runs, install or reinstall alike. Confirmed the hard
|
|
289
|
+
# way: a real VM's live view broke from exactly this gap.
|
|
290
|
+
"REINSTALL=ALL", "REINSTALLMODE=vomus"
|
|
248
291
|
)
|
|
249
292
|
Start-Process msiexec.exe -ArgumentList $msiArgs -Wait -NoNewWindow
|
|
250
293
|
# TightVNC's "service mode" specifically captures the active CONSOLE
|