feat(modules): add nextcloud, jellyfin, forgejo and immich version modules#302
feat(modules): add nextcloud, jellyfin, forgejo and immich version modules#302TBX3D wants to merge 3 commits into
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #302 +/- ##
=======================================
Coverage ? 64.90%
=======================================
Files ? 88
Lines ? 7858
Branches ? 0
=======================================
Hits ? 5100
Misses ? 2367
Partials ? 391 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
pr summary9 files changed (+629 -0)
|
vmfunc
left a comment
There was a problem hiding this comment.
the immich module is broken. extractors use type: json but the yaml executor only implements regex (runExtractors, executor.go:361), and the Extractor struct has no json field to unmarshal into (module.go:100). so immich_major/minor/patch never populate, the finding fires with an empty extracted map, and your own immich test (want 3 / want 1) fails against the real executor. i ran it to confirm. swap them to regex like the other three, "major"\s*:\s*([0-9]+) group 1 etc. verified that passes.
the other three are solid. the forgejo +gitea- discriminator is exactly the right call, keeps vanilla gitea (dev builds and v1.x releases) out, and the productname gating on nextcloud/jellyfin cleanly excludes owncloud/emby. checked all three against the real bodies in your tests, they hold.
fix immich and this is in.
fae149e to
582f75c
Compare
|
thanks for actually running it, that is the kind of review that catches real I think the tree this was read against predates #191. the json extractor landed case "json": at internal/modules/executor.go:526, and Extractor carries rebased the branch onto current main and the immich test passes, including the --- PASS: TestImmichVersionExposureModule immich_major=3 and immich_patch=1 both populate. so I have left the extractors |
There was a problem hiding this comment.
Pull request overview
This PR adds new reconnaissance YAML modules to detect unauthenticated version disclosure endpoints for Nextcloud, Jellyfin, Forgejo, and Immich, along with Go tests that parse and execute each module against an httptest server.
Changes:
- Added 4 new
modules/recon/*-version-exposure.yamlHTTP modules to fingerprint and extract exposed version information. - Added 4 new
internal/modules/*_version_exposure_test.gotests to validate matcher behavior and extracted version fields.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/recon/nextcloud-version-exposure.yaml | Adds Nextcloud status endpoint version exposure detection + regex extractor. |
| modules/recon/jellyfin-version-exposure.yaml | Adds Jellyfin public system info version exposure detection + regex extractor. |
| modules/recon/immich-version-exposure.yaml | Adds Immich unauthenticated server version detection with header+body matchers and JSON extractors. |
| modules/recon/forgejo-version-exposure.yaml | Adds Forgejo version API detection via regex and version extractor. |
| internal/modules/nextcloud_version_exposure_test.go | Tests Nextcloud module match/extract behavior (including non-Nextcloud negatives). |
| internal/modules/jellyfin_version_exposure_test.go | Tests Jellyfin module match/extract behavior (including Emby negative). |
| internal/modules/immich_version_exposure_test.go | Tests Immich module match/extract behavior using CORS header and version body. |
| internal/modules/forgejo_version_exposure_test.go | Tests Forgejo module match/extract behavior and Gitea negatives. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,37 @@ | |||
| id: nextcloud-version-exposure | |||
| - type: word | ||
| part: body | ||
| words: | ||
| - "\"productname\":\"Nextcloud\"" |
| @@ -0,0 +1,37 @@ | |||
| id: jellyfin-version-exposure | |||
| - type: word | ||
| part: body | ||
| words: | ||
| - "\"ProductName\":\"Jellyfin Server\"" |
| @@ -0,0 +1,51 @@ | |||
| id: immich-version-exposure | |||
| @@ -0,0 +1,32 @@ | |||
| id: forgejo-version-exposure | |||
| if v := immichExtract(res, "immich_major"); v != "3" { | ||
| t.Errorf("immich_major=%q, want 3", v) | ||
| } | ||
| if v := immichExtract(res, "immich_patch"); v != "1" { | ||
| t.Errorf("immich_patch=%q, want 1", v) | ||
| } |
|
the module defines immich_major, immich_minor and immich_patch but the test only |
|
CI on this branch is red for a reason unrelated to the change: main does not internal/modules/executor.go:197:57: undefined: MaxBodySize #374 fixes it. this branch builds and tests clean with that one-line fix applied |
the module defines immich_major, immich_minor and immich_patch but the test only pinned two of the three, so a regression in the middle extractor would have gone unnoticed.
b51f13f to
2839348
Compare
No description provided.