2021-09-30 14:08:43 +00:00
|
|
|
id: csrf-guard-detect
|
|
|
|
|
|
|
|
info:
|
2023-03-15 15:26:21 +00:00
|
|
|
name: OWASP CSRFGuard 3.x/4.x - Detect
|
2021-09-30 14:08:43 +00:00
|
|
|
author: forgedhallpass
|
|
|
|
severity: info
|
2023-03-15 15:26:21 +00:00
|
|
|
description: OWASP CSRFGuard 3.x and 4.x were checked for whether token-per-page support is enabled based on default configuration.
|
2022-04-22 10:38:41 +00:00
|
|
|
reference:
|
|
|
|
- https://github.com/OWASP/www-project-csrfguard
|
2023-03-15 15:26:21 +00:00
|
|
|
classification:
|
|
|
|
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N
|
2023-10-14 11:27:55 +00:00
|
|
|
cvss-score: 0
|
2023-03-15 15:26:21 +00:00
|
|
|
cwe-id: CWE-200
|
2023-04-28 08:11:21 +00:00
|
|
|
metadata:
|
|
|
|
max-request: 3
|
2023-10-14 11:27:55 +00:00
|
|
|
tags: tech,csrfguard,owasp
|
2021-09-30 14:08:43 +00:00
|
|
|
|
2023-04-27 04:28:59 +00:00
|
|
|
http:
|
2021-09-30 14:08:43 +00:00
|
|
|
- raw:
|
|
|
|
- |
|
|
|
|
GET / HTTP/1.1
|
|
|
|
Host: {{Hostname}}
|
|
|
|
- |
|
|
|
|
GET /JavaScriptServlet HTTP/1.1
|
|
|
|
Host: {{Hostname}}
|
|
|
|
Referer: {{BaseURL}}
|
|
|
|
- |
|
|
|
|
POST /JavaScriptServlet HTTP/1.1
|
|
|
|
Host: {{Hostname}}
|
|
|
|
OWASP-CSRFTOKEN: {{masterToken}}
|
|
|
|
|
|
|
|
matchers-condition: or
|
|
|
|
matchers:
|
|
|
|
- type: word
|
2021-09-30 15:11:48 +00:00
|
|
|
name: "CSRFGuard-v3.x"
|
2021-09-30 14:08:43 +00:00
|
|
|
words:
|
|
|
|
- "FETCH-CSRF-TOKEN"
|
|
|
|
|
|
|
|
- type: word
|
2021-09-30 15:11:48 +00:00
|
|
|
name: "CSRFGuard-v4.x"
|
2021-09-30 14:08:43 +00:00
|
|
|
words:
|
|
|
|
- "masterTokenValue"
|
|
|
|
|
|
|
|
- type: dsl
|
2021-09-30 15:11:48 +00:00
|
|
|
name: "Disabled-token-per-page"
|
2021-09-30 14:08:43 +00:00
|
|
|
condition: and
|
|
|
|
dsl:
|
|
|
|
- 'status_code_3==400'
|
|
|
|
- 'contains(body, "Token-Per-Page functionality is disabled")'
|
|
|
|
|
|
|
|
- type: dsl
|
2021-09-30 15:11:48 +00:00
|
|
|
name: "Enabled-token-per-page"
|
2021-09-30 14:08:43 +00:00
|
|
|
condition: and
|
|
|
|
dsl:
|
|
|
|
- 'status_code_3==200'
|
|
|
|
- 'contains(body, "{\"pageTokens")'
|
2023-10-14 11:27:55 +00:00
|
|
|
|
2021-09-30 14:08:43 +00:00
|
|
|
extractors:
|
|
|
|
- type: regex
|
|
|
|
name: masterToken
|
|
|
|
internal: true
|
|
|
|
group: 1
|
|
|
|
regex:
|
|
|
|
- "(?:masterTokenValue\\s*=\\s*')([^']+)';"
|
|
|
|
|
|
|
|
- type: regex
|
|
|
|
group: 1
|
2021-09-30 15:11:48 +00:00
|
|
|
name: "master-token"
|
2021-09-30 14:08:43 +00:00
|
|
|
regex:
|
|
|
|
- "(?:masterTokenValue\\s*=\\s*')([^']+)';"
|
|
|
|
|
|
|
|
- type: json
|
2021-09-30 15:11:48 +00:00
|
|
|
name: "page-token"
|
2021-09-30 14:08:43 +00:00
|
|
|
json:
|
2022-01-04 19:34:16 +00:00
|
|
|
- '.pageTokens'
|
2023-11-27 08:01:38 +00:00
|
|
|
# digest: 4a0a00473045022100be9f0de5a4ed056ec8b1e162a22cd7e372cb88f262008a0f459d95a8b07463c80220102efa4fe89248e28958130257b44a7e4af82ac033f6c447f6c5a99ca5ba299f:922c64590222798bb761d5b6d8e72950
|