diff --git a/MeshCentralServer.njsproj b/MeshCentralServer.njsproj
index bc357bcb..61626db7 100644
--- a/MeshCentralServer.njsproj
+++ b/MeshCentralServer.njsproj
@@ -71,6 +71,7 @@
+
diff --git a/agents/MeshService-signed.exe b/agents/MeshService-signed.exe
index c970a1c9..830df6a9 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
new file mode 100644
index 00000000..a797546e
Binary files /dev/null and b/agents/MeshService.exe differ
diff --git a/agents/MeshService64-signed.exe b/agents/MeshService64-signed.exe
index d133a29a..e760de42 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 5769dec8..7774a110 100644
Binary files a/agents/MeshService64.exe and b/agents/MeshService64.exe differ
diff --git a/agents/meshcore.js b/agents/meshcore.js
index 2848d9de..c21fc248 100644
--- a/agents/meshcore.js
+++ b/agents/meshcore.js
@@ -1085,24 +1085,16 @@ function createMeshCore(agent) {
{
try
{
- if (((this.httprequest.protocol == 6) || (this.httprequest.protocol == 8)) && (require('win-terminal').PowerShellCapable() == true))
- {
- //if (require('win-virtual-terminal').supported)
- //{
- // this.httprequest._term = require('win-virtual-terminal').StartPowerShell(80, 25);
- //}
- //else
- //{
+ if (((this.httprequest.protocol == 6) || (this.httprequest.protocol == 8)) && (require('win-terminal').PowerShellCapable() == true)) {
+ //if (require('win-virtual-terminal').supported) {
+ //this.httprequest._term = require('win-virtual-terminal').StartPowerShell(80, 25);
+ //} else {
this.httprequest._term = require('win-terminal').StartPowerShell(80, 25); // TODO: Start as logged in used when protocol is 8
//}
- } else
- {
- //if (require('win-virtual-terminal').supported)
- //{
- // this.httprequest._term = require('win-virtual-terminal').Start(80, 25);
- //}
- //else
- //{
+ } else {
+ //if (require('win-virtual-terminal').supported) {
+ //this.httprequest._term = require('win-virtual-terminal').Start(80, 25);
+ //} else {
this.httprequest._term = require('win-terminal').Start(80, 25); // TODO: Start as logged in used when protocol is 7
//}
}
diff --git a/agents/meshcore.min.js b/agents/meshcore.min.js
index 958cb171..c21fc248 100644
--- a/agents/meshcore.min.js
+++ b/agents/meshcore.min.js
@@ -1081,14 +1081,25 @@ function createMeshCore(agent) {
};
// Remote terminal using native pipes
- if (process.platform == "win32") {
- try {
- if (((this.httprequest.protocol == 6) || (this.httprequest.protocol == 9)) && (require('win-terminal').PowerShellCapable() == true)) {
- this.httprequest._term = require('win-terminal').StartPowerShell(80, 25); // TODO: Start as logged in used when protocol is 9
+ if (process.platform == "win32")
+ {
+ try
+ {
+ if (((this.httprequest.protocol == 6) || (this.httprequest.protocol == 8)) && (require('win-terminal').PowerShellCapable() == true)) {
+ //if (require('win-virtual-terminal').supported) {
+ //this.httprequest._term = require('win-virtual-terminal').StartPowerShell(80, 25);
+ //} else {
+ this.httprequest._term = require('win-terminal').StartPowerShell(80, 25); // TODO: Start as logged in used when protocol is 8
+ //}
} else {
- this.httprequest._term = require('win-terminal').Start(80, 25); // TODO: Start as logged in used when protocol is 8
+ //if (require('win-virtual-terminal').supported) {
+ //this.httprequest._term = require('win-virtual-terminal').Start(80, 25);
+ //} else {
+ this.httprequest._term = require('win-terminal').Start(80, 25); // TODO: Start as logged in used when protocol is 7
+ //}
}
- } catch (e) {
+ } catch (e)
+ {
MeshServerLog('Failed to start remote terminal session, ' + e.toString() + ' (' + this.httprequest.remoteaddr + ')', this.httprequest);
this.write(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: e.toString() }));
this.end();
@@ -1097,8 +1108,11 @@ function createMeshCore(agent) {
this.httprequest._term.pipe(this, { dataTypeSkip: 1 });
this.pipe(this.httprequest._term, { dataTypeSkip: 1, end: false });
this.prependListener('end', function () { this.httprequest._term.end(function () { console.log("Terminal was closed"); }); });
- } else {
- try {
+ }
+ else
+ {
+ try
+ {
if (fs.existsSync('/usr/bin/python') && fs.existsSync('/bin/bash')) {
this.httprequest.process = childProcess.execFile('/usr/bin/python', ['python', '-c', "import pty; pty.spawn([\"/bin/bash\"])"], { uid: (this.httprequest.protocol == 8) ? require('user-sessions').consoleUid() : null }); // Start as active user
if (process.platform == 'linux') { this.httprequest.process.stdin.write("export TERM='xterm'\nalias ls='ls --color=auto'\nclear\n"); }
@@ -1109,7 +1123,8 @@ function createMeshCore(agent) {
this.httprequest.process = childProcess.execFile('/bin/sh', ['sh'], { type: childProcess.SpawnTypes.TERM, uid: (this.httprequest.protocol == 8)?require('user-sessions').consoleUid():null }); // Start as active user
if (process.platform == 'linux') { this.httprequest.process.stdin.write("stty erase ^H\nalias ls='ls --color=auto'\nPS1='\\u@\\h:\\w\\$ '\nclear\n"); }
}
- } catch (e) {
+ } catch (e)
+ {
MeshServerLog("Failed to start remote terminal session, " + e.toString() + ' (' + this.httprequest.remoteaddr + ')', this.httprequest);
this.write(JSON.stringify({ ctrlChannel: '102938', type: 'console', msg: e.toString() }));
this.end();
diff --git a/package.json b/package.json
index b78dda49..83574516 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "meshcentral",
- "version": "0.4.4-x",
+ "version": "0.4.4-y",
"keywords": [
"Remote Management",
"Intel AMT",
diff --git a/public/scripts/amt-terminal-0.0.2.js b/public/scripts/amt-terminal-0.0.2.js
index 3ab2e33d..4da4f5a1 100644
--- a/public/scripts/amt-terminal-0.0.2.js
+++ b/public/scripts/amt-terminal-0.0.2.js
@@ -408,14 +408,14 @@ var CreateAmtRemoteTerminal = function (divid, options) {
for (var z = 0; z < obj.width; z++) { _tscreen[y][z] = ' '; _scratt[y][z] = (7 << 6); }
}
break;
- case 'X': // Erase X characters, default 1 (untested)
- var x = 1;
+ case 'X': // Erase X characters, default 1
+ var x = 1, xx = _termx, yy = _termy;
if (argslen == 1) { x = args[0] }
- while ((x > 0) && (_termx > 0)) { _tscreen[_termy][_termx] = ' '; _termx--; x--; }
+ while ((x > 0) && (yy < obj.height)) { _tscreen[yy][xx] = ' '; xx++; x--; if (xx >= obj.width) { xx = 0; yy++; } }
break;
default:
//if (code != '@') alert(code);
- console.log('unknown terminal code', code, args, mode);
+ console.log('Unknown terminal code', code, args, mode);
break;
}
}