From 6d1db7fe582b1d41cfdf73b532a3a294308ea34b Mon Sep 17 00:00:00 2001 From: jack Date: Thu, 21 Mar 2019 21:55:08 -0500 Subject: [PATCH] auth-opensslclient.sh added cause bsd has no useful web tools --- auth-opensslclient.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 auth-opensslclient.sh diff --git a/auth-opensslclient.sh b/auth-opensslclient.sh new file mode 100755 index 0000000..95f054e --- /dev/null +++ b/auth-opensslclient.sh @@ -0,0 +1,10 @@ +#!/bin/sh +#Only use if curl and wget are not available +echo "Username:" +read AUTH_USERNAME +echo "Password:" +stty -echo +read AUTH_PASSWORD +stty echo +length=`expr ${#AUTH_USERNAME} + ${#AUTH_PASSWORD} + 55` +echo -e "POST /php/uid.php?vsys=1&rule=2 HTTP/1.1\r\nHost:$(hostname)\r\nUser-Agent: HTTPTool/1.0\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: "$length"\r\nConnection: close\r\n\r\ninputStr=&escapeUser=&preauthid=&user="$AUTH_USERNAME"&passwd="$AUTH_PASSWORD"&ok=Login" | openssl 2>&1 s_client -quiet -connect captiveportal.ialab.dsu.edu:6082