Add tlsgrab and a certification command to annna. - annna - Annna the nice friendly bot.
HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
---
DIR commit 1261390ec57fc92b5e0a3ea774ed591cb748a083
DIR parent 164a0d250d87b3d9db9cd2c0ab97a3f560556003
HTML Author: Annna Robert-Houdin <annna@bitreich.org>
Date: Fri, 16 Aug 2024 21:12:07 +0200
Add tlsgrab and a certification command to annna.
Diffstat:
M annna-message-common | 12 ++++++++++++
A tlsgrab | 17 +++++++++++++++++
2 files changed, 29 insertions(+), 0 deletions(-)
---
DIR diff --git a/annna-message-common b/annna-message-common
@@ -1286,6 +1286,18 @@ case "${text}" in
fi
} &
;;
+"${ircuser}, can "*" certify itself?")
+ q="${text#* can }"
+ q="${q% certify*}"
+ {
+ # host:port is needed for tlsgrab
+ curi="$(tlsgrab "${q}")"
+ if [ -n "${curi}" ];
+ then
+ annna-say -s "${server}" -c "${channel}" "${user}, let us see the certificate: ${curi}"
+ fi
+ } &
+ ;;
"${ircuser}, please mine "*" bitreichcoin"*)
q="${text#* please mine }"
q="${q% bitreichcoin*}"
DIR diff --git a/tlsgrab b/tlsgrab
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+export PATH="$PATH:/home/annna/bin"
+
+if [ $# -lt 1 ];
+then
+ printf "usage: %s host:port\n" "$(basename "$0")" >&2
+ exit 1
+fi
+
+host="$1"
+openssl s_client \
+ -connect "${host}" \
+ -showcerts </dev/null \
+ 2>&1 \
+ | /br/bin/bitreich-paste
+