MCPcopy Index your code
hub / github.com/chainreactors/neutron

github.com/chainreactors/neutron @v0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.0 ↗ · + Follow
1,327 symbols 4,648 edges 108 files 335 documented · 25%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Neutron

blog posts:

  • https://chainreactors.github.io/wiki/blog/2024/10/30/neutron-introduce/

Introduce

Neutron has been rewritten based on Nuclei 2.7, removing all dependencies (only depends on logs and utils from the chainreactors project, with no recursive dependencies, and is extremely small in size), and trimmed features that are less likely to be used in internal networks, resulting in a nano Nuclei engine.

Differences from the original Nuclei 2.7: https://chainreactors.github.io/wiki/libs/neutron/

Neutron POC repo: https://github.com/chainreactors/templates/tree/master/neutron

update log: https://chainreactors.github.io/wiki/libs/neutron/update/

Nuclei compatibility boundaries

Neutron intentionally tracks nuclei behavior only where it affects template semantics. CyberHub-specific runtime extensions are documented separately so they are not mistaken for upstream nuclei behavior.

Area Neutron behavior Upstream nuclei v3 behavior Boundary
Cookie jar NewScanContext creates one jar per scan and HTTP requests clone the compiled client with that jar unless disable-cookie is set. contextargs.Context.CookieJar is shared by HTTP templates in one workflow/execution. Compatible. TinyGo returns nil because browser/WASM fetch owns cookies.
Redirects RedirectPolicy plus makeCheckRedirectFunc implements no-follow, follow-all, and same-host redirects. httpclientpool.RedirectFlow implements the same redirect choices. Compatible by behavior and names; enum numeric values are not a persistence/API contract.
HTTP client reuse Per-scan cookie jars are attached via a client clone, so jar state is isolated per execution. httpclientpool skips adding clients to the pool when a cookie jar is present. Compatible for jar-backed executions. Neutron does not need to mirror nuclei's full pool.
Charset normalization Core HTTP response decoding handles content encodings only (gzip, deflate). Nuclei does not normalize legacy HTML charsets in the HTTP engine. CyberHub extension. Legacy charset normalization belongs in the caller-provided transport layer.
Favicon data Converted xray icon-content rules are emitted as explicit /favicon.ico requests and hash the response body in DSL (mmh3(base64_py(body))). Runtime favicon fields are derived from the current response only. Nuclei templates request favicon URLs explicitly and calculate hashes through DSL helpers. Compatible direction. Neutron no longer performs hidden favicon discovery/fetching in the HTTP engine.

CMD

neutron 提供了两个简单的测试工具, 帮助用户测试poc

validate

指定poc路径, 加载并预编译指定路径下的所有poc

go run ./cmd/validate <path_or_file>

shot

指定poc路径和url, 对单个url

go run ./cmd/shot [-proxy <proxy_address>] <path_or_file> <target_url> 

Extension points exported contracts — how you extend this code

Request (Interface)
Request is an interface implemented any protocol based request generator. [3 implementers]
protocols/protocols.go
Converter (Interface)
Converter recognizes a non-neutron POC format and converts it into neutron template YAML. Format-specific packages (e.g. [1 …
templates/load.go
Emitter (Interface)
(no doc) [3 implementers]
common/dsl/codegen.go
ExecuteFunc (FuncType)
ExecuteFunc is called for each template during chain walking. id is the template ID; vars carries forwarded values from
templates/chain.go
RevokeCheckFunc (FuncType)
RevokeCheckFunc checks whether the leaf cert is revoked via CRL/OCSP.
common/tlsx/tlsx.go
PartResolver (FuncType)
PartResolver maps a matcher/extractor `part:` to the string the operator should run against. Returns ("", false) when th
protocols/operators_default.go
ExtractFunc (FuncType)
(no doc)
operators/registrar.go
Executer (Interface)
Executer is an interface implemented any protocol based request executer. [1 implementers]
protocols/protocols.go

Core symbols most depended-on inside this repo

Contains
called by 277
common/dsl/codegen.go
toString
called by 109
common/dsl/util.go
Close
called by 90
protocols/http/client.go
MustAddFunction
called by 84
common/dsl/dsl.go
String
called by 79
common/dsl/ast.go
peek
called by 68
convert/parser.go
next
called by 64
convert/parser.go
NewWithPositionalArgs
called by 57
common/dsl/dsl.go

Shape

Function 932
Method 274
Struct 91
TypeAlias 15
FuncType 11
Interface 4

Languages

Go100%

Modules by API surface

harness/mutate.go103 symbols
convert/converter.go93 symbols
convert/parser.go50 symbols
cmd/validate/compare.go45 symbols
common/dsl/codegen.go40 symbols
convert/equivalence_test.go38 symbols
convert/e2e_test.go38 symbols
common/dsl/emitters.go36 symbols
convert/converter_test.go30 symbols
convert/matcher.go27 symbols
protocols/http/request.go26 symbols
templates/impl_test.go25 symbols

For agents

$ claude mcp add neutron \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact