190 Commits
Author SHA1 Message Date
M09IcandClaude Opus 4.6 c78ae4afef fix: migrate RandomUA to httputils.GetRandomUA
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-07-04 12:44:37 -07:00
M09IcandClaude Opus 4.6 adf82d2759 fix: migrate Scanner.ScanData to Scanner.FindAll
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-07-04 08:18:52 -07:00
M09IcandClaude Opus 4.6 62da3950e8 chore: update deps, remove local replace
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-07-03 05:51:45 -07:00
M09IcandClaude Opus 4.6 af0c2493e1 fix: prevent fuzzy-failed results from leaking to stdout and output file
- Set bl.IsValid=false before putToFuzzy snapshot in BaseCompare, so
  the snapshot no longer passes the IsValid check in Output()
- Gate file output on the same condition as console output:
  bl.IsValid || (r.Fuzzy && bl.IsFuzzy)
- Bump deps: utils, utils/parsers, fingers (types migrated to parsers)
- Remove local replace directives

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-28 21:36:55 -07:00
M09IcandClaude Opus 4.6 4e84549e5c refactor: rename proton_rules to spray_proton, move to spray/proton/
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-28 21:36:21 -07:00
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
M09IcandClaude Opus 4.6 f4b8e61376 feat: add ResourceLoader for controllable resource loading
Mirrors gogo's ResourceLoader pattern. SDK spray engine sets it to
no-op after init, preventing RunWithArgs from reloading ports/fingers/templates.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-16 03:17:14 -07:00
M09IcandClaude Opus 4.6 97452ba163 chore(deps): update chainreactors dependencies to latest
Fix proton import path change: protocols/file -> proton/file
Remove local replace directive for parsers

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-08 01:56:29 -07:00
M09IcandClaude Opus 4.6 729dee3d06 feat: enhance extract system with severity, context capture, matchers, and new rules
- parsers.Extracted: add Severity and Items (ExtractItem with ctx/line/offset)
- ProtonExtract: preserve severity from templates, capture N-char context around matches
- Add --extract-context CLI flag (default 0, e.g. --extract-context 50)
- Add word matchers pre-filtering to 14 existing templates for performance
- Add 9 new HaE-inspired rules: lfi-indicator, upload-form, url-as-value,
  location-redirect, mac-address, sensitive-field, linkfinder, url-schemes,
  authorization-header
- Total proton templates: 45 (was 35)
- Update ColorString/TreeString to render severity and context
- Comprehensive tests for severity, context, new templates, tag mappings

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-01 01:44:48 -07:00
M09IcandClaude Opus 4.6 d1b63ad67b fix: regenerate templates and fix logs API for updated submodule
go generate with the updated templates submodule (7d5675c) produces
different embedded data and code. Key changes:
- cmd/cmd.go: logs.Info/Important → logs.InfoLevel/ImportantLevel
- pkg/templates.go: remove proton_rules.bin/neutron.bin embeds (no longer needed)
- core/baseline: use ProtonExtract instead of Extractors.Extract
- core/format: list proton extractor names
- Update embedded binary data files

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-26 07:25:07 -07:00
M09Ic cb09e8eebf fix: add proton template loader 2026-05-23 15:59:35 +08:00
M09IcandClaude Opus 4.6 48ca310bdd fix: add missing embedded resource proton_rules.bin
The file was referenced by //go:embed but never committed,
causing build failures when consumed as a remote Go module.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-22 23:58:05 +08:00
M09IcandClaude Opus 4.6 c8b71dc47b feat: add --poc plugin for neutron-based vulnerability verification after fingerprint detection
Supports check mode (exploit verification via finger field) and brute mode
(default credential testing via zombie/tags field). POC templates are only
executed against targets whose fingerprints match, avoiding blind scanning.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-19 20:17:05 -07:00
M09IcandClaude Opus 4.6 c73a77408f fix: eliminate monitor goroutine race and simplify concurrency
Root cause: the atomic.Bool + polling monitor goroutine pattern had a
race between wg.Wait() in the monitor and wg.Add(1) in the main loop.
When the monitor observed done=true and started Wait, the main loop
could still dispatch new work, causing Close().wg.Wait() to hang.

Fix: replace with nil-channel + sync.Once pattern. When the word stream
exhausts or limit is hit, worderCh is set to nil (disabling that select
branch permanently), then a single goroutine waits for wg to reach zero.
Since wg.Add(1) only occurs in the worderCh branch, nil-ing it before
Wait guarantees no new Add after Wait starts — no race possible.

Other fixes:
- Task feeder goroutine now ctx-aware (prevents leak on cancel)
- AddPool checks Invoke error (prevents poolwg counter mismatch)
- Revert resource_provider IIFE (reading a struct field cannot panic)
- Remove E2E -short skip (race is fixed, full coverage in CI)
- Fix Go 1.24+ vet: non-constant format strings in Init()

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-19 12:22:58 -07:00
M09IcandClaude Opus 4.6 11c90dc313 fix: resolve deadlock/panic risks and add comprehensive test coverage
Bug fixes:
- Defer scopeLocker.Unlock in doScopeCrawl (deadlock on panic)
- Defer statsMu.Unlock in recordStat (deadlock on panic)
- Defer RUnlock in resource_provider.LoadConfig via inline func
- Fix data race in invoke(): move bl field writes before doRedirect
- Close response body on ReadAll error (connection leak)
- Add defer raw.Close() for raw file parsing (fd leak)
- Safe type assertion in load.go keyword parsing (panic on bad YAML)
- Check ants pool creation errors in NewBrutePool/NewCheckPool

New tests (15 test functions):
- pool_test.go: scopeLocker panic recovery, cancel mid-processing,
  single-threaded map access, valid pool creation
- runner_test.go: concurrent recordStat safety, nil stat handling
- load_test.go: malformed YAML tolerance, valid YAML loading
- e2e_test.go: normal brute scan, context cancellation, server errors,
  WAF behavior, multi-target check mode, mixed status codes

CI hardening:
- Add -race detector (Linux, -short mode)
- Add -timeout 300s to prevent deadlock hangs

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-19 11:36:42 -07:00
M09IcandClaude Opus 4.6 8d2dbe403d feat: switch templates from base64 to go:embed for smaller source and faster startup
- go:generate now uses -embed flag to produce //go:embed binary data
- templates.go reduced from 125KB base64 source to 0.9KB + 93KB .bin files
- binary saves ~28KB (removes base64 decode overhead at runtime)
- templates submodule updated with embed-aware generator

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-19 10:48:37 -07:00
M09Ic 9c298d04b2 Use core fingers engine by default 2026-05-18 20:07:29 +08:00
M09IcandClaude Opus 4.6 0a6132ca02 chore: normalize line endings (CRLF → LF)
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-08 10:12:56 -07:00
M09IcandClaude Opus 4.6 b4e9b10c84 fix: null pointer guards and idempotency for embedded/SDK usage
- FingerEngine nil 检查防止未初始化时 panic (baseline.go, fingers.go)
- 日志/颜色/指纹引擎/Extractor 注册增加状态检查, 防止 SDK 多次调用时重复设置

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-08 10:12:56 -07:00
M09IcandClaude Opus 4.6 2e32408efe fix: concurrency safety and graceful pool shutdown
- reqCount/failedCount 改为 atomic.Int64, done 改为 atomic.Bool
- rand.Source 加 sync.Mutex 防止并发 panic
- Invoke 失败时正确回退 wg 计数, 避免死锁
- 新增 waitWorkers() 排空残留消息, ctx.Done 正确设置退出标记
- Close() 增加 nil 检查防止 panic

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-08 10:12:55 -07:00
M09Ic b19a8341e9 feat: add resource provider override 2026-05-08 10:12:55 -07:00
M09Ic d887259fcb fix: load spray fingers from resource provider 2026-05-08 10:12:54 -07:00
M09Ic d2a22e4e01 feat: expose reusable spray runner entrypoint 2026-05-08 10:12:54 -07:00
M09IcandClaude Opus 4.6 263958e760 fix: prevent send-on-closed-channel panic and baseline invalid on raw parse failure
- Replace close(additionCh) with additionClosed atomic.Bool flag to
  prevent panic when async producers (redirect/crawl/retry/append)
  write after pool shutdown
- Guard addAddition() with ctx.Err() and additionClosed check before send
- ParseRawResponse failure no longer marks baseline as invalid or
  returns early; log at debug level instead
- Read Location header from live response (resp.GetHeader) instead of
  re-parsed bl.Response.Header for reliability
- Add ParseRawResponse boundary tests (nil, empty, truncated, binary, etc.)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-06 23:08:19 +08:00
M09Ic b11b5535db chore: support finger send_data 2026-02-12 15:20:08 +08:00
M09Ic 9a0858fd3c chore: fix new statistor 2026-01-29 00:34:04 +08:00
M09Ic 5661a4acad chore: bump fingers and neutron 2026-01-21 10:59:11 +08:00
M09Ic 6618e025c3 fix: content type parse 2026-01-19 17:32:04 +08:00
M09Ic 4e789b8f2e chore: update templates.go 2025-12-06 01:08:59 +08:00
M09Ic db9c0f0e4b fix: raw query panic. https://github.com/chainreactors/spray/issues/125 2025-12-05 00:58:33 +08:00
M09Ic e2f8592ba0 feat: 支持通配符状态码, https://github.com/chainreactors/spray/issues/38 2025-06-05 13:45:48 +08:00
M09Ic 6a6581f41e fix: -e not expect , https://github.com/chainreactors/spray/issues/108 2025-06-05 12:29:02 +08:00
M09Ic 5d16990654 fix: adapt template yaml 2025-02-23 00:02:20 +08:00
M09Ic cb3598b4be refactor: remove internal pkg, use engine replace
fix: chunk mod not read
fix: nil bar panic
enhance: add default accept and user-agent
2025-02-22 20:31:32 +08:00
M09Ic 0c90a5fc03 revert: not same redirect banned 2024-11-01 12:27:31 +08:00
M09Ic 0e8da28cfc fix: path join not expect 2024-11-01 12:25:53 +08:00
M09Ic bcc29ce246 enhance: skip not same host redirect 2024-10-30 16:11:05 +08:00
M09Ic 8a0ad7073a fix: not same domain filtered 2024-10-30 15:57:32 +08:00
M09Ic e2bdcd7794 enhance: add 404 default fuzzystatus, 429 waf status 2024-10-16 14:47:29 +08:00
M09Ic dc667c9683 enhance probe output 2024-10-14 02:20:39 +08:00
M09Ic d0ea98fa81 fix %EXT% not work in plugin , https://github.com/chainreactors/spray/issues/63 2024-09-10 16:47:49 +08:00
M09Ic ec98d5a7a9 union load appendwords and dict 2024-08-26 02:22:35 +08:00
M09Ic 575a279eec add --print print all preset config 2024-08-26 01:47:39 +08:00
M09Ic 5f5bbd3682 adapt spray_dict load 2024-08-26 01:32:11 +08:00
M09Ic 2c2d8731f5 refactor plugin 2024-08-26 01:20:03 +08:00
M09Ic 318d445635 fix multi http parse bug 2024-08-06 03:46:30 +08:00
M09Ic 6b80942df0 support multi fingers features 2024-07-17 01:40:30 +08:00
M09Ic 2b7432fee7 support preset port config 2024-07-14 03:27:20 +08:00
M09Ic 0374bb5122 adapt fingers 2024-07-01 19:51:16 +08:00
M09Ic 733fc66d17 adapt all finger engine 2024-06-29 03:56:44 +08:00