Files
weval-l99/test_auth_flow.sh
2026-04-24 04:38:58 +02:00

31 lines
1.1 KiB
Bash

#!/bin/bash
COOKIE_JAR=/tmp/v94_cookies.txt
rm -f $COOKIE_JAR
USER=yacine
PASS=$(python3 -c "import json;print(json.load(open('/var/www/html/api/weval-passwords.json'))['yacine']['password'])")
echo "1. Login..."
curl -s -c $COOKIE_JAR -X POST "https://weval-consulting.com/api/weval-auth-session.php" \
-d "action=login&user=$USER&pass=$PASS" | head -c 100
echo ""
echo ""
echo "2. Check cookies..."
cat $COOKIE_JAR | grep -v "^#" | head -3
echo ""
echo "3. Test auth-check..."
curl -s -b $COOKIE_JAR "https://weval-consulting.com/auth/check" -w " | code=%{http_code}\n" --max-time 5
echo "4. Test big4 (protected)..."
curl -s -b $COOKIE_JAR -o /tmp/big4.html -w "code=%{http_code} size=%{size_download} url=%{url_effective}\n" \
-L "https://weval-consulting.com/wevia-em-big4.html" --max-time 10
echo "5. What's inside big4.html?"
head -5 /tmp/big4.html
echo ""
echo "6. Test without -L (no redirect follow)..."
curl -s -b $COOKIE_JAR "https://weval-consulting.com/wevia-em-big4.html" -w "\ncode=%{http_code} redirect_url=%{redirect_url}\n" --max-time 10 -o /dev/null
rm -f $COOKIE_JAR /tmp/big4.html