* fix(js/tsgen): map non-struct external types to any
tsgen treated every type from another package as a struct and queued
it to have its fields scraped into a TypeScript interface. The kind
was checked only at scrape time, as a fatal error, so an interface,
func, or named basic type in an exported signature or field aborted
the whole run. make jsupdate-tsgen panicked on net.Conn, which the
dcerpc, gptransport, mssql, net, and oracle libraries return, and
never wrote the remaining definitions or index.ts.
Check the kind when the type is first seen instead. Structs are still
scraped; other types have no fields to describe and become any, as
external parameter types already do. Names that do not resolve are
still reported.
Fixes: #8099
Signed-off-by: Dwi Siswanto <[email protected]>
* fix(js): exclude gptransport and smbsession from codegen
gptransport and smbsession are shared Go adapters for the smb, dcerpc,
and file protocol code, not JavaScript modules: nothing registers them
with the runtime, and index.ts does not export them. Without the
.nuclei-jsgen-ignore marker that goexec already carries, tsgen and
bindgen treat them as modules, so a full make jsupdate-tsgen run
writes gptransport.ts and smbsession.ts and adds both to index.ts.
Refs: #8099
Signed-off-by: Dwi Siswanto <[email protected]>
* fix returns
---------
Signed-off-by: Dwi Siswanto <[email protected]>
Co-authored-by: Mzack9999 <[email protected]>
packages.Load records parse, type, and list errors in Package.Errors
and still returns a nil error. NewEntityParser and loadPackage checked
only the returned error, so tsgen accepted packages that do not
compile. Parse then panicked in extractParameters on the recovered
syntax tree, or looked up types in an empty package and reported a
misleading "type not found" error.
Both call sites now load through loadPackage, which returns the
package errors with the package ID and file positions.
Fixes: #8098
Signed-off-by: Dwi Siswanto <[email protected]>
* refactor: replace Split in loops with more efficient SplitSeq
Signed-off-by: stringsbuilder <[email protected]>
* minor refactor
* strict checksum
* fix typo
* harden sdk tests
Avoid shared templates-dir update races across parallel go test packages and ignore known leveldb/ratelimit/memguardian goroutines in goleak.
* bind splitseq temps
Keep SplitSeq inputs in locals so iterator substrings cannot outlive a temporary string expression.
* fix sdk templates
Keep goleak ignores, drop DisableUpdateCheck so CI can install templates, and serialize UpdateIfOutdated across processes.
---------
Signed-off-by: stringsbuilder <[email protected]>
Co-authored-by: Mzack9999 <[email protected]>
Add shared auth, options, result, redaction, and
adapter support for GoExec-backed JavaScript
helpers, including:
* `nuclei/wmi`
* `nuclei/tsch`
* `nuclei/scmr`
* `nuclei/dcom`
through generated bindings, and register them with
the JS compiler.
Also make JS generators to skip internal helper
packages and test files.
Signed-off-by: Dwi Siswanto <[email protected]>
* fix: remove undefined errorutil.ShowStackTrace
* feat: add make lint support and integrate with test
* refactor: migrate errorutil to errkit across codebase
- Replace deprecated errorutil with modern errkit
- Convert error declarations from var to func for better compatibility
- Fix all SA1019 deprecation warnings
- Maintain error chain support and stack traces
* fix: improve DNS test reliability using Google DNS
- Configure test to use Google DNS (8.8.8.8) for stability
- Fix nil pointer issue in DNS client initialization
- Keep production defaults unchanged
* fixing logic
* removing unwanted branches in makefile
---------
Co-authored-by: Mzack9999 <[email protected]>
* introduce typescript files generation using ast + tmpl
* feat valid ts with scraping
* feat remove old logic + tsdocs for all modules
* fix ikev and related bugs
* typescript docs for js modules
* lint,build + ldap realm fix
* go mod tidy
* fix named imports ast parsing
* fix ast code generation errors
* complete support for ts files generation
* support go global/const in ts docs
* updated template
* feat: typescript using go code generation
* nuke jsdoc generator
* update generated ts dir structure
* fix multifile ts gen issue
* fix panic in ts code gen
* fix test
* update docs of js libs
* feat: add doc+example for every js class,function,method
* fix missing quotes in ikev example
---------
Co-authored-by: Sandeep Singh <[email protected]>
* feat http response memory optimization + reuse buffers
* update nuclei version
* feat: reuse js vm's and compile to programs
* fix failing http integration test
* remove dead code + add -jsc
* feat reuse js vms in pool with concurrency
* update comments as per review
* bug fix+ update interactsh test to look for dns interaction
* try enabling all interactsh integration tests
---------
Co-authored-by: mzack <[email protected]>
* make ssh module store the connection
* make ssh module able to execute commands using the client
* add bingen + update docs
---------
Co-authored-by: Tarun Koyalwar <[email protected]>