From b4f92157eb5a7f064a079749e845a919e77bf666 Mon Sep 17 00:00:00 2001 From: Varun Sharma Date: Sun, 24 Sep 2023 14:45:42 -0700 Subject: [PATCH] updates --- .github/workflows/hosted-network-filtering-hr.yml | 2 +- src/malware-simulators/exfiltration-simulator/compile.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hosted-network-filtering-hr.yml b/.github/workflows/hosted-network-filtering-hr.yml index fadfaa4e..07a75e50 100644 --- a/.github/workflows/hosted-network-filtering-hr.yml +++ b/.github/workflows/hosted-network-filtering-hr.yml @@ -1,7 +1,7 @@ name: "Hosted: Network Filtering with Harden-Runner" on: workflow_dispatch: - + push: jobs: build: runs-on: ubuntu-latest diff --git a/src/malware-simulators/exfiltration-simulator/compile.js b/src/malware-simulators/exfiltration-simulator/compile.js index 97d25088..7e2c5282 100644 --- a/src/malware-simulators/exfiltration-simulator/compile.js +++ b/src/malware-simulators/exfiltration-simulator/compile.js @@ -2,6 +2,11 @@ const https = require("https"); https .get("https://pastebin.com/", (res) => { + if (res.statusCode < 200 || res.statusCode >= 300) { + console.error("HTTP Error: " + res.statusCode); + process.exit(1); // Exit with a failure code on HTTP error status + } + let data = ""; res.on("data", (chunk) => { @@ -13,5 +18,6 @@ https }); }) .on("error", (err) => { - console.log("Error: " + err.message); + console.error("Error: " + err.message); + process.exit(1); // Exit with a failure code });