Testing for Credentials Transported over an Encrypted Channel
High-Level Description
This test verifies that user credentials (usernames, passwords, tokens) are transmitted over encrypted channels (HTTPS/TLS) to prevent interception by attackers. Transmitting credentials over unencrypted HTTP exposes them to man-in-the-middle attacks, network sniffing, and session hijacking. All authentication-related traffic must be encrypted.
What to Check
Encryption Requirements
Login pages served over HTTPS
Login form submits to HTTPS endpoint
Password reset over HTTPS
Registration over HTTPS
API authentication over HTTPS
Session tokens transmitted securely
Common Vulnerabilities
Issue
Risk
HTTP login page
Credential interception
Mixed content (HTTPS page, HTTP form action)
Form hijacking
HTTP redirects before HTTPS
SSL stripping
Insecure API endpoints
Token theft
How to Test
Step 1: Check Login Page Protocol
# Check if login page is served over HTTPS
curl -sI "http://target.com/login" | head -20
curl -sI "https://target.com/login" | head -20
# Check for HTTP to HTTPS redirect
curl -sI -L "http://target.com/login" 2>&1 | grep -i "location\|http"# Verify no mixed content
curl -s "https://target.com/login" | grep -i "http://"
Step 2: Analyze Login Form Action
# Get login form and check action URL
curl -s | grep -i | grep -i
curl -s | \
grep -oP | \
-5
curl -s | grep -i
"https://target.com/login"
"<form"
"action"
# Check if form action is HTTPS
"https://target.com/login"
'action="[^"]*"'
head
# Look for JavaScript that might change form action
"https://target.com/login"
"form.action\|submit"
Step 3: Test Actual Login Request
# Attempt login and capture request details
curl -v -X POST "https://target.com/api/login" \
-H "Content-Type: application/json" \
-d '{"username":"test","password":"test123"}' 2>&1 | \
grep -i "< \|> \|ssl\|tls"# Check for secure cookies
curl -sI -X POST "https://target.com/api/login" \
-H "Content-Type: application/json" \
-d '{"username":"test","password":"test123"}' | \
grep -i "set-cookie"# Verify Secure flag on session cookies
[ ] Login page served over HTTPS
[ ] Login form action is HTTPS
[ ] HTTP redirects to HTTPS
[ ] HSTS header present
[ ] HSTS max-age sufficient (>1 year)
[ ] No mixed content on auth pages
[ ] TLS 1.2+ only
[ ] Strong cipher suites
[ ] Secure flag on session cookies
[ ] HttpOnly flag on session cookies
[ ] API auth endpoints HTTPS only
[ ] Certificate valid and not expired
[ ] Findings documented
[ ] Remediation recommendations provided