diff --git a/cgi-bin/kraut.space b/cgi-bin/kraut.space index 13ea54a..23b978a 100755 --- a/cgi-bin/kraut.space +++ b/cgi-bin/kraut.space @@ -18,15 +18,17 @@ getp() { #exit secret=$(getp secret) +secret_length=`echo $secret | wc --chars` hashed_secret=$(echo "$secret" | sha512sum | cut -f1 -d\ ) cmd=$(getp cmd) # check secret # the secrets file has to contain the hashes on a single line, comments are allowed on seperate lines # secrets can only contain the characters that are allowed in getp() with tr -dc -if [ -z "$secret" ] || ! grep -q ";$hashed_secret$" /etc/tuer3.0/door_access_list; then +if [ -z "$secret" ] || [ $secret_length -lt 73 ] || ! grep -q ";$hashed_secret$" /etc/tuer3.0/door_access_list; then header - [ -z "$secret" ] || echo "

Ich bin mir nicht sicher. Mir scheint, du bist doch ein Kohlkopf oder Anderes!

$hashed_secret" + [ -z "$secret" ] || echo "

Ich bin mir nicht sicher. Mir scheint, du bist doch ein Kohlkopf oder Anderes!

" + # $hashed_secret" cat /var/www/tpl/secret.html exit fi diff --git a/html/index.html b/html/index.html deleted file mode 100644 index a332512..0000000 --- a/html/index.html +++ /dev/null @@ -1 +0,0 @@ -