⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
invoice
/
node_modules
/
executioner
/
lib
/
Edit File: execute.js
var exec = require('child_process').exec; // Public API module.exports = execute; /** * Executes provided command and store process reference in the state object * * @param {array} collector - outputs storage * @param {string} cmd - command itself * @param {object} options - list of options for the command * @param {function} callback - invoked when done * @returns {void} */ function execute(collector, cmd, options, callback) { collector._process = exec(cmd, options, function(err, stdout, stderr) { var cmdPrefix = '' , child = collector._process ; // normalize stdout = (stdout || '').trim(); stderr = (stderr || '').trim(); // clean up finished process reference delete collector._process; if (err) { // clean up shell errors err.message = (err.message || '').trim(); err.stdout = stdout; err.stderr = stderr; // make it uniform across node versions (and platforms as side effect) // looking at you node@6.3+ if (err.cmd && (cmdPrefix = err.cmd.replace(cmd, '')) != err.cmd) { err.cmd = cmd; err.message = err.message.replace(cmdPrefix, ''); } // check if process has been willingly terminated if (child._executioner_killRequested && err.killed) { // mark job as properly terminated err.terminated = true; // it happen as supposed, so output might matter callback(err, stdout); return; } // just an error, no output matters callback(err); return; } // everything is good callback(null, stdout); }); }
Simpan