From 39541f875532aea427e7973e0da1da21027ab555 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 24 Nov 2020 19:56:59 -0800 Subject: [PATCH] Fixes Intel AMT MEI calls. --- agents/MeshCmd-signed.exe | Bin 4371776 -> 4371944 bytes agents/MeshCmd64-signed.exe | Bin 3981120 -> 3981288 bytes agents/MeshService-signed.exe | Bin 3359144 -> 3359144 bytes agents/MeshService64-signed.exe | Bin 2968488 -> 2968488 bytes agents/meshcmd.js | 5 ++++- agents/modules_meshcmd/amt-mei.js | 30 +++++++++++++------------- agents/modules_meshcore/amt-manage.js | 2 +- agents/modules_meshcore/amt-mei.js | 30 +++++++++++++------------- certoperations.js | 10 +++++++++ db.js | 5 +++-- 10 files changed, 48 insertions(+), 34 deletions(-) diff --git a/agents/MeshCmd-signed.exe b/agents/MeshCmd-signed.exe index 579e630cdc908c1a0c28a78166a6fe9f717ac9c2..1c765ac57f79f792929c1780a4b8c5cdfbf082b9 100644 GIT binary patch delta 1494 zcmZwBeK6Ds7zc2_pOu$dFH3YRyYjLx7He(Z-*!*O>8QCBQC?yl*-q9=FW6WRe%9%U8$bbT>AF2EJI0e9d5Jb@SRZbqm+ual)UOFkIw7!EIWb82)dhv-QR-yw}QWtq@; zoRl_1}a< zaVKUGIouS^mx2>gqIYsRv7eLaGM`ma<#8WF-2Wf!N=o>VOd`_6VJCb5t2yihn~9*Q zH0j|gb`Jfop63MH^-cC$48%dQG9PSnw*en<=%5viR$iz>uZ;K}NBsk)Z%v9qWDkOG z&Jdef)$Cb4`moWnzI~XW+pk~LW%ly<5!#A8WA{IQr4-{s1a99KOzp44bsZac+EUe% z|9r`4=%_T|GCNn0RMFSEssARgYp@uTGsoY|YMcAo!ix}1ED1E*_+o8OfU`@6_IHM? z_ZXJ0{%kk8J1iP&Yo)@q+*R72kaV$h72+{#t{+uCC((H5+1+aryjVz;6cIGo1v{+j zJKE9dgNM?BD5sp&Ub#kH9c*B3oi{9f*>FC7Gu~dSzez4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o zusblkR71Hf33te=O|}ni7xx@^+S;3HU!{Ju?lh5^gZ=3%cG^Bohc9ID^jt*xcbk}# zi|6`JzK*nxI2;A%zqt&V+_H;*6w zrsf^6l%urXj#gk&@foTbMFr9~&Mj3hXuu1Swm4zvLbJl=ZL;P~nw_n#cLD?1_|$NV zgvK6Q6NZv=Yp+33VSoMX(k?zK)BWtYinSzjPHfwUJ|wd#t~q##avdYfUQrUZE_ddR zV{Ia>!PX{{^!)atf+ALxzEekth--ur8_XHMc-w+jvbdLpXos-D)r*;XVxvhF@{;-S zojGaISFSR=h97U~GcYp^eV~kc|HStl(XT15UX?3w_mef2=Wg<$&zNca~0WZjq_B`kcf(&?%Q* z@EV$l7_fZkjtU%JJ|0(r`x_ZNZqEP! diff --git a/agents/MeshCmd64-signed.exe b/agents/MeshCmd64-signed.exe index 3c055d76fb22e294bb83929744b39d397dc08694..f5619540972097d8e5a237c98ac42143bfd98485 100644 GIT binary patch delta 1470 zcmZwCeK6E{90&0Itxc_`@@z%cgOhH`Zk4XZ~-h>?zEV;oJ%eQvJl{^>LGn)%FpzMuDezMY@uk*U>rVo_8$|wv21)<})&OO&7OVqUpaN8Z8c+usU_ICXG=Ub-20B0&=mC9T z0C2z%Yy?KY7;FM201r&TH()a`1LnX25C9Qa0utB)$W4RDRsuDPvNjE|-3qLLHK2fP zfC_AYEwBSLU=OwfhbF|9J{d2OVi_2XNY-JVFE5luMU*1{8C2(VigwG>_q}GFBD3Pi%Fy3F*oFjScMAp}~{+kdi8Tb=;7Kh9F zS}>a%9>HNneNLvd($ypjrF1>5|1XF=#Qudyz?0L0%IJX66ja8vMbJF55zTKlJ^0yEHo+(OK3SYAXchas^4%D7-OKj`kJ!EY_e3Gme z#$>&gm=(ELHD~8=M%evcw%_63d7FmSD9W$4WXAb;{`vE0u~VfqOV6QMwLL<6CU;ca z?H@7iA?d^TMZ&Kvluj{bb)$xEO#~}61dY4L4UJAN-%Hp1q!U4<<#`A+efLjKbGX>y z<38zz$g0Klo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|BzH8SZt<7#&`M?~>q%?c49PAo Wno6h|U}g7`%TKFE3_@R3nEeCbggaCK diff --git a/agents/MeshService64-signed.exe b/agents/MeshService64-signed.exe index d4fec042a9297836128ea789491655294d2987b4..9d85239c7260a24405febf9f70ef4bf084d71187 100644 GIT binary patch delta 730 zcmWl|3oz3G8~|W5vYPUYC9{~tydUGp>!w|c&?(O-^FJ!vd7a8oTS!8u^N!|LNYhwK z@+ObMk<@veao1Id2+QlztY6>VCn#w|31Iy_lzehgdNwLE8}+|DL_-Cr2=_rHh=Kdz z0f>dl@E|+{RiG+VgX&NNYQn=%3u;3gJOXv#QK$>?P!AH|F{lp>AQ2iu5)T=4AZfC{0h)ajW7YKtqxu(f#+XhxttBXYkvuyaPY`;DPIdC@c2_x# z^ZA6wcNXbsh}-fKs{eCE{8en>e6!?jVtQ(bK6+?tZ;Kx?$7^D)wT#qO=W9}O@_VY%;Q$VQ5Ezxzkj-(VD2ol))_RT|2x zc3`*9KNuYjVA!8nWN~G3HQTF=48fFeT9)eiZ4K!r4}A61xnH{TQNr53zU02Env0!G z!aI0BpBlqW4k5JWR%z}P%exDaVj7+w(`6Xk7hT?3Pha@mpF$}(D_#vFR_-Yhv|`tH zD2m3K-h#G=h||Qtj}A{?Nu~y`X#(@hZ_a3r>b>K|e@);jd+3*FVRiMtlGO delta 730 zcmWl|3osJ^7y#h*h=pN{c~oq+62`{P$a5#JJ0oLAq~*Lix#P|=YnFKp$FCd0!^VAG>1pwF?bwWKubu3BxnW6kOEJ@lh7KT zf;P|=+VzPM)G>by-G$~tr#aH4VS!Yxz)=rP7#l0k4}YX5kC(*Q$(zO%&kYp=1)XFR%1~%d%SR5O|B&nJsOnpxZA0|*~f6Ueba0D*W_)3eZ zL*80ifqe;IHom*LN_@-t7=Iqk+hR|x*oUfm@R|EG*QmtA;f~;;U}8>}KqqV9xlz$y zzk%75-4a$OQP-1gN3N`t63m-K*qsoC+uruh;&rBi#rV*TY0ar#kE>y26Eln+Wh`vRde*D@_TtM)+uE=ezf9HJ5w-vE}4s*cwmW+h}Clz(bw}= z)dRfYP=;5{g}h!_DTOFJSk5MvwHlkMT3weMIK@?iucrq;M>%cOGIw~4XQe#1hxhAd z8|c-adNS&^w+21Ws$-Syc}ZO%{ZA`zgzXt6%-@v16!<#lu5@}Vu0*oC558)9AV*Bn OMrEmI(22jw)c*i?wltUk diff --git a/agents/meshcmd.js b/agents/meshcmd.js index ab3c3f5c..44d2291d 100644 --- a/agents/meshcmd.js +++ b/agents/meshcmd.js @@ -498,7 +498,10 @@ function run(argv) { exitOnCount = handles.length; for (var i = 0; i < handles.length; ++i) { this.getCertHashEntry(handles[i], function (result) { - console.log(result.name + ', (' + (result.isDefault ? 'Default' : '') + (result.isActive ? ', Active' : ', Disabled') + ')\r\n ' + result.hashAlgorithmStr + ': ' + result.certificateHash); + var certState = []; + if (result.isDefault) { certState.push('Default'); } + if (result.isActive) { certState.push('Active'); } else { certState.push('Disabled'); } + console.log(result.name + ', (' + certState.join(', ') + ')\r\n ' + result.hashAlgorithmStr + ': ' + result.certificateHash); if (--exitOnCount == 0) { exit(1); } }); } diff --git a/agents/modules_meshcmd/amt-mei.js b/agents/modules_meshcmd/amt-mei.js index 304ac35d..a2aac279 100644 --- a/agents/modules_meshcmd/amt-mei.js +++ b/agents/modules_meshcmd/amt-mei.js @@ -365,30 +365,30 @@ function amt_heci() { fn.apply(this, opt); }, callback, optional); } - this.startConfiguration = function startConfiguration() { + this.startConfiguration = function startConfiguration(callback) { var optional = []; - for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } - this.sendCommand(0x29, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); + for (var i = 1; i < arguments.length; ++i) { optional.push(arguments[i]); } + this.sendCommand(0x29, null, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); } - this.stopConfiguration = function stopConfiguration() { + this.stopConfiguration = function stopConfiguration(callback) { var optional = []; - for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } - this.sendCommand(0x5E, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); + for (var i = 1; i < arguments.length; ++i) { optional.push(arguments[i]); } + this.sendCommand(0x5E, null, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); } - this.openUserInitiatedConnection = function openUserInitiatedConnection() { + this.openUserInitiatedConnection = function openUserInitiatedConnection(callback) { var optional = []; - for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } - this.sendCommand(0x44, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); + for (var i = 1; i < arguments.length; ++i) { optional.push(arguments[i]); } + this.sendCommand(0x44, null, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); } - this.closeUserInitiatedConnection = function closeUnserInitiatedConnected() { + this.closeUserInitiatedConnection = function closeUnserInitiatedConnected(callback) { var optional = []; - for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } - this.sendCommand(0x45, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); + for (var i = 1; i < arguments.length; ++i) { optional.push(arguments[i]); } + this.sendCommand(0x45, null, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); } - this.getRemoteAccessConnectionStatus = function getRemoteAccessConnectionStatus() { + this.getRemoteAccessConnectionStatus = function getRemoteAccessConnectionStatus(callback) { var optional = []; - for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } - this.sendCommand(0x46, data, function (header, fn, opt) { + for (var i = 1; i < arguments.length; ++i) { optional.push(arguments[i]); } + this.sendCommand(0x46, null, function (header, fn, opt) { if (header.Status == 0) { var hostname = v.slice(14, header.Data.readUInt16LE(12) + 14).toString() opt.unshift({ status: header.Status, networkStatus: header.Data.readUInt32LE(0), remoteAccessStatus: header.Data.readUInt32LE(4), remoteAccessTrigger: header.Data.readUInt32LE(8), mpsHostname: hostname, raw: header.Data }); diff --git a/agents/modules_meshcore/amt-manage.js b/agents/modules_meshcore/amt-manage.js index 2827fff3..d3281842 100644 --- a/agents/modules_meshcore/amt-manage.js +++ b/agents/modules_meshcore/amt-manage.js @@ -97,7 +97,7 @@ function AmtManager(agent, db, isdebug) { } } amtMei.getProvisioningMode(function (result) { if (result) { amtMeiTmpState.ProvisioningMode = result.mode; } }); - amtMei.getProvisioningState(function (result) { if (result) { amtMeiTmpState.ProvisioningState = result.state; } }); // 0: "Not Activated (Pre)", 1: "Not Activated (In)", 2: "Activated" + amtMei.getProvisioningState(function (result) { if (result) { amtMeiTmpState.ProvisioningState = result.state; if (result.state != 2) { amtMei.stopConfiguration(function () { }); } } }); // 0: "Not Activated (Pre)", 1: "Not Activated (In)", 2: "Activated". Make sure to stop remote configuration if needed. amtMei.getEHBCState(function (result) { if ((result != null) && (result.EHBC == true)) { amtMeiTmpState.Flags += 1; } }); amtMei.getControlMode(function (result) { if (result != null) { if (result.controlMode == 1) { amtMeiTmpState.Flags += 2; } if (result.controlMode == 2) { amtMeiTmpState.Flags += 4; } } }); // Flag 2 = CCM, 4 = ACM //amtMei.getMACAddresses(function (result) { if (result) { amtMeiTmpState.mac = result; } }); diff --git a/agents/modules_meshcore/amt-mei.js b/agents/modules_meshcore/amt-mei.js index 304ac35d..a2aac279 100644 --- a/agents/modules_meshcore/amt-mei.js +++ b/agents/modules_meshcore/amt-mei.js @@ -365,30 +365,30 @@ function amt_heci() { fn.apply(this, opt); }, callback, optional); } - this.startConfiguration = function startConfiguration() { + this.startConfiguration = function startConfiguration(callback) { var optional = []; - for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } - this.sendCommand(0x29, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); + for (var i = 1; i < arguments.length; ++i) { optional.push(arguments[i]); } + this.sendCommand(0x29, null, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); } - this.stopConfiguration = function stopConfiguration() { + this.stopConfiguration = function stopConfiguration(callback) { var optional = []; - for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } - this.sendCommand(0x5E, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); + for (var i = 1; i < arguments.length; ++i) { optional.push(arguments[i]); } + this.sendCommand(0x5E, null, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); } - this.openUserInitiatedConnection = function openUserInitiatedConnection() { + this.openUserInitiatedConnection = function openUserInitiatedConnection(callback) { var optional = []; - for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } - this.sendCommand(0x44, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); + for (var i = 1; i < arguments.length; ++i) { optional.push(arguments[i]); } + this.sendCommand(0x44, null, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); } - this.closeUserInitiatedConnection = function closeUnserInitiatedConnected() { + this.closeUserInitiatedConnection = function closeUnserInitiatedConnected(callback) { var optional = []; - for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } - this.sendCommand(0x45, data, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); + for (var i = 1; i < arguments.length; ++i) { optional.push(arguments[i]); } + this.sendCommand(0x45, null, function (header, fn, opt) { opt.unshift(header.Status); fn.apply(this, opt); }, callback, optional); } - this.getRemoteAccessConnectionStatus = function getRemoteAccessConnectionStatus() { + this.getRemoteAccessConnectionStatus = function getRemoteAccessConnectionStatus(callback) { var optional = []; - for (var i = 2; i < arguments.length; ++i) { optional.push(arguments[i]); } - this.sendCommand(0x46, data, function (header, fn, opt) { + for (var i = 1; i < arguments.length; ++i) { optional.push(arguments[i]); } + this.sendCommand(0x46, null, function (header, fn, opt) { if (header.Status == 0) { var hostname = v.slice(14, header.Data.readUInt16LE(12) + 14).toString() opt.unshift({ status: header.Status, networkStatus: header.Data.readUInt32LE(0), remoteAccessStatus: header.Data.readUInt32LE(4), remoteAccessTrigger: header.Data.readUInt32LE(8), mpsHostname: hostname, raw: header.Data }); diff --git a/certoperations.js b/certoperations.js index 811ce9ad..4dadcfed 100644 --- a/certoperations.js +++ b/certoperations.js @@ -251,6 +251,16 @@ module.exports.CertificateOperations = function (parent) { v.value = 'rootcert.meshcentral.com'; setupbin.records[0].variables.push(v); + /* + // Create "ME Provision Halt Active" variable + v = {}; + v.moduleid = 2; + v.varid = 28; + v.length = -1; + v.value = 1; + setupbin.records[0].variables.push(v); + */ + // Write to log file obj.logAmtActivation(domain, { time: new Date(), action: 'setupbin', domain: domain.id, userid: user._id, oldmebx: oldmebxpass, newmebx: newmebxpass, rootname: certRootName, hash: wildcardCertSha256, dns: 'rootcert.meshcentral.com' }); diff --git a/db.js b/db.js index 31a54f00..da477f1b 100644 --- a/db.js +++ b/db.js @@ -1604,8 +1604,9 @@ module.exports.CreateDB = function (parent, func) { mesh.nolog = 1; delete mesh.type; delete mesh._id; - if (mesh.amt != null) { - if (delete mesh.amt.password != null) { mesh.amt.password = 1; } // Remove the Intel AMT password if present + if ((mesh.amt != null) && (mesh.amt.password != null)) { + mesh.amt = Object.assign({}, mesh.amt); // Shallow clone + if (mesh.amt.password != null) { mesh.amt.password = 1; } // Remove the Intel AMT password if present } parent.DispatchEvent(['*', mesh.meshid], obj, mesh); }