- Simple CSRF
- Anti CSRF token bypass
- CSRF Content-Type:text/plain
- CSRF FLASH
-
Check if the given api endpoint is cookie based endpoint.
It must be cookie based. -
Check if
origin and referrer
header are not validated by server by deleting and resending the request.
Origin: http://fl4tswa8w0y12jpm-apillab1.labs.peritustrainingschool.com
Referer: http://fl4tswa8w0y12jpm-apillab1.labs.peritustrainingschool.com/Csrf1
They must not be validated by server.
-
If server is not validating... 😃
-
Exploit it.
Note: you can generate poc from burp.
Note: Please check all tests by changing request methods also.
- First, check by passing blank parameter value. Check if server accepts. (Use burp and remove token value)
Token : Blank_Value
-
Second, Remove parameter and anti-CSRF token completely.
-
Add similar length token. (Change few values in token).
-
Add another user’s valid anti-CSRF token.
- Check if no anti-csrf tokens are used. If anti-csrf token is present try anti-csrf token bypass test.
- Set
content-type=text/plain
and verify if the server is processing the request. - Exploitable.