Files
spray/pkg/templates.go
T
M09IcandClaude Opus 4.6 112cdbff43 feat: add --keys flag for credential/keys detection with 156 found templates
Embed proton's found/keys templates (156 rules covering AWS, GCP, Azure,
OpenAI, Slack, GitHub, Stripe, etc.) into the spray binary. The new --keys
flag activates them; -a (advance) also enables keys automatically. When
used with --recon, tags are merged into a single EnableExtractors call.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-23 05:24:10 -07:00

52 lines
1.1 KiB
Go

//go:build !emptytemplates
// +build !emptytemplates
package pkg
import (
_ "embed"
"github.com/chainreactors/utils/encode"
)
//go:embed data/spray_rule.bin
var sprayRuleData []byte
//go:embed data/spray_common.bin
var sprayCommonData []byte
//go:embed data/spray_dict.bin
var sprayDictData []byte
//go:embed data/extract.bin
var extractData []byte
//go:embed data/proton_rules.bin
var protonRulesData []byte
//go:embed data/found_keys.bin
var foundKeysData []byte
//go:embed data/port.bin
var portData []byte
func loadEmbeddedConfig(typ string) []byte {
if typ == "spray_rule" {
return encode.MustDeflateDeCompress(sprayRuleData)
}else if typ == "spray_common" {
return encode.MustDeflateDeCompress(sprayCommonData)
}else if typ == "spray_dict" {
return encode.MustDeflateDeCompress(sprayDictData)
}else if typ == "extract" {
return encode.MustDeflateDeCompress(extractData)
}else if typ == "proton_rules" {
return encode.MustDeflateDeCompress(protonRulesData)
}else if typ == "found_keys" {
return encode.MustDeflateDeCompress(foundKeysData)
}else if typ == "port" {
return encode.MustDeflateDeCompress(portData)
}
return nil
}