Updated Windows agents

Ylian Saint-Hilaire committed Aug 7, 2019 at 16:37 UTC 9b2f2fc2ee7c7786bc7e752b15670a6265d637e5
9 files changed +10 -16
agents/MeshCmd-signed.exe
Binary files a/agents/MeshCmd-signed.exe and b/agents/MeshCmd-signed.exe differ
agents/MeshCmd64-signed.exe
Binary files a/agents/MeshCmd64-signed.exe and b/agents/MeshCmd64-signed.exe differ
agents/MeshService-signed.exe
Binary files a/agents/MeshService-signed.exe and b/agents/MeshService-signed.exe differ
agents/MeshService.exe
Binary files a/agents/MeshService.exe and b/agents/MeshService.exe differ
agents/MeshService64-signed.exe
Binary files a/agents/MeshService64-signed.exe and b/agents/MeshService64-signed.exe differ
agents/MeshService64.exe
Binary files a/agents/MeshService64.exe and b/agents/MeshService64.exe differ
agents/meshcore.js
+4 -6
@@ -822,7 +822,6 @@ function createMeshCore(agent)
822 sendConsoleText('getScript: ' + JSON.stringify(data));
823 break;
824 }
825 - /*
825 case 'sysinfo': {
826 // Fetch system information
827 if (process.platform != 'win32') break; // Remove this when Linux/MacOS support this.
@@ -838,6 +837,7 @@ function createMeshCore(agent)
837 try { delete x.TotalVirtualMemorySize; } catch (ex) { }
838 try { delete x.TotalVisibleMemorySize; } catch (ex) { }
839 }
840 + /*
841 if (process.platform == 'win32')
842 {
843 var defragResult = function (r)
@@ -862,13 +862,13 @@ function createMeshCore(agent)
862 pr.sessionid = data.sessionid;
863 pr.then(defragResult, defragResult);
864 } else {
865 + */
866 results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex');
867 if (data.hash != results.hash) { mesh.SendCommand({ "action": "sysinfo", "sessionid": this.sessionid, "data": results }); }
867 - }
868 + //}
869 } catch (ex) { }
870 break;
871 }
871 - */
872 case 'ping': { mesh.SendCommand('{"action":"pong"}'); break; }
873 case 'pong': { break; }
874 default:
@@ -1650,7 +1650,7 @@ function createMeshCore(agent)
1650 var response = null;
1651 switch (cmd) {
1652 case 'help': { // Displays available commands
1653 - response = 'Available commands: help, info, osinfo, args, print, type, dbget, dbset, dbcompact, eval, parseuri, httpget,\r\nwslist, wsconnect, wssend, wsclose, notify, ls, ps, kill, amt, netinfo, location, power, wakeonlan, scanwifi,\r\nscanamt, setdebug, smbios, rawsmbios, toast, lock, users, sendcaps, openurl, amtreset, amtccm, amtacm,\r\namtdeactivate, amtpolicy, getscript, getclip, setclip, log, av.'; // cpuinfo, sysinfo
1653 + response = 'Available commands: help, info, osinfo, args, print, type, dbget, dbset, dbcompact, eval, parseuri, httpget,\r\nwslist, wsconnect, wssend, wsclose, notify, ls, ps, kill, amt, netinfo, location, power, wakeonlan, scanwifi,\r\nscanamt, setdebug, smbios, rawsmbios, toast, lock, users, sendcaps, openurl, amtreset, amtccm, amtacm,\r\namtdeactivate, amtpolicy, getscript, getclip, setclip, log, av, cpuinfo, sysinfo.';
1654 break;
1655 }
1656 /*
@@ -1814,7 +1814,6 @@ function createMeshCore(agent)
1814 }
1815 break;
1816 }
1817 - /*
1817 case 'cpuinfo': { // Return system information
1818 // CPU & memory utilization
1819 pr = require('sysinfo').cpuUtilization();
@@ -1850,7 +1849,6 @@ function createMeshCore(agent)
1849 }
1850 break;
1851 }
1853 - */
1852 case 'info': { // Return information about the agent and agent core module
1853 response = 'Current Core: ' + meshCoreObj.value + '.\r\nAgent Time: ' + Date() + '.\r\nUser Rights: 0x' + rights.toString(16) + '.\r\nPlatform: ' + process.platform + '.\r\nCapabilities: ' + meshCoreObj.caps + '.\r\nServer URL: ' + mesh.ServerUrl + '.';
1854 if (amt != null) { response += '\r\nBuilt-in LMS: ' + ['Disabled', 'Connecting..', 'Connected'][amt.lmsstate] + '.'; }
agents/meshcore.min.js
+4 -6
@@ -822,7 +822,6 @@ function createMeshCore(agent)
822 sendConsoleText('getScript: ' + JSON.stringify(data));
823 break;
824 }
825 - /*
825 case 'sysinfo': {
826 // Fetch system information
827 if (process.platform != 'win32') break; // Remove this when Linux/MacOS support this.
@@ -838,6 +837,7 @@ function createMeshCore(agent)
837 try { delete x.TotalVirtualMemorySize; } catch (ex) { }
838 try { delete x.TotalVisibleMemorySize; } catch (ex) { }
839 }
840 + /*
841 if (process.platform == 'win32')
842 {
843 var defragResult = function (r)
@@ -862,13 +862,13 @@ function createMeshCore(agent)
862 pr.sessionid = data.sessionid;
863 pr.then(defragResult, defragResult);
864 } else {
865 + */
866 results.hash = require('SHA384Stream').create().syncHash(JSON.stringify(results)).toString('hex');
867 if (data.hash != results.hash) { mesh.SendCommand({ "action": "sysinfo", "sessionid": this.sessionid, "data": results }); }
867 - }
868 + //}
869 } catch (ex) { }
870 break;
871 }
871 - */
872 case 'ping': { mesh.SendCommand('{"action":"pong"}'); break; }
873 case 'pong': { break; }
874 default:
@@ -1650,7 +1650,7 @@ function createMeshCore(agent)
1650 var response = null;
1651 switch (cmd) {
1652 case 'help': { // Displays available commands
1653 - response = 'Available commands: help, info, osinfo, args, print, type, dbget, dbset, dbcompact, eval, parseuri, httpget,\r\nwslist, wsconnect, wssend, wsclose, notify, ls, ps, kill, amt, netinfo, location, power, wakeonlan, scanwifi,\r\nscanamt, setdebug, smbios, rawsmbios, toast, lock, users, sendcaps, openurl, amtreset, amtccm, amtacm,\r\namtdeactivate, amtpolicy, getscript, getclip, setclip, log, av.'; // cpuinfo, sysinfo
1653 + response = 'Available commands: help, info, osinfo, args, print, type, dbget, dbset, dbcompact, eval, parseuri, httpget,\r\nwslist, wsconnect, wssend, wsclose, notify, ls, ps, kill, amt, netinfo, location, power, wakeonlan, scanwifi,\r\nscanamt, setdebug, smbios, rawsmbios, toast, lock, users, sendcaps, openurl, amtreset, amtccm, amtacm,\r\namtdeactivate, amtpolicy, getscript, getclip, setclip, log, av, cpuinfo, sysinfo.';
1654 break;
1655 }
1656 /*
@@ -1814,7 +1814,6 @@ function createMeshCore(agent)
1814 }
1815 break;
1816 }
1817 - /*
1817 case 'cpuinfo': { // Return system information
1818 // CPU & memory utilization
1819 pr = require('sysinfo').cpuUtilization();
@@ -1850,7 +1849,6 @@ function createMeshCore(agent)
1849 }
1850 break;
1851 }
1853 - */
1852 case 'info': { // Return information about the agent and agent core module
1853 response = 'Current Core: ' + meshCoreObj.value + '.\r\nAgent Time: ' + Date() + '.\r\nUser Rights: 0x' + rights.toString(16) + '.\r\nPlatform: ' + process.platform + '.\r\nCapabilities: ' + meshCoreObj.caps + '.\r\nServer URL: ' + mesh.ServerUrl + '.';
1854 if (amt != null) { response += '\r\nBuilt-in LMS: ' + ['Disabled', 'Connecting..', 'Connected'][amt.lmsstate] + '.'; }
meshagent.js
+2 -4
@@ -910,8 +910,8 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
910 try { obj.send(JSON.stringify({ action: 'amtPolicy', amtPolicy: completeIntelAmtPolicy(common.Clone(mesh.amt)) })); } catch (ex) { }
911 }
912
913 - // Fetch system information
913 /*
914 + // Fetch system information
915 db.GetHash('si' + obj.dbNodeKey, function (err, results) {
916 if ((results != null) && (results.length == 1)) { obj.send(JSON.stringify({ action: 'sysinfo', hash: results[0].hash })); } else { obj.send(JSON.stringify({ action: 'sysinfo' })); }
917 });
@@ -1306,9 +1306,8 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
1306 }
1307 break;
1308 }
1309 - /*
1309 case 'sysinfo': {
1311 - //console.log('sysinfo', obj.nodeid, JSON.stringify(command.data.hash));
1310 + console.log('sysinfo', obj.nodeid, JSON.stringify(command.data.hash));
1311 command.data._id = 'si' + obj.dbNodeKey;
1312 db.Set(command.data); // Update system information in the database.
1313 break;
@@ -1320,7 +1319,6 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
1319 });
1320 break;
1321 }
1323 - */
1322 default: {
1323 parent.agentStats.unknownAgentActionCount++;
1324 console.log('Unknown agent action (' + obj.remoteaddrport + '): ' + command.action + '.');