| name | wstg-sess-09 |
| description | Testing for Session Hijacking |
| category | session-management |
| owasp_id | WSTG-SESS-09 |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["session","cookies","csrf","token","wstg","sess"] |
| tech_stack | [] |
| cwe_ids | ["CWE-384"] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
wstg-sess-09
Test ID
WSTG-SESS-09
Test Name
Testing for Session Hijacking
High-Level Description
Session hijacking occurs when an attacker obtains a valid session token through various means (sniffing, XSS, prediction) and uses it to impersonate the legitimate user. This test evaluates the application's resilience against session hijacking attacks and the effectiveness of protective measures.
What to Check
How to Test
Step 1: Test Session Token Theft via XSS
curl -sI "https://target.com" | grep -i "set-cookie" | grep -i "httponly"
Step 2: Test Session Token Reuse
#!/bin/bash
TARGET="https://target.com"
session_a=$(curl -s -c - -X POST "$TARGET/login" \
-d "username=usera&password=passa" | grep -oP "SESSIONID=\K[^;]+")
response=$(curl -s -b "SESSIONID=$session_a" \
-H "User-Agent: Different-Browser/1.0" \
)
| grep -q ;