From 36e7d425df8eb34bd298b38a6e9ac28a7ab797b5 Mon Sep 17 00:00:00 2001 From: davidegirardi <16451191+davidegirardi@users.noreply.github.com> Date: Thu, 30 Nov 2023 05:46:13 +0100 Subject: [PATCH 1/4] Detect Matrix homeserver software and version --- .../matrix-homeserver-version.yaml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 http/technologies/matrix-homeserver-version.yaml diff --git a/http/technologies/matrix-homeserver-version.yaml b/http/technologies/matrix-homeserver-version.yaml new file mode 100644 index 000000000000..03a3b0a1b9bd --- /dev/null +++ b/http/technologies/matrix-homeserver-version.yaml @@ -0,0 +1,24 @@ +id: matrix-homeserver-detect + +info: + name: Matrix Homeserver version + author: Davide Girardi + severity: info + description: Extract the Matrix homeserver name and version + metadata: + max-request: 1 + tags: tech,matrix + +http: + + - method: GET + redirects: true + max-redirects: 2 + path: + - "https://{{Host}}/_matrix/federation/v1/version" + + extractors: + - type: json + part: body + json: + - '.server | select((.name != null) and (.version != null)) | .name, .version' From 66b105c2d9b9fc6a843d2f3d055bf17ac2a91ef2 Mon Sep 17 00:00:00 2001 From: Dhiyaneshwaran Date: Sat, 2 Dec 2023 07:28:57 +0530 Subject: [PATCH 2/4] Update and rename matrix-homeserver-version.yaml to matrix-homeserver-detect.yaml --- ...version.yaml => matrix-homeserver-detect.yaml} | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) rename http/technologies/{matrix-homeserver-version.yaml => matrix-homeserver-detect.yaml} (57%) diff --git a/http/technologies/matrix-homeserver-version.yaml b/http/technologies/matrix-homeserver-detect.yaml similarity index 57% rename from http/technologies/matrix-homeserver-version.yaml rename to http/technologies/matrix-homeserver-detect.yaml index 03a3b0a1b9bd..89822645e268 100644 --- a/http/technologies/matrix-homeserver-version.yaml +++ b/http/technologies/matrix-homeserver-detect.yaml @@ -1,21 +1,24 @@ id: matrix-homeserver-detect info: - name: Matrix Homeserver version + name: Matrix Homeserver - Version Detection author: Davide Girardi severity: info - description: Extract the Matrix homeserver name and version + description: | + Extract the Matrix homeserver name and version metadata: max-request: 1 - tags: tech,matrix + shodan-query: title:"Synapse is running" + verified: true + tags: tech,matrix,synapse http: - - method: GET + path: + - "{{BaseURL}}/_matrix/federation/v1/version" + redirects: true max-redirects: 2 - path: - - "https://{{Host}}/_matrix/federation/v1/version" extractors: - type: json From 17ec7fde4df2cfa8af64be25b1ba18e9df80c51a Mon Sep 17 00:00:00 2001 From: Dhiyaneshwaran Date: Sat, 2 Dec 2023 12:52:00 +0530 Subject: [PATCH 3/4] Update matrix-homeserver-detect.yaml --- http/technologies/matrix-homeserver-detect.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/technologies/matrix-homeserver-detect.yaml b/http/technologies/matrix-homeserver-detect.yaml index 89822645e268..d17430337236 100644 --- a/http/technologies/matrix-homeserver-detect.yaml +++ b/http/technologies/matrix-homeserver-detect.yaml @@ -2,7 +2,7 @@ id: matrix-homeserver-detect info: name: Matrix Homeserver - Version Detection - author: Davide Girardi + author: davidegirardi severity: info description: | Extract the Matrix homeserver name and version From fa1e4c31f27878605fea3c9d870119b7e0e3aa49 Mon Sep 17 00:00:00 2001 From: Dhiyaneshwaran Date: Sat, 2 Dec 2023 12:56:42 +0530 Subject: [PATCH 4/4] matcher addition --- http/technologies/matrix-homeserver-detect.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/http/technologies/matrix-homeserver-detect.yaml b/http/technologies/matrix-homeserver-detect.yaml index d17430337236..ddd60cff0724 100644 --- a/http/technologies/matrix-homeserver-detect.yaml +++ b/http/technologies/matrix-homeserver-detect.yaml @@ -20,6 +20,14 @@ http: redirects: true max-redirects: 2 + matchers: + - type: word + part: body + words: + - '"name":"Synapse"' + - '"server":' + condition: and + extractors: - type: json part: body