From 1fdedb7f49224dcd4410081e2a8db083978cb757 Mon Sep 17 00:00:00 2001 From: 0x4bs3nt Date: Tue, 6 Jan 2026 05:30:34 +0100 Subject: [PATCH 1/2] docs: update CONTRIBUTING.md Update CONTRIBUTING.md docs with up to date data: - Discord invite to new sif server - Update URL-s to new vmfunc/sif repository - Update guidelines on contributing framework detection patterns --- CONTRIBUTING.md | 76 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 24 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0053311..1853483 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,17 +4,19 @@ Thank you for taking the time to contribute to sif! All contributions are valued If you want to contribute but don't know where to start, worry not; there is no shortage of things to do. Even if you don't know any Go, don't let that stop you from trying to contribute! We're here to help. -*By contributing to this repository, you agree to adhere to the sif [Code of Conduct](https://github.com/dropalldatabases/sif/blob/main/CODE_OF_CONDUCT.md). Not doing so may result in a ban.* +_By contributing to this repository, you agree to adhere to the sif [Code of Conduct](https://github.com/vmfunc/sif/blob/main/CODE_OF_CONDUCT.md). Not doing so may result in a ban._ ## How can I help? Here are some ways to get started: -- Have a look at our [issue tracker](https://github.com/dropalldatabases/sif/issues). + +- Have a look at our [issue tracker](https://github.com/vmfunc/sif/issues). - If you've encountered a bug, discuss it with us, [report it](#reporting-issues). - Once you've found a bug you believe you can fix, open a [pull request](#contributing-code) for it. - Alternatively, consider [packaging sif for your distribution](#packaging). If you like the project, but don't have time to contribute, that's okay too! Here are other ways to show your appreciation for the project: + - Use sif (seriously, that's enough) - Star the repository - Share sif with your friends @@ -22,7 +24,7 @@ If you like the project, but don't have time to contribute, that's okay too! Her ## Reporting issues -If you believe you've found a bug, or you have a new feature to request, please hop on the [Discord server](https://discord.gg/dropalldatabases) first to discuss it. +If you believe you've found a bug, or you have a new feature to request, please hop on the [Discord server](https://discord.gg/kmQcvnsa4W) first to discuss it. This way, if it's an easy fix, we could help you solve it more quickly, and if it's a feature request we could workshop it together into something more mature. When opening an issue, please use the search tool and make sure that the issue has not been discussed before. In the case of a bug report, run sif with the `-d/-debug` flag for full debug logs. @@ -33,7 +35,7 @@ When opening an issue, please use the search tool and make sure that the issue h To develop sif, you'll need version 1.23 or later of the Go toolchain. After making your changes, run the program using `go run ./cmd/sif` to make sure it compiles and runs properly. -*Nix users:* the repository provides a flake that can be used to develop and run sif. Use `nix run`, `nix develop`, `nix build`, etc. Make sure to run `gomod2nix` if `go.mod` is changed. +_Nix users:_ the repository provides a flake that can be used to develop and run sif. Use `nix run`, `nix develop`, `nix build`, etc. Make sure to run `gomod2nix` if `go.mod` is changed. ### Submitting a pull request @@ -55,21 +57,40 @@ If you have any questions, feel free to ask around on the IRC channel. ## Contributing Framework Detection Patterns -The framework detection module (`pkg/scan/frameworks/detect.go`) identifies web frameworks by analyzing HTTP headers and response bodies. To add support for a new framework: +The framework detection module (`internal/scan/frameworks/`) identifies web frameworks by analyzing HTTP headers and response bodies. Detectors are organized by category in the `detectors/` subdirectory: -### Adding a New Framework Signature +### Adding a New Framework Detector -1. Add your framework to the `frameworkSignatures` map: +1. Create a detector struct in the appropriate file in `detectors/`: ```go -"MyFramework": { - {Pattern: `unique-identifier`, Weight: 0.5}, - {Pattern: `header-signature`, Weight: 0.4, HeaderOnly: true}, - {Pattern: `body-signature`, Weight: 0.3}, -}, +// myframeworkDetector detects MyFramework. +type myframeworkDetector struct{} + +func (d *myframeworkDetector) Name() string { return "MyFramework" } + +func (d *myframeworkDetector) Signatures() []fw.Signature { + return []fw.Signature{ + {Pattern: "unique-identifier", Weight: 0.5}, + {Pattern: "header-signature", Weight: 0.4, HeaderOnly: true}, + {Pattern: "body-signature", Weight: 0.3}, + } +} + +... + +``` + +2. Register the detector in the `init()` function of the same file: + +```go +func init() { + fw.Register(&myframeworkDetector{}) +} ``` **Pattern Guidelines:** + - `Weight`: How much this signature contributes to detection (0.0-1.0) - `HeaderOnly`: Set to `true` for HTTP header patterns - Use unique identifiers that won't false-positive on other frameworks @@ -77,10 +98,11 @@ The framework detection module (`pkg/scan/frameworks/detect.go`) identifies web ### Adding Version Detection -Add version patterns to `extractVersionWithConfidence()`: +Add version patterns to `version.go` in the `rawPatterns` map inside `init()`: ```go "MyFramework": { + {` Date: Tue, 6 Jan 2026 06:35:32 +0100 Subject: [PATCH 2/2] fix: discord invite Fixed discord invite to official server invite url. --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1853483..481b239 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,7 @@ If you like the project, but don't have time to contribute, that's okay too! Her ## Reporting issues -If you believe you've found a bug, or you have a new feature to request, please hop on the [Discord server](https://discord.gg/kmQcvnsa4W) first to discuss it. +If you believe you've found a bug, or you have a new feature to request, please hop on the [Discord server](https://discord.com/invite/sifcli) first to discuss it. This way, if it's an easy fix, we could help you solve it more quickly, and if it's a feature request we could workshop it together into something more mature. When opening an issue, please use the search tool and make sure that the issue has not been discussed before. In the case of a bug report, run sif with the `-d/-debug` flag for full debug logs.