2022-07-03 17:04:04 +00:00
|
|
|
id: matrix-detect
|
2022-07-03 13:26:51 +00:00
|
|
|
|
|
|
|
info:
|
2022-07-03 17:04:04 +00:00
|
|
|
name: Matrix Server Detect
|
2022-07-03 13:26:51 +00:00
|
|
|
author: erethon
|
|
|
|
severity: info
|
|
|
|
description: Detects Matrix servers based on .well-known entries. See https://en.wikipedia.org/wiki/Matrix_(protocol)
|
|
|
|
reference: https://spec.matrix.org/v1.3/server-server-api/#getwell-knownmatrixserver, https://spec.matrix.org/v1.3/client-server-api/#getwell-knownmatrixclient
|
|
|
|
tags: tech,matrix
|
|
|
|
|
|
|
|
requests:
|
|
|
|
- method: GET
|
|
|
|
path:
|
|
|
|
- "{{BaseURL}}/.well-known/matrix/server"
|
|
|
|
- "{{BaseURL}}/.well-known/matrix/client"
|
|
|
|
|
|
|
|
matchers-condition: and
|
|
|
|
matchers:
|
2022-07-03 17:04:04 +00:00
|
|
|
|
2022-07-03 13:26:51 +00:00
|
|
|
- type: word
|
|
|
|
part: body
|
|
|
|
words:
|
|
|
|
- "m."
|
|
|
|
|
2022-07-03 17:04:04 +00:00
|
|
|
- type: word
|
|
|
|
part: header
|
|
|
|
words:
|
|
|
|
- "text/plain"
|
|
|
|
|
|
|
|
- type: status
|
|
|
|
status:
|
|
|
|
- 200
|
|
|
|
|
2022-07-03 13:26:51 +00:00
|
|
|
extractors:
|
|
|
|
- type: json
|
|
|
|
part: body
|
|
|
|
name: server-to-server
|
|
|
|
json:
|
|
|
|
- '."m.server" | select( . != null )'
|
2022-07-03 17:04:04 +00:00
|
|
|
|
2022-07-03 13:26:51 +00:00
|
|
|
- type: json
|
|
|
|
part: body
|
|
|
|
name: client-homeserver
|
|
|
|
json:
|
|
|
|
- '."m.homeserver" | .base_url | select( . != null )'
|
2022-07-03 17:04:04 +00:00
|
|
|
|
2022-07-03 13:26:51 +00:00
|
|
|
- type: json
|
|
|
|
part: body
|
|
|
|
name: identity-server
|
|
|
|
json:
|
|
|
|
- '."m.identity_server" | .base_url | select( . != null )'
|