diff --git a/agents/MeshCmd-signed.exe b/agents/MeshCmd-signed.exe index 9a21d7e9..f02a6757 100644 Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ diff --git a/agents/MeshCmd64-signed.exe b/agents/MeshCmd64-signed.exe index 0a3bfd2c..cd60f7a4 100644 Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ diff --git a/agents/MeshService-signed.exe b/agents/MeshService-signed.exe index 37fcd943..a673453b 100644 Binary files a/agents/MeshService-signed.exe and b/agents/MeshService-signed.exe differ diff --git a/agents/MeshService.exe b/agents/MeshService.exe index 2002d607..7d375e56 100644 Binary files a/agents/MeshService.exe and b/agents/MeshService.exe differ diff --git a/agents/MeshService64-signed.exe b/agents/MeshService64-signed.exe index 90c9e18c..b28ab917 100644 Binary files a/agents/MeshService64-signed.exe and b/agents/MeshService64-signed.exe differ diff --git a/agents/MeshService64.exe b/agents/MeshService64.exe index db87bc90..84242095 100644 Binary files a/agents/MeshService64.exe and b/agents/MeshService64.exe differ diff --git a/agents/meshcore.js b/agents/meshcore.js index e4330551..3b2e8b73 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -768,13 +768,20 @@ function createMeshCore(agent) { //sendConsoleText('setClip: ' + JSON.stringify(data)); if (typeof data.data == 'string') { MeshServerLog('Setting clipboard content, ' + data.data.length + ' byte(s)', data); - if (typeof data.data == 'string') { - if (require('MeshAgent').isService) { require('clipboard').dispatchWrite(data.data); } else { require("clipboard")(data.data); } // Set the clipboard - mesh.SendCommand({ "action": "msg", "type": "setclip", "sessionid": data.sessionid, "success": true }); - } + if (require('MeshAgent').isService) { require('clipboard').dispatchWrite(data.data); } else { require("clipboard")(data.data); } // Set the clipboard + mesh.SendCommand({ "action": "msg", "type": "setclip", "sessionid": data.sessionid, "success": true }); } break; } + case 'userSessions': { + // Send back current user sessions list, this is Windows only. + //sendConsoleText('userSessions: ' + JSON.stringify(data)); + if (process.platform != 'win32') break; + var p = require('user-sessions').enumerateUsers(); + p.sessionid = data.sessionid; + p.then(function (u) { mesh.SendCommand({ 'action': 'msg', 'type': 'userSessions', 'sessionid': u.sessionid, 'data': u }); }); + break; + } default: // Unknown action, ignore it. break; @@ -1088,6 +1095,7 @@ function createMeshCore(agent) { // Handle tunnel data if (this.httprequest.protocol == 0) { // 1 = Terminal (admin), 2 = Desktop, 5 = Files, 6 = PowerShell (admin), 7 = Plugin Data Exchange, 8 = Terminal (user), 9 = PowerShell (user) // Take a look at the protocol + if ((data.length > 3) && (data[0] == '{')) { onTunnelControlData(data, this); return; } this.httprequest.protocol = parseInt(data); if (typeof this.httprequest.protocol != 'number') { this.httprequest.protocol = 0; } if ((this.httprequest.protocol == 1) || (this.httprequest.protocol == 6) || (this.httprequest.protocol == 8) || (this.httprequest.protocol == 9)) { @@ -1260,8 +1268,13 @@ function createMeshCore(agent) { return; } + // Look for a TSID + var tsid = null; + if ((this.httprequest.xoptions != null) && (typeof this.httprequest.xoptions.tsid == 'number')) { tsid = this.httprequest.xoptions.tsid; } + if (require('MeshAgent')._tsid != null) { tsid = require('MeshAgent')._tsid; } + // Remote desktop using native pipes - this.httprequest.desktop = { state: 0, kvm: mesh.getRemoteDesktopStream(require('MeshAgent')._tsid == null ? undefined : require('MeshAgent')._tsid), tunnel: this }; + this.httprequest.desktop = { state: 0, kvm: mesh.getRemoteDesktopStream(tsid), tunnel: this }; this.httprequest.desktop.kvm.parent = this.httprequest.desktop; this.desktop = this.httprequest.desktop; @@ -1742,7 +1755,12 @@ function createMeshCore(agent) { return; } - if (obj.type == 'close') { + if (obj.type == 'options') { + // These are additional connection options passed in the control channel. + //sendConsoleText('options: ' + JSON.stringify(obj)); + delete obj.type; + ws.httprequest.xoptions = obj; + } else if (obj.type == 'close') { // We received the close on the websocket //sendConsoleText('Tunnel #' + ws.tunnel.index + ' WebSocket control close'); try { ws.close(); } catch (e) { } @@ -1982,10 +2000,7 @@ function createMeshCore(agent) { var v = []; for(var i in u) { - if(u[i].State == 'Active') - { - v.push({ tsid: i, type: u[i].StationName, user: u[i].Username }); - } + if(u[i].State == 'Active') { v.push({ tsid: i, type: u[i].StationName, user: u[i].Username, domain: u[i].Domain }); } } sendConsoleText(JSON.stringify(v, null, 1), this.sessionid); }); diff --git a/package.json b/package.json index 65b5d472..4de5aec2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "meshcentral", - "version": "0.4.5-s", + "version": "0.4.5-t", "keywords": [ "Remote Management", "Intel AMT", diff --git a/public/scripts/agent-redir-ws-0.1.1.js b/public/scripts/agent-redir-ws-0.1.1.js index 4dbdce82..7488a6e7 100644 --- a/public/scripts/agent-redir-ws-0.1.1.js +++ b/public/scripts/agent-redir-ws-0.1.1.js @@ -14,6 +14,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au obj.rauthCookie = rauthCookie; obj.State = 0; obj.nodeid = null; + obj.options = null; obj.socket = null; obj.connectstate = -1; obj.tunnelid = Math.random().toString(36).substring(2); // Generate a random client tunnel id @@ -101,6 +102,7 @@ var CreateAgentRedirect = function (meshserver, module, serverPublicNamePort, au if (obj.State < 3) { if ((e.data == 'c') || (e.data == 'cr')) { if (e.data == 'cr') { obj.serverIsRecording = true; } + if (obj.options != null) { delete obj.options.action; obj.options.type = 'options'; try { obj.socket.send(JSON.stringify(obj.options)); } catch (ex) { } } try { obj.socket.send(obj.protocol); } catch (ex) { } obj.xxStateChange(3); diff --git a/views/default-min.handlebars b/views/default-min.handlebars index b95390c3..0437c2e5 100644 --- a/views/default-min.handlebars +++ b/views/default-min.handlebars @@ -1,4 +1,4 @@ -{{{StartGeoLocation}}}{{{EndGeoLocation}}}{{{title}}}
{{{title}}}
{{{title2}}}

 

{{{StartGeoLocation}}}{{{EndGeoLocation}}}{{{title}}}
{{{title}}}
{{{title2}}}

 

{{{StartGeoLocation}}}{{{EndGeoLocation}}}{{{title}}}
{{{title}}}
{{{title2}}}

 

{{{StartGeoLocation}}}{{{EndGeoLocation}}}{{{title}}}
{{{title}}}
{{{title2}}}

 

{{{StartGeoLocation}}}{{{EndGeoLocation}}}{{{title}}}
{{{title}}}
{{{title2}}}

 

{{{StartGeoLocation}}}{{{EndGeoLocation}}}{{{title}}}
{{{title}}}
{{{title2}}}

 

{{{StartGeoLocation}}}{{{EndGeoLocation}}}{{{title}}}
{{{title}}}
{{{title2}}}

 

{{{StartGeoLocation}}}{{{EndGeoLocation}}}{{{title}}}
{{{title}}}
{{{title2}}}

 

{{{StartGeoLocation}}}{{{EndGeoLocation}}}{{{title}}}
{{{title}}}
{{{title2}}}

 

{{{StartGeoLocation}}}{{{EndGeoLocation}}}{{{title}}}
{{{title}}}
{{{title2}}}