id: matrix-homeserver-detect

info:
  name: Matrix Homeserver - Version Detection
  author: davidegirardi
  severity: info
  description: |
    Extract the Matrix homeserver name and version
  metadata:
    verified: true
    max-request: 1
    shodan-query: title:"Synapse is running"
  tags: tech,matrix,synapse

http:
  - method: GET
    path:
      - "{{BaseURL}}/_matrix/federation/v1/version"

    redirects: true
    max-redirects: 2

    matchers:
      - type: word
        part: body
        words:
          - '"server":'
          - '"name":'
          - '"version":'
        condition: and

    extractors:
      - type: json
        part: body
        json:
          - '.server | select((.name != null) and (.version != null)) | .name, .version'
# digest: 4a0a0047304502203e1ffa3c5daae7131064e90d6ef6c55e18e48adb8062b670833ad61902a3d87a022100f9a08b0c7c808f73b24041638cfcbca7eef9289d26402551967c25c1a3a41e92:922c64590222798bb761d5b6d8e72950