From c86e40a275c17cb36f7b89db33af059754b11dfc Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sun, 18 Jul 2021 18:53:17 -0700 Subject: [PATCH] MeshCMD RPE improvement. --- agents/meshcmd.js | 14 ++++++++------ meshrelay.js | 1 + package.json | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/agents/meshcmd.js b/agents/meshcmd.js index 449db9ad..50c703ed 100644 --- a/agents/meshcmd.js +++ b/agents/meshcmd.js @@ -2600,12 +2600,14 @@ function performAmtPlatformErase1(stack, name, response, status, args) { var platfromEraseSupport = response['AMT_BootCapabilities'].response['PlatformErase']; if (platfromEraseSupport == null) { console.log("Remote Platfrom Erase (RPE) is not supported on this platform"); process.exit(1); return; } var supportedRpeFeatures = []; - if (platfromEraseSupport & (1 << 1)) { supportedRpeFeatures.push("Pyrite Revert"); } - if (platfromEraseSupport & (1 << 2)) { supportedRpeFeatures.push("Secure Erase All SSDs"); } - if (platfromEraseSupport & (1 << 6)) { supportedRpeFeatures.push("TPM Clear"); } - if (platfromEraseSupport & (1 << 25)) { supportedRpeFeatures.push("Clear BIOS NVM Variables"); } - if (platfromEraseSupport & (1 << 26)) { supportedRpeFeatures.push("BIOS Reload of Golden Configuration"); } - if (platfromEraseSupport & (1 << 31)) { supportedRpeFeatures.push("CSME Unconfigure"); } + if (platfromEraseSupport == 0) { supportedRpeFeatures.push("None"); } else { + if (platfromEraseSupport & (1 << 1)) { supportedRpeFeatures.push("Pyrite Revert (--pyrite)"); } + if (platfromEraseSupport & (1 << 2)) { supportedRpeFeatures.push("Secure Erase All SSDs (--ssd)"); } + if (platfromEraseSupport & (1 << 6)) { supportedRpeFeatures.push("TPM Clear (--tpm)"); } + if (platfromEraseSupport & (1 << 25)) { supportedRpeFeatures.push("Clear BIOS NVM Variables (--nvm)"); } + if (platfromEraseSupport & (1 << 26)) { supportedRpeFeatures.push("BIOS Reload of Golden Configuration (--bios)"); } + if (platfromEraseSupport & (1 << 31)) { supportedRpeFeatures.push("CSME Unconfigure (--csme)"); } + } console.log("RPE Supported Features: " + supportedRpeFeatures.join(", ")); // Compute requested operations flags diff --git a/meshrelay.js b/meshrelay.js index 8887ddd5..c80f5b4a 100644 --- a/meshrelay.js +++ b/meshrelay.js @@ -107,6 +107,7 @@ function CreateMeshRelayEx(parent, ws, req, domain, user, cookie) { parent.relaySessionCount++; // Setup slow relay is requested. This will show down sending any data to this peer. + req.query.slowrelay = 50; if ((req.query.slowrelay != null)) { var sr = null; try { sr = parseInt(req.query.slowrelay); } catch (ex) { } diff --git a/package.json b/package.json index b490b23e..0784bbde 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,8 @@ "sample-config-advanced.json" ], "dependencies": { + "archiver": "^4.0.2", + "archiver-zip-encrypted": "^1.0.10", "body-parser": "^1.19.0", "cbor": "~5.2.0", "compression": "^1.7.4", @@ -43,14 +45,25 @@ "express": "^4.17.0", "express-handlebars": "^3.1.0", "express-ws": "^4.0.0", + "image-size": "^1.0.0", "ipcheck": "^0.1.0", + "loadavg-windows": "^1.1.1", "minimist": "^1.2.0", + "mongodb": "^4.0.0", "multiparty": "^4.2.1", "nedb": "^1.8.0", "node-forge": "^0.10.0", + "node-rdpjs-2": "^0.3.5", + "node-windows": "^1.0.0-beta.5", + "nodemailer": "^6.6.3", + "otplib": "^10.2.3", + "saslprep": "^1.0.3", + "ssh2": "^1.1.0", + "web-push": "^3.4.5", "ws": "^5.2.0", "xmldom": "^0.5.0", - "yauzl": "^2.10.0" + "yauzl": "^2.10.0", + "yubikeyotp": "^0.2.0" }, "repository": { "type": "git",