454 Commits
Author SHA1 Message Date
M09IcandClaude Opus 4.6 05f6082324 build: pin go-re2 fork to latest with static CGO docs
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-07-16 08:31:21 -07:00
M09IcandClaude Opus 4.6 3410e30d7f ci: use re2_cgo (dynamic) on Windows CI, re2_static on Linux
Windows CI uses pacboy re2:p with re2_cgo (dynamic libre2) for
testing. Linux CI keeps re2_cgo + re2_static (bundled static archive).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-07-16 08:23:57 -07:00
M09IcandClaude Opus 4.6 7d422b5763 ci: add git to msys2 packages for Windows CI
go mod download needs git in PATH; MSYS2 shell doesn't inherit
the Windows system git.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-07-16 07:50:20 -07:00
M09IcandClaude Opus 4.6 5f3062e5dd build: switch to go-re2 fork with bundled static RE2
Replace upstream wasilibs/go-re2 with chainreactors/go-re2 fork that
bundles pre-built libre2_cre2.a static archives. Build tag re2_cgo +
re2_static selects the bundled archive and statically links libstdc++
and libgcc, producing binaries with zero C++ runtime dependencies.

Removes libre2-dev/g++ install steps from CI — no longer needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-07-16 07:41:11 -07:00
M09IcandClaude Opus 4.6 61b18d1503 build: add re2_cgo to CI for native libre2 performance
Linux CI installs libre2-dev and uses -tags re2_cgo. Windows CI
uses msys2/setup-msys2 with pacboy re2 for CGO mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-07-16 06:24:40 -07:00
M09IcandClaude Opus 4.6 7ce7b850d4 chore: remove all local replaces, update deps
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-07-04 12:46:11 -07:00
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 3bbfb5d198 fix: update fingers dep
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-07-03 05:52:43 -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 b618acf15b fix: migrate runner_test import to utils/parsers
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-28 22:56:10 -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]>
v0.3.2
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
M09Ic 6100475b68 feat: add baseline scan dedup 2026-06-28 21:36:21 -07:00
M09Ic e885f67c78 feat: add client fingerprint support 2026-06-28 21:36:20 -07:00
何止 f896abaff7 fix: honor quiet for result output v1.3.2 2026-06-27 13:33:03 +08:00
何止 8915314aa4 fix: make crawl honor max body length 2026-06-27 13:33:02 +08:00
wuchulonly 9f589b96f4 fix: Init 失败时不再运行爆破池 2026-06-26 19:11:27 +08:00
M09IcandClaude Opus 4.6 e4d174f1c0 deps: bump logs to pick up concurrent writer fix
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-23 20:44:33 -07:00
M09Ic 19694fd567 chore: add issue bug report template 2026-06-24 11:16:02 +08:00
M09Ic cff514d182 fix: avoid rebasing resolved crawl paths v1.3.1 2026-06-24 02:17:22 +08:00
M09Ic 705908b286 fix: keep release dist artifacts untracked 2026-06-23 23:29:56 +08:00
M09Ic b6c969deed fix: make race ci deterministic 2026-06-23 23:01:29 +08:00
M09Ic 2b8ab24a20 ci: clean dist before release 2026-06-23 22:43:45 +08:00
M09Ic 58d4343998 fix: restore ci release builds 2026-06-23 22:39:23 +08:00
M09IcandClaude Opus 4.6 da2bc71a13 feat: support mask expressions in all request fields (header/host/cookie/path/body)
Allow {?...} / {$...} mask patterns to be embedded directly in -u, -H,
--host, --cookie, --path fields. The mask is auto-extracted as the word
source and replaced with {{FUZZ}} placeholder, which gets substituted
with each generated word at request build time.

Also supports explicit -w with {{FUZZ}} placeholders in any field.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-23 07:08:41 -07:00
M09IcandClaude Opus 4.6 6f8cdcc11f fix: track Handler processing in wg to prevent premature drain in crawl-only mode
sendProcess now does wg.Add(1) before sending to processCh, and both
BrutePool.Handler and CheckPool.Handler call wg.Done() after processing.
This ensures wg.Wait() in startDrain does not return while the Handler
is still processing baselines that may produce new crawl additions.

Also adds e2e tests for:
- Crawl recursive URL discovery (depth 1 → depth 2)
- Extract (recon/keys) collection on invalid baselines via dump file

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-23 06:57:32 -07:00
M09IcandClaude Opus 4.6 e38d04f976 fix: run extract (keys/recon) on invalid baselines to avoid missing sensitive data
Previously, ProtonExtract only ran inside Collect() which was only called
for valid/fuzzy baselines. Invalid baselines (failed BaseCompare) with
keys, tokens, or other sensitive data in their response body were silently
skipped. Now putToOutput runs extract on invalid baselines that have raw
response data.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-23 05:48:04 -07:00
M09IcandClaude Opus 4.6 dcd27fee8d fix: crawl source baselines bypass BaseCompare to enable recursive crawling
CrawlSource baselines were going through the standard BaseCompare flow,
which compared them against the random baseline and marked most as invalid.
This prevented doCrawl from being called on crawl results, breaking
recursive URL discovery after the initial index page.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-23 05:41:52 -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 ccf43e607c fix: wait for pool goroutines before closing OutputCh in RunWithCheck
RunWithCheck closed OutputCh immediately after context cancellation
without waiting for the CheckPool goroutine to finish. The Handler
goroutine could still be calling putToOutput on the already-closed
channel, causing "panic: send on closed channel".

Add r.poolwg.Wait() before close(OutputCh), matching RunWithBrute
which already had this synchronization.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-06-22 04:26:16 -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.8 5d3ddeae56 ci(dependabot): enable automated dependency updates
gomod (grouped golang.org/x/* and chainreactors/*) plus github-actions where present. No ignore on chainreactors/* so inter-repo deps are auto-updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-05-29 10:23:59 -07:00
M09IcandClaude Opus 4.8 bd046d7c7f deps: use proxyclient v1.1.0 directly, drop replace
The replace pinned a pre-v1.0.3 pseudo-version up to the v1.0.3 release.
proxyclient v1.1.0 is now published, so require it directly and remove
the replace. Core schemes (SOCKS/SOCKS5/HTTP/HTTPS) cover spray's proxy
use; the extra protocols (trojan/vmess/ssh/...) are split into separate
modules in v1.1.0 but spray doesn't use them. go build ./... passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-05-29 09:03:03 -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]>
v1.3.0
2026-05-26 07:25:07 -07:00
M09IcandClaude Opus 4.6 f4b8adf642 ci: upgrade Go version to 1.25 for goreleaser workflow
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-26 07:16:23 -07:00
M09IcandClaude Opus 4.6 f284cdbc20 chore: update templates submodule to latest upstream master
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-26 07:14:22 -07:00
M09Ic d7b322ed8c fix: preserve pool outputs during close 2026-05-23 16:39:07 +08: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 ba7cc844f7 chore: update fingers/proton/utils deps, remove local proton replace
Fingers now defaults to RE2 regex engine with AC pre-filtering.
No build tag changes needed — RE2 is the new default.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-19 20:24:31 -07:00
M09IcandClaude Opus 4.6 a319b9b9e2 fix: drain additionCh in Close() to prevent wg.Wait hang after ctx cancel
When ctx is cancelled (e.g. IsFailed threshold), the Run loop breaks
and stops reading additionCh. But doCheck (now via addAddition) may
have queued items with wg.Add(1) that no one consumes. Close().wg.Wait()
hangs forever.

Fix: spawn a drain goroutine in Close() before wg.Wait() that consumes
and Done()s remaining additionCh items, then close the channel after
Wait returns.

Verified: 16 IPs x 2 ports x 1000 words completes with EXIT 0.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-19 20:21:25 -07: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 c179e1484f fix: resolve Handler-reqPool deadlock in doCheck and add CIDR E2E tests
Root cause: doCheck() called reqPool.Invoke() from the Handler goroutine.
When all reqPool workers blocked on sendProcess waiting for Handler to
drain processCh, and Handler blocked on Invoke waiting for a free worker,
a circular wait formed.

Fix: doCheck now uses addAddition() to submit check requests via
additionCh consumed by the Run loop, breaking the circular dependency.

Before: 16 targets x 500 words = HANG (>130s)
After:  16 targets x 500 words = 1.8s

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-05-19 20:05:31 -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