From 77c8992bcb2e4db28196b22550ebcd91b710faab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 14:33:43 +0000 Subject: [PATCH 1/4] Bump requests from 2.32.4 to 2.33.0 Bumps [requests](https://github.com/psf/requests) from 2.32.4 to 2.33.0. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.32.4...v2.33.0) --- updated-dependencies: - dependency-name: requests dependency-version: 2.33.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index a37123d0a41..68cc15aa58d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2280,9 +2280,9 @@ realtime==2.4.2 ; python_version >= "3.10" and python_version < "4.0" \ requests-file==2.1.0 ; python_version >= "3.10" and python_version < "4.0" \ --hash=sha256:0f549a3f3b0699415ac04d167e9cb39bccfb730cb832b4d20be3d9867356e658 \ --hash=sha256:cf270de5a4c5874e84599fc5778303d496c10ae5e870bfa378818f35d21bda5c -requests==2.32.4 ; python_version >= "3.10" and python_version < "4.0" \ - --hash=sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c \ - --hash=sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422 +requests==2.33.0 ; python_version >= "3.10" and python_version < "4.0" \ + --hash=sha256:3324635456fa185245e24865e810cecec7b4caf933d7eb133dcde67d48cee69b \ + --hash=sha256:c7ebc5e8b0f21837386ad0e1c8fe8b829fa5f544d8df3b2253bff14ef29d7652 rich-click==1.9.4 ; python_version >= "3.10" and python_version < "4.0" \ --hash=sha256:af73dc68e85f3bebb80ce302a642b9fe3b65f3df0ceb42eb9a27c467c1b678c8 \ --hash=sha256:d70f39938bcecaf5543e8750828cbea94ef51853f7d0e174cda1e10543767389 From 1d50e2cead48132376af0f26676258983065d052 Mon Sep 17 00:00:00 2001 From: wmetcalf Date: Fri, 27 Mar 2026 00:35:13 +0000 Subject: [PATCH 2/4] Scale guacamole VNC display to fit browser window Make the VNC display automatically scale to fill the available browser viewport without scrollbars. Adjusts mouse coordinates by the scale factor so the cursor aligns correctly with the guest display. --- web/static/css/guac-main.css | 19 ++++++++++++++++--- web/static/js/guac-main.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/web/static/css/guac-main.css b/web/static/css/guac-main.css index 4b7a016ce11..5896e3c4d32 100644 --- a/web/static/css/guac-main.css +++ b/web/static/css/guac-main.css @@ -1,12 +1,25 @@ +html, body { + margin: 0; + padding: 0; + height: 100%; + overflow: hidden; +} + +.guaconsole { + display: flex; + flex-direction: column; + height: 100vh; +} + #container { position: relative; - width: 100%; - height: 20em; + flex: 1; + overflow: hidden; } #terminal { height: 100%; - width: 100% + width: 100%; } .dialog, diff --git a/web/static/js/guac-main.js b/web/static/js/guac-main.js index 7a7319c3a5c..537f8468566 100644 --- a/web/static/js/guac-main.js +++ b/web/static/js/guac-main.js @@ -27,6 +27,33 @@ function GuacMe(element, guest_ip, vncport, session_id, recording_name) { /* Show the terminal. */ $('#terminal').append(terminal_element); + /* Scale display to fit the browser window. */ + var scaleDisplay = function() { + var display = terminal_client.getDisplay(); + var displayWidth = display.getWidth(); + var displayHeight = display.getHeight(); + if (!displayWidth || !displayHeight) return; + + var container = document.getElementById('container'); + var containerWidth = container.offsetWidth; + var containerHeight = container.offsetHeight; + if (!containerWidth || !containerHeight) return; + + var scale = Math.min( + containerWidth / displayWidth, + containerHeight / displayHeight + ); + display.scale(scale); + }; + + /* Re-scale when the display size changes (initial connect). */ + terminal_client.getDisplay().onresize = function() { + scaleDisplay(); + }; + + /* Re-scale on browser window resize. */ + window.addEventListener('resize', scaleDisplay); + /* Disconnect on tab close. */ window.onunload = function() { terminal_client.disconnect(); @@ -38,6 +65,9 @@ function GuacMe(element, guest_ip, vncport, session_id, recording_name) { mouse.onmousedown = mouse.onmouseup = mouse.onmousemove = function(mouseState) { + var scale = terminal_client.getDisplay().getScale(); + mouseState.x = mouseState.x / scale; + mouseState.y = mouseState.y / scale; terminal_client.sendMouseState(mouseState); }; From 168f8085e71c2502a19ec9d65fa0486a86857ac8 Mon Sep 17 00:00:00 2001 From: wmetcalf Date: Fri, 27 Mar 2026 02:01:02 +0000 Subject: [PATCH 3/4] Address review: debounce resize handler and use built-in scale parameter Use sendMouseState's built-in scale parameter instead of mutating the mouse's internal state object. Debounce the window resize listener to avoid excessive recalculations. --- web/static/js/guac-main.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/web/static/js/guac-main.js b/web/static/js/guac-main.js index 537f8468566..b4e2d27ea51 100644 --- a/web/static/js/guac-main.js +++ b/web/static/js/guac-main.js @@ -51,8 +51,12 @@ function GuacMe(element, guest_ip, vncport, session_id, recording_name) { scaleDisplay(); }; - /* Re-scale on browser window resize. */ - window.addEventListener('resize', scaleDisplay); + /* Re-scale on browser window resize (debounced). */ + var resizeTimeout; + window.addEventListener('resize', function() { + clearTimeout(resizeTimeout); + resizeTimeout = setTimeout(scaleDisplay, 100); + }); /* Disconnect on tab close. */ window.onunload = function() { @@ -65,10 +69,7 @@ function GuacMe(element, guest_ip, vncport, session_id, recording_name) { mouse.onmousedown = mouse.onmouseup = mouse.onmousemove = function(mouseState) { - var scale = terminal_client.getDisplay().getScale(); - mouseState.x = mouseState.x / scale; - mouseState.y = mouseState.y / scale; - terminal_client.sendMouseState(mouseState); + terminal_client.sendMouseState(mouseState, true); }; /* Keyboard handling. */ From 8d5859a96c0cc65678c8318ef1e843c23ccecd4d Mon Sep 17 00:00:00 2001 From: Kevin O'Reilly Date: Fri, 27 Mar 2026 10:48:42 +0000 Subject: [PATCH 4/4] Ruff fixes: trailing whitespace --- modules/machinery/hyperv.py | 4 ++-- modules/machinery/kvmremote.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/machinery/hyperv.py b/modules/machinery/hyperv.py index 2c19d94ea54..b3571fbc22e 100644 --- a/modules/machinery/hyperv.py +++ b/modules/machinery/hyperv.py @@ -36,7 +36,7 @@ def _initialize_check(self): self.username = self.options.hyperv.username if not self.options.hyperv.ssh_key: - raise CuckooMachineError("Hyper-V ssh private key path missing from hyperv.conf") + raise CuckooMachineError("Hyper-V ssh private key path missing from hyperv.conf") self.ssh_key = self.options.hyperv.ssh_key super(HyperV, self)._initialize_check() @@ -44,7 +44,7 @@ def _initialize_check(self): log.info("Hyper-V machinery module initialised (%s).", self.host) def run_cmd(self, cmd): - r = subprocess.Popen("ssh -i {key} {user}@{host} '{cmd}'".format(key=self.ssh_key, user=self.username, host=self.host, cmd="powershell.exe " + cmd), + r = subprocess.Popen("ssh -i {key} {user}@{host} '{cmd}'".format(key=self.ssh_key, user=self.username, host=self.host, cmd="powershell.exe " + cmd), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() return(r[0].decode().strip()) diff --git a/modules/machinery/kvmremote.py b/modules/machinery/kvmremote.py index 9d86aae39a0..eb137f0c9cf 100644 --- a/modules/machinery/kvmremote.py +++ b/modules/machinery/kvmremote.py @@ -28,7 +28,7 @@ def _initialize_check(self): for machine in self.machines(): machine.dsn = self.dsn - machine.interface = self.interface + machine.interface = self.interface super(KVMRemote, self)._initialize_check()