@eyeauras/insight-cli 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cli-package-build.json +1 -1
- package/README.md +33 -2
- package/SKILL.md +38 -51
- package/dist/src/administration-results.js +1 -1
- package/dist/src/administration.d.ts +1 -1
- package/dist/src/administration.js +16 -2
- package/dist/src/binary.d.ts +3 -0
- package/dist/src/binary.js +74 -0
- package/dist/src/capture.d.ts +3 -0
- package/dist/src/capture.js +220 -0
- package/dist/src/cli.js +91 -14
- package/dist/src/contexts.d.ts +5 -0
- package/dist/src/contexts.js +54 -18
- package/dist/src/debugger-caller.d.ts +17 -0
- package/dist/src/debugger-caller.js +129 -0
- package/dist/src/debugger-launch.d.ts +2 -0
- package/dist/src/debugger-launch.js +17 -0
- package/dist/src/debugger-results.d.ts +1 -0
- package/dist/src/debugger-results.js +8 -0
- package/dist/src/debugger-supervisor.js +56 -13
- package/dist/src/debugger.js +16 -7
- package/dist/src/die.d.ts +12 -0
- package/dist/src/die.js +127 -0
- package/dist/src/dnspy-runtime.d.ts +8 -0
- package/dist/src/dnspy-runtime.js +46 -0
- package/dist/src/dnspy.d.ts +22 -0
- package/dist/src/dnspy.js +160 -0
- package/dist/src/dotnet-diagnostics.d.ts +13 -0
- package/dist/src/dotnet-diagnostics.js +101 -0
- package/dist/src/frida-worker.d.ts +1 -0
- package/dist/src/frida-worker.js +125 -0
- package/dist/src/frida.d.ts +16 -0
- package/dist/src/frida.js +125 -0
- package/dist/src/ghidra-debugger-runtime.d.ts +7 -0
- package/dist/src/ghidra-debugger-runtime.js +31 -0
- package/dist/src/ghidra-processes.d.ts +6 -0
- package/dist/src/ghidra-processes.js +121 -0
- package/dist/src/ghidra.js +6 -6
- package/dist/src/ilspy.d.ts +7 -0
- package/dist/src/ilspy.js +122 -0
- package/dist/src/lifecycle.d.ts +1 -1
- package/dist/src/lifecycle.js +8 -2
- package/dist/src/lldb.d.ts +10 -0
- package/dist/src/lldb.js +99 -0
- package/dist/src/llvm.d.ts +6 -0
- package/dist/src/llvm.js +133 -0
- package/dist/src/managed-heap.d.ts +4 -0
- package/dist/src/managed-heap.js +73 -0
- package/dist/src/managed-metadata.d.ts +11 -0
- package/dist/src/managed-metadata.js +66 -0
- package/dist/src/mitmproxy.d.ts +55 -0
- package/dist/src/mitmproxy.js +172 -0
- package/dist/src/native-inputs.d.ts +3 -2
- package/dist/src/native-inputs.js +21 -5
- package/dist/src/package-version.d.ts +1 -0
- package/dist/src/package-version.js +3 -0
- package/dist/src/procmon-config.d.ts +2 -0
- package/dist/src/procmon-config.js +15 -0
- package/dist/src/procmon-events.d.ts +13 -0
- package/dist/src/procmon-events.js +82 -0
- package/dist/src/procmon.d.ts +4 -0
- package/dist/src/procmon.js +107 -0
- package/dist/src/research.d.ts +11 -2
- package/dist/src/research.js +5 -3
- package/dist/src/runtime-catalog.d.ts +13 -0
- package/dist/src/runtime-catalog.js +26 -0
- package/dist/src/runtime-manager.d.ts +125 -0
- package/dist/src/runtime-manager.js +385 -0
- package/dist/src/runtime-selection.d.ts +13 -0
- package/dist/src/runtime-selection.js +42 -0
- package/dist/src/server.d.ts +15 -0
- package/dist/src/server.js +77 -96
- package/dist/src/sevenzip.d.ts +15 -0
- package/dist/src/sevenzip.js +119 -0
- package/dist/src/strace.d.ts +10 -0
- package/dist/src/strace.js +71 -0
- package/dist/src/text-window.d.ts +11 -0
- package/dist/src/text-window.js +6 -0
- package/dist/src/tool-runtime/archives.d.ts +10 -0
- package/dist/src/tool-runtime/archives.js +194 -0
- package/dist/src/tool-runtime/catalog.d.ts +3 -0
- package/dist/src/tool-runtime/catalog.js +13 -0
- package/dist/src/tool-runtime/commands.d.ts +9 -0
- package/dist/src/tool-runtime/commands.js +39 -0
- package/dist/src/tool-runtime/deadline.d.ts +11 -0
- package/dist/src/tool-runtime/deadline.js +32 -0
- package/dist/src/tool-runtime/definition.d.ts +73 -0
- package/dist/src/tool-runtime/definition.js +49 -0
- package/dist/src/tool-runtime/dotnet.d.ts +4 -0
- package/dist/src/tool-runtime/dotnet.js +22 -0
- package/dist/src/tool-runtime/identity.d.ts +6 -0
- package/dist/src/tool-runtime/identity.js +50 -0
- package/dist/src/tool-runtime/installer.d.ts +101 -0
- package/dist/src/tool-runtime/installer.js +180 -0
- package/dist/src/tool-runtime/launch-worker.d.ts +1 -0
- package/dist/src/tool-runtime/launch-worker.js +58 -0
- package/dist/src/tool-runtime/run.d.ts +51 -0
- package/dist/src/tool-runtime/run.js +159 -0
- package/dist/src/tool-runtime/store.d.ts +15 -0
- package/dist/src/tool-runtime/store.js +219 -0
- package/dist/src/tool-runtime/supervisor.d.ts +57 -0
- package/dist/src/tool-runtime/supervisor.js +266 -0
- package/dist/src/tool-runtime/windows-job.d.ts +22 -0
- package/dist/src/tool-runtime/windows-job.js +43 -0
- package/dist/src/toolbox.d.ts +84 -0
- package/dist/src/toolbox.js +35 -0
- package/dist/src/tshark.d.ts +23 -0
- package/dist/src/tshark.js +174 -0
- package/dist/src/windbg.d.ts +14 -0
- package/dist/src/windbg.js +119 -0
- package/dist/src/workspace.d.ts +1 -0
- package/dist/src/workspace.js +6 -0
- package/package.json +7 -4
- package/references/administration.md +2 -1
- package/references/agent-execution.md +36 -0
- package/references/agent-setup.md +61 -0
- package/references/artifacts.md +5 -0
- package/references/debugger.md +22 -0
- package/references/ilspy.md +33 -0
- package/references/managed-runtime.md +157 -0
- package/references/native/InsightPythonWheels.java +283 -2
- package/references/native/InsightRuntimeDoctor.java +33 -0
- package/references/native/InsightTraceState.java +28 -13
- package/references/setup.md +6 -3
- package/runtime/managed/insight-heap/Azure.Core.dll +0 -0
- package/runtime/managed/insight-heap/Azure.Identity.dll +0 -0
- package/runtime/managed/insight-heap/Insight.Heap.csproj +1 -0
- package/runtime/managed/insight-heap/Insight.Heap.deps.json +391 -0
- package/runtime/managed/insight-heap/Insight.Heap.dll +0 -0
- package/runtime/managed/insight-heap/Insight.Heap.runtimeconfig.json +13 -0
- package/runtime/managed/insight-heap/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Diagnostics.NETCore.Client.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Diagnostics.Runtime.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.Configuration.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.Diagnostics.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.FileProviders.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.Hosting.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.Options.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Extensions.Primitives.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Identity.Client.Extensions.Msal.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Identity.Client.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.IdentityModel.Abstractions.dll +0 -0
- package/runtime/managed/insight-heap/Microsoft.Security.AntiSSRF.dll +0 -0
- package/runtime/managed/insight-heap/NuGet.Config +1 -0
- package/runtime/managed/insight-heap/Program.cs +20 -0
- package/runtime/managed/insight-heap/README.md +16 -0
- package/runtime/managed/insight-heap/System.ClientModel.dll +0 -0
- package/runtime/managed/insight-heap/System.Memory.Data.dll +0 -0
- package/runtime/managed/insight-heap/System.Security.Cryptography.ProtectedData.dll +0 -0
- package/runtime/managed/insight-heap/dependencies.json +436 -0
- package/runtime/managed/insight-heap/notices/Azure.Core-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/Azure.Identity-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Bcl.AsyncInterfaces-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Bcl.AsyncInterfaces-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Diagnostics.NETCore.Client-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Diagnostics.Runtime-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Configuration.Abstractions-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Configuration.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.DependencyInjection.Abstractions-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.DependencyInjection.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Diagnostics.Abstractions-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Diagnostics.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.FileProviders.Abstractions-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.FileProviders.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Hosting.Abstractions-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Hosting.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Logging.Abstractions-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Logging.Abstractions-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Options-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Options-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Primitives-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Extensions.Primitives-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Identity.Client-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Identity.Client.Extensions.Msal-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/Microsoft.IdentityModel.Abstractions-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/Microsoft.Security.AntiSSRF-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/System.ClientModel-LICENSE.txt +21 -0
- package/runtime/managed/insight-heap/notices/System.Memory.Data-LICENSE.txt +23 -0
- package/runtime/managed/insight-heap/notices/System.Memory.Data-THIRD-PARTY-NOTICES.TXT +1418 -0
- package/runtime/managed/insight-heap/notices/System.Security.Cryptography.ProtectedData-LICENSE.TXT +23 -0
- package/runtime/managed/insight-heap/notices/System.Security.Cryptography.ProtectedData-THIRD-PARTY-NOTICES.TXT +309 -0
- package/runtime/managed/insight-heap/packages.lock.json +165 -0
- package/runtime/managed/insight-heap/provenance.json +146 -0
- package/runtime/managed/insight-heap/runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll +0 -0
- package/runtime/managed/insight-managed/Insight.Managed.csproj +4 -0
- package/runtime/managed/insight-managed/Insight.Managed.deps.json +41 -0
- package/runtime/managed/insight-managed/Insight.Managed.dll +0 -0
- package/runtime/managed/insight-managed/Insight.Managed.runtimeconfig.json +13 -0
- package/runtime/managed/insight-managed/LICENSE.dnlib.txt +20 -0
- package/runtime/managed/insight-managed/NuGet.Config +1 -0
- package/runtime/managed/insight-managed/Program.cs +31 -0
- package/runtime/managed/insight-managed/README.md +16 -0
- package/runtime/managed/insight-managed/dnlib.dll +0 -0
- package/runtime/managed/insight-managed/packages.lock.json +13 -0
- package/runtime/managed/insight-managed/provenance.json +40 -0
- package/runtime/native/binary/README.md +22 -0
- package/runtime/native/binary/dependencies.json +166 -0
- package/runtime/native/binary/helper.cpp +44 -0
- package/runtime/native/binary/insight-binary-darwin-arm64 +0 -0
- package/runtime/native/binary/notices/Catch2-3.12.0--Catch2-3.12.0__LICENSE.txt +23 -0
- package/runtime/native/binary/notices/LIEF-LICENSE.txt +202 -0
- package/runtime/native/binary/notices/LIEF-attribution.txt +37 -0
- package/runtime/native/binary/notices/Melkor_ELF_Fuzzer-ac2495b--elf_fuzzer-master__LICENSE.txt +674 -0
- package/runtime/native/binary/notices/expected-1.3.1--expected-1.3.1__COPYING +121 -0
- package/runtime/native/binary/notices/frozen-61dce5a--frozen-61dce5ae18ca59931e27675c468e64118aba8744__AUTHORS +3 -0
- package/runtime/native/binary/notices/frozen-61dce5a--frozen-61dce5ae18ca59931e27675c468e64118aba8744__LICENSE +202 -0
- package/runtime/native/binary/notices/json-LICENSE.MIT +21 -0
- package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--LICENSE +553 -0
- package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--framework__LICENSE +553 -0
- package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--tf-psa-crypto__LICENSE +552 -0
- package/runtime/native/binary/notices/mbedtls-4.0.0.r0.gec4044008d--tf-psa-crypto__framework__LICENSE +553 -0
- package/runtime/native/binary/notices/nanobind-2.13.0.r18.g4db9ed3f--LICENSE +26 -0
- package/runtime/native/binary/notices/nanobind-2.13.0.r18.g4db9ed3f--ext__robin_map__LICENSE +21 -0
- package/runtime/native/binary/notices/span-LICENSE_1_0.txt +23 -0
- package/runtime/native/binary/notices/span-attribution.txt +11 -0
- package/runtime/native/binary/notices/spdlog-1.17.0--spdlog-1.17.0__LICENSE +25 -0
- package/runtime/native/binary/notices/utfcpp-4.0.9--utfcpp-4.0.9__LICENSE +23 -0
- package/runtime/native/binary/provenance.json +48 -0
- package/runtime/native/child-deadline-linux-x64 +0 -0
- package/runtime/native/child-deadline-linux.c +24 -0
- package/runtime/native/child-deadline-linux.provenance.json +17 -0
- package/runtime/native/deadline-alarm-darwin-universal.dylib +0 -0
- package/runtime/native/deadline-alarm.c +33 -0
- package/runtime/native/deadline-alarm.provenance.json +22 -0
- package/runtime/native/deadline-exec-darwin-arm64 +0 -0
- package/runtime/native/deadline-exec.c +24 -0
- package/runtime/native/deadline-exec.provenance.json +17 -0
- package/runtime/native/dnspy-extension/Bridge.cs +58 -0
- package/runtime/native/dnspy-extension/Insight.DnSpy.csproj +13 -0
- package/runtime/native/dnspy-extension/Insight.DnSpy.x.dll +0 -0
- package/runtime/native/dnspy-extension/NuGet.Config +1 -0
- package/runtime/native/dnspy-extension/UNICODE-LOADER.md +26 -0
- package/runtime/native/dnspy-extension/packages.lock.json +6 -0
- package/runtime/native/dnspy-extension/provenance.json +27 -0
- package/runtime/native/dnspy-extension/upstream-public-build.snk +0 -0
- package/runtime/native/dnspy-extension/vendor-files.json +4341 -0
- package/runtime/native/file-version.ps1 +7 -0
- package/runtime/native/insight-registry-win-x64.dll +0 -0
- package/runtime/native/mitmproxy/bridge.py +180 -0
- package/runtime/native/mitmproxy/notices.json +476 -0
- package/runtime/native/sources/detours-LICENSE.md +23 -0
- package/runtime/native/sources/detours-e4bfd6b.tar.gz +0 -0
- package/runtime/native/sources/detours-provenance.json +10 -0
- package/runtime/native/tshark-layout.json +2247 -0
- package/runtime/native/windows-job/DirectoryAlias.cs +24 -0
- package/runtime/native/windows-job/Insight.WindowsJob.csproj +1 -0
- package/runtime/native/windows-job/Insight.WindowsJob.dll +0 -0
- package/runtime/native/windows-job/NuGet.Config +1 -0
- package/runtime/native/windows-job/OwnedJob.cs +79 -0
- package/runtime/native/windows-job/RegistryRedirect.cs +45 -0
- package/runtime/native/windows-job/packages.lock.json +21 -0
- package/runtime/native/windows-job/provenance.json +16 -0
- package/runtime/native/windows-job/windows-job.ps1 +8 -0
- package/runtime/native/windows-registry.c +21 -0
- package/runtime/native/windows-registry.def +3 -0
- package/runtime/native/windows-registry.provenance.json +14 -0
- package/runtime/notices/diagnostics-10.0.750501.txt +23 -0
- package/runtime/tool-catalog.json +290 -0
- package/runtime/toolbox.json +1401 -0
- package/skill-bundle/insight-artifacts/SKILL.md +30 -0
- package/skill-bundle/insight-artifacts/references/agent-execution.md +36 -0
- package/skill-bundle/insight-artifacts/references/artifacts.md +52 -0
- package/skill-bundle/insight-binary/SKILL.md +46 -0
- package/skill-bundle/insight-binary/references/agent-execution.md +36 -0
- package/skill-bundle/insight-capture/SKILL.md +56 -0
- package/skill-bundle/insight-capture/references/agent-execution.md +36 -0
- package/skill-bundle/insight-cli/SKILL.md +42 -0
- package/skill-bundle/insight-cli/references/agent-execution.md +36 -0
- package/skill-bundle/insight-cli/references/agent-setup.md +61 -0
- package/skill-bundle/insight-die/SKILL.md +49 -0
- package/skill-bundle/insight-die/references/agent-execution.md +36 -0
- package/skill-bundle/insight-dnspy/SKILL.md +65 -0
- package/skill-bundle/insight-dnspy/references/agent-execution.md +36 -0
- package/skill-bundle/insight-dotnet-dump/SKILL.md +46 -0
- package/skill-bundle/insight-dotnet-dump/references/agent-execution.md +36 -0
- package/skill-bundle/insight-dotnet-stack/SKILL.md +39 -0
- package/skill-bundle/insight-dotnet-stack/references/agent-execution.md +36 -0
- package/skill-bundle/insight-dotnet-trace/SKILL.md +45 -0
- package/skill-bundle/insight-dotnet-trace/references/agent-execution.md +36 -0
- package/skill-bundle/insight-frida/SKILL.md +67 -0
- package/skill-bundle/insight-frida/references/agent-execution.md +36 -0
- package/skill-bundle/insight-ghidra/SKILL.md +91 -0
- package/skill-bundle/insight-ghidra/references/administration.md +34 -0
- package/skill-bundle/insight-ghidra/references/agent-execution.md +36 -0
- package/skill-bundle/insight-ghidra/references/archive.md +32 -0
- package/skill-bundle/insight-ghidra/references/artifacts.md +52 -0
- package/skill-bundle/insight-ghidra/references/debugger.md +62 -0
- package/skill-bundle/insight-ghidra/references/extensions-and-sync.md +124 -0
- package/skill-bundle/insight-ghidra/references/managed-runtime.md +157 -0
- package/skill-bundle/insight-ghidra/references/native-workflows.md +112 -0
- package/skill-bundle/insight-ghidra/references/query-semantics.md +96 -0
- package/skill-bundle/insight-ghidra/references/recovery.md +53 -0
- package/skill-bundle/insight-ghidra/references/research.md +101 -0
- package/skill-bundle/insight-ghidra/references/setup.md +50 -0
- package/skill-bundle/insight-ilspy/SKILL.md +45 -0
- package/skill-bundle/insight-ilspy/references/agent-execution.md +36 -0
- package/skill-bundle/insight-ilspy/references/ilspy.md +33 -0
- package/skill-bundle/insight-interop/SKILL.md +54 -0
- package/skill-bundle/insight-interop/references/agent-execution.md +36 -0
- package/skill-bundle/insight-lldb/SKILL.md +54 -0
- package/skill-bundle/insight-lldb/references/agent-execution.md +36 -0
- package/skill-bundle/insight-llvm/SKILL.md +56 -0
- package/skill-bundle/insight-llvm/references/agent-execution.md +36 -0
- package/skill-bundle/insight-managed-heap/SKILL.md +43 -0
- package/skill-bundle/insight-managed-heap/references/agent-execution.md +36 -0
- package/skill-bundle/insight-managed-metadata/SKILL.md +52 -0
- package/skill-bundle/insight-managed-metadata/references/agent-execution.md +36 -0
- package/skill-bundle/insight-mitmproxy/SKILL.md +62 -0
- package/skill-bundle/insight-mitmproxy/references/agent-execution.md +36 -0
- package/skill-bundle/insight-overview/SKILL.md +79 -0
- package/skill-bundle/insight-overview/references/agent-execution.md +36 -0
- package/skill-bundle/insight-procmon/SKILL.md +49 -0
- package/skill-bundle/insight-procmon/references/agent-execution.md +36 -0
- package/skill-bundle/insight-re/SKILL.md +121 -0
- package/skill-bundle/insight-re/references/agent-execution.md +36 -0
- package/skill-bundle/insight-re/references/artifacts.md +52 -0
- package/skill-bundle/insight-re/references/recovery.md +53 -0
- package/skill-bundle/insight-sevenzip/SKILL.md +42 -0
- package/skill-bundle/insight-sevenzip/references/agent-execution.md +36 -0
- package/skill-bundle/insight-strace/SKILL.md +46 -0
- package/skill-bundle/insight-strace/references/agent-execution.md +36 -0
- package/skill-bundle/insight-tshark/SKILL.md +49 -0
- package/skill-bundle/insight-tshark/references/agent-execution.md +36 -0
- package/skill-bundle/insight-windbg/SKILL.md +46 -0
- package/skill-bundle/insight-windbg/references/agent-execution.md +36 -0
- package/skill-bundle/manifest.json +32 -0
- package/skills/insight-artifacts/SKILL.md +30 -0
- package/skills/insight-artifacts/references/agent-execution.md +36 -0
- package/skills/insight-artifacts/references/artifacts.md +52 -0
- package/skills/insight-binary/SKILL.md +46 -0
- package/skills/insight-binary/references/agent-execution.md +36 -0
- package/skills/insight-capture/SKILL.md +56 -0
- package/skills/insight-capture/references/agent-execution.md +36 -0
- package/skills/insight-die/SKILL.md +49 -0
- package/skills/insight-die/references/agent-execution.md +36 -0
- package/skills/insight-dnspy/SKILL.md +65 -0
- package/skills/insight-dnspy/references/agent-execution.md +36 -0
- package/skills/insight-dotnet-dump/SKILL.md +46 -0
- package/skills/insight-dotnet-dump/references/agent-execution.md +36 -0
- package/skills/insight-dotnet-stack/SKILL.md +39 -0
- package/skills/insight-dotnet-stack/references/agent-execution.md +36 -0
- package/skills/insight-dotnet-trace/SKILL.md +45 -0
- package/skills/insight-dotnet-trace/references/agent-execution.md +36 -0
- package/skills/insight-frida/SKILL.md +67 -0
- package/skills/insight-frida/references/agent-execution.md +36 -0
- package/skills/insight-ghidra/SKILL.md +91 -0
- package/skills/insight-ghidra/references/administration.md +34 -0
- package/skills/insight-ghidra/references/agent-execution.md +36 -0
- package/skills/insight-ghidra/references/archive.md +32 -0
- package/skills/insight-ghidra/references/artifacts.md +52 -0
- package/skills/insight-ghidra/references/debugger.md +62 -0
- package/skills/insight-ghidra/references/extensions-and-sync.md +124 -0
- package/skills/insight-ghidra/references/managed-runtime.md +157 -0
- package/skills/insight-ghidra/references/native-workflows.md +112 -0
- package/skills/insight-ghidra/references/query-semantics.md +96 -0
- package/skills/insight-ghidra/references/recovery.md +53 -0
- package/skills/insight-ghidra/references/research.md +101 -0
- package/skills/insight-ghidra/references/setup.md +50 -0
- package/skills/insight-ilspy/SKILL.md +45 -0
- package/skills/insight-ilspy/references/agent-execution.md +36 -0
- package/skills/insight-ilspy/references/ilspy.md +33 -0
- package/skills/insight-interop/SKILL.md +54 -0
- package/skills/insight-interop/references/agent-execution.md +36 -0
- package/skills/insight-lldb/SKILL.md +54 -0
- package/skills/insight-lldb/references/agent-execution.md +36 -0
- package/skills/insight-llvm/SKILL.md +56 -0
- package/skills/insight-llvm/references/agent-execution.md +36 -0
- package/skills/insight-managed-heap/SKILL.md +43 -0
- package/skills/insight-managed-heap/references/agent-execution.md +36 -0
- package/skills/insight-managed-metadata/SKILL.md +52 -0
- package/skills/insight-managed-metadata/references/agent-execution.md +36 -0
- package/skills/insight-mitmproxy/SKILL.md +62 -0
- package/skills/insight-mitmproxy/references/agent-execution.md +36 -0
- package/skills/insight-overview/SKILL.md +79 -0
- package/skills/insight-overview/references/agent-execution.md +36 -0
- package/skills/insight-procmon/SKILL.md +49 -0
- package/skills/insight-procmon/references/agent-execution.md +36 -0
- package/skills/insight-re/SKILL.md +22 -9
- package/skills/insight-re/references/agent-execution.md +36 -0
- package/skills/insight-re/references/artifacts.md +52 -0
- package/skills/insight-re/references/recovery.md +53 -0
- package/skills/insight-sevenzip/SKILL.md +42 -0
- package/skills/insight-sevenzip/references/agent-execution.md +36 -0
- package/skills/insight-strace/SKILL.md +46 -0
- package/skills/insight-strace/references/agent-execution.md +36 -0
- package/skills/insight-tshark/SKILL.md +49 -0
- package/skills/insight-tshark/references/agent-execution.md +36 -0
- package/skills/insight-windbg/SKILL.md +46 -0
- package/skills/insight-windbg/references/agent-execution.md +36 -0
package/dist/src/server.d.ts
CHANGED
|
@@ -10,6 +10,17 @@ export interface ServerBinding {
|
|
|
10
10
|
readerSecret: string;
|
|
11
11
|
publisherSecret: string;
|
|
12
12
|
}
|
|
13
|
+
interface LocalServer extends ServerBinding {
|
|
14
|
+
toolProcessId?: string;
|
|
15
|
+
mode: 'local';
|
|
16
|
+
instance: string;
|
|
17
|
+
port: number;
|
|
18
|
+
identityPort: number;
|
|
19
|
+
keySecret: string;
|
|
20
|
+
tokenSecret: string;
|
|
21
|
+
phase: 'seeded' | 'initialized' | 'running' | 'stopped';
|
|
22
|
+
pid?: number;
|
|
23
|
+
}
|
|
13
24
|
/** Own local startup; external profiles connect without taking ownership of their server. */
|
|
14
25
|
export declare class GhidraServer {
|
|
15
26
|
readonly directory: string;
|
|
@@ -42,3 +53,7 @@ export declare class GhidraServer {
|
|
|
42
53
|
private identity;
|
|
43
54
|
stop(): Promise<void>;
|
|
44
55
|
}
|
|
56
|
+
export declare function serverIdentity(local: LocalServer, c: CommandContext): Promise<Record<string, unknown>>;
|
|
57
|
+
/** Stop only the authenticated owned server recorded below this workspace/probe root. */
|
|
58
|
+
export declare function stopLocalServer(directory: string, c: CommandContext): Promise<void>;
|
|
59
|
+
export {};
|
package/dist/src/server.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { launchProcess, terminateProcess } from './tool-runtime/supervisor.js';
|
|
2
|
+
import { runTool } from './tool-runtime/run.js';
|
|
1
3
|
import { randomUUID, randomBytes, createHash } from 'node:crypto';
|
|
2
|
-
import { spawn } from 'node:child_process';
|
|
3
4
|
import { readFile, mkdir, open, rename, readdir, stat, chmod, realpath } from 'node:fs/promises';
|
|
4
5
|
import { delimiter, dirname, join, resolve } from 'node:path';
|
|
5
6
|
import { createServer } from 'node:net';
|
|
@@ -73,48 +74,19 @@ export class GhidraServer {
|
|
|
73
74
|
async run(label, main, args, environment = {}, input, acceptedCodes = [0], timeoutMilliseconds = 120000) {
|
|
74
75
|
const root = join(this.root(), 'calls', label + '-' + randomUUID());
|
|
75
76
|
await mkdir(root, { recursive: true, mode: 0o700 });
|
|
76
|
-
const classes = await nativeHelpers(this.directory, this.inputs);
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const exited = new Promise((resolve, reject) => { child.once('error', reject); child.once('exit', resolve); });
|
|
81
|
-
exited.catch(() => { });
|
|
82
|
-
await log.close();
|
|
83
|
-
let output = '', overflow = false;
|
|
84
|
-
child.stdout.on('data', chunk => { if (!overflow)
|
|
85
|
-
output += chunk.toString(); if (Buffer.byteLength(output) > 1024 * 1024) {
|
|
86
|
-
overflow = true;
|
|
87
|
-
child.kill('SIGTERM');
|
|
88
|
-
} });
|
|
89
|
-
const abort = () => child.kill('SIGTERM');
|
|
90
|
-
this.c.signal.addEventListener('abort', abort, { once: true });
|
|
91
|
-
const timer = setTimeout(abort, timeoutMilliseconds);
|
|
92
|
-
const force = setTimeout(() => { if (child.exitCode === null && child.signalCode === null)
|
|
93
|
-
child.kill('SIGKILL'); }, timeoutMilliseconds + 5000);
|
|
77
|
+
const classes = await nativeHelpers(this.directory, this.inputs, this.c);
|
|
78
|
+
const output = await runTool(this.c, { tool: 'ghidra', role: label, installation: this.inputs.fingerprint, executable: this.inputs.java, arguments: ['-Djava.awt.headless=true', '-Dghidra.home=' + this.inputs.ghidraHome,
|
|
79
|
+
...nativeJvmDirectories(root), ...nativeExtensionArguments(this.inputs), '-cp', classes + delimiter + this.inputs.classpath, main, ...args], cwd: root, environment, input, acceptedCodes, timeoutMs: timeoutMilliseconds, maxOutputBytes: 1024 * 1024 });
|
|
80
|
+
let result;
|
|
94
81
|
try {
|
|
95
|
-
|
|
96
|
-
child.stdin.end(input);
|
|
97
|
-
if (this.c.signal.aborted)
|
|
98
|
-
abort();
|
|
99
|
-
const code = await exited;
|
|
100
|
-
if (code === null || !acceptedCodes.includes(code) || overflow)
|
|
101
|
-
fail('authorization', 'Native server operation could not be verified; its owned diagnostic stage is retained.');
|
|
102
|
-
let result;
|
|
103
|
-
try {
|
|
104
|
-
result = object(parseDomainJson(output));
|
|
105
|
-
}
|
|
106
|
-
catch {
|
|
107
|
-
fail('malformed', 'Native server operation returned malformed content.');
|
|
108
|
-
}
|
|
109
|
-
if (result.error || result.state === 'failed')
|
|
110
|
-
fail('authorization', 'Native server operation did not establish its outcome.');
|
|
111
|
-
return result;
|
|
82
|
+
result = object(parseDomainJson(output.stdout));
|
|
112
83
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
clearTimeout(force);
|
|
116
|
-
this.c.signal.removeEventListener('abort', abort);
|
|
84
|
+
catch {
|
|
85
|
+
fail('malformed', 'Native server operation returned malformed content.');
|
|
117
86
|
}
|
|
87
|
+
if (result.error || result.state === 'failed')
|
|
88
|
+
fail('authorization', 'Native server operation did not establish its outcome.');
|
|
89
|
+
return result;
|
|
118
90
|
}
|
|
119
91
|
async credentials(binding, role) {
|
|
120
92
|
const url = new URL(binding.origin);
|
|
@@ -186,6 +158,10 @@ export class GhidraServer {
|
|
|
186
158
|
await mkdir(this.root(), { recursive: true, mode: 0o700 });
|
|
187
159
|
await durable(connection, { enabled: true });
|
|
188
160
|
}
|
|
161
|
+
if (operation === 'stop') {
|
|
162
|
+
await this.stop();
|
|
163
|
+
return { connected: false, mode: this.c.profile.values.server ? 'external' : 'local', state: 'stopped' };
|
|
164
|
+
}
|
|
189
165
|
if (operation === 'disconnect') {
|
|
190
166
|
await this.stop();
|
|
191
167
|
await mkdir(this.root(), { recursive: true, mode: 0o700 });
|
|
@@ -354,20 +330,21 @@ export class GhidraServer {
|
|
|
354
330
|
await this.run('certificate', 'InsightKeytool', [keystore], { INSIGHT_KEYSTORE_PASSWORD: await this.c.secrets.require(local.keySecret) });
|
|
355
331
|
await chmod(keystore, 0o600);
|
|
356
332
|
}
|
|
357
|
-
const classes = await nativeHelpers(this.directory, this.inputs);
|
|
333
|
+
const classes = await nativeHelpers(this.directory, this.inputs, this.c);
|
|
358
334
|
const processRoot = join(root, 'processes', randomUUID());
|
|
359
335
|
await mkdir(processRoot, { recursive: true, mode: 0o700 });
|
|
360
336
|
const log = await open(join(processRoot, 'runtime.log'), 'a', 0o600);
|
|
361
|
-
const child =
|
|
337
|
+
const child = await launchProcess(this.c.appArguments.AppDataDirectory, { tool: 'ghidra', role: 'server', installation: this.inputs.fingerprint, metadata: { serverDirectory: this.directory } }, this.inputs.java, ['-Djava.awt.headless=true', '-Dghidra.home=' + this.inputs.ghidraHome,
|
|
362
338
|
...nativeJvmDirectories(processRoot), '-cp', classes + delimiter + (this.inputs.serverClasspath ?? this.inputs.classpath),
|
|
363
339
|
'InsightServerMain', data, String(local.port), String(local.identityPort), local.instance, keystore], { cwd: processRoot, detached: true, windowsHide: true, env: { PATH: this.c.environment.PATH ?? process.env.PATH, HOME: processRoot, TMPDIR: processRoot,
|
|
364
|
-
INSIGHT_KEYSTORE_PASSWORD: await this.c.secrets.require(local.keySecret), INSIGHT_SERVER_TOKEN: await this.c.secrets.require(local.tokenSecret) }, stdio: ['ignore', log.fd, log.fd] });
|
|
340
|
+
INSIGHT_KEYSTORE_PASSWORD: await this.c.secrets.require(local.keySecret), INSIGHT_SERVER_TOKEN: await this.c.secrets.require(local.tokenSecret) }, stdio: ['ignore', log.fd, log.fd] }, { signal: this.c.signal });
|
|
365
341
|
child.on('error', () => { });
|
|
366
342
|
child.unref();
|
|
367
343
|
await log.close();
|
|
368
344
|
if (!child.pid)
|
|
369
345
|
fail('launch', 'Owned local Ghidra server could not be started.');
|
|
370
346
|
this.state.child = child;
|
|
347
|
+
local.toolProcessId = child.toolProcessId;
|
|
371
348
|
local.pid = child.pid;
|
|
372
349
|
local.phase = 'running';
|
|
373
350
|
await durable(saved, local);
|
|
@@ -394,62 +371,66 @@ export class GhidraServer {
|
|
|
394
371
|
throw error;
|
|
395
372
|
}
|
|
396
373
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
await reader.cancel().catch(() => { });
|
|
374
|
+
identity(local) { return serverIdentity(local, this.c); }
|
|
375
|
+
async stop() { await stopLocalServer(this.directory, this.c); this.state.child = undefined; this.state.initializing = undefined; }
|
|
376
|
+
}
|
|
377
|
+
export async function serverIdentity(local, c) {
|
|
378
|
+
const token = await c.secrets.require(local.tokenSecret);
|
|
379
|
+
const response = await c.fetch(`http://127.0.0.1:${local.identityPort}/identity`, { redirect: 'error',
|
|
380
|
+
signal: AbortSignal.timeout(1000), headers: { Authorization: 'Bearer ' + token } });
|
|
381
|
+
if (!response.ok || Number(response.headers.get('content-length')) > 4096)
|
|
382
|
+
fail('binding', 'Owned server identity was not verified.');
|
|
383
|
+
const reader = response.body?.getReader();
|
|
384
|
+
if (!reader)
|
|
385
|
+
fail('binding', 'Owned server identity has no body.');
|
|
386
|
+
const chunks = [];
|
|
387
|
+
let size = 0;
|
|
388
|
+
try {
|
|
389
|
+
for (;;) {
|
|
390
|
+
const next = await reader.read();
|
|
391
|
+
if (next.done)
|
|
392
|
+
break;
|
|
393
|
+
size += next.value.byteLength;
|
|
394
|
+
if (size > 4096)
|
|
395
|
+
fail('binding', 'Owned server identity exceeded its bound.');
|
|
396
|
+
chunks.push(next.value);
|
|
421
397
|
}
|
|
422
|
-
const value = Buffer.concat(chunks).toString('utf8');
|
|
423
|
-
const result = object(JSON.parse(value));
|
|
424
|
-
if (result.instance !== local.instance || result.port !== local.port || !Number.isSafeInteger(result.pid) || Number(result.pid) < 1 ||
|
|
425
|
-
local.pid !== undefined && result.pid !== local.pid)
|
|
426
|
-
fail('binding', 'Server endpoint no longer belongs to the recorded owned process.');
|
|
427
|
-
return result;
|
|
428
398
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
399
|
+
finally {
|
|
400
|
+
await reader.cancel().catch(() => { });
|
|
401
|
+
}
|
|
402
|
+
const value = Buffer.concat(chunks).toString('utf8');
|
|
403
|
+
const result = object(JSON.parse(value));
|
|
404
|
+
if (result.instance !== local.instance || result.port !== local.port || !Number.isSafeInteger(result.pid) || Number(result.pid) < 1 ||
|
|
405
|
+
local.pid !== undefined && result.pid !== local.pid)
|
|
406
|
+
fail('binding', 'Server endpoint no longer belongs to the recorded owned process.');
|
|
407
|
+
return result;
|
|
408
|
+
}
|
|
409
|
+
/** Stop only the authenticated owned server recorded below this workspace/probe root. */
|
|
410
|
+
export async function stopLocalServer(directory, c) {
|
|
411
|
+
let local;
|
|
412
|
+
try {
|
|
413
|
+
local = JSON.parse(await readFile(join(directory, 'server', 'local.json'), 'utf8'));
|
|
414
|
+
}
|
|
415
|
+
catch (error) {
|
|
416
|
+
if (error.code === 'ENOENT')
|
|
440
417
|
return;
|
|
441
|
-
|
|
442
|
-
|
|
418
|
+
throw error;
|
|
419
|
+
}
|
|
420
|
+
if (!local.pid)
|
|
421
|
+
return;
|
|
422
|
+
if (live(local.pid)) {
|
|
423
|
+
await serverIdentity(local, c);
|
|
424
|
+
if (local.toolProcessId)
|
|
425
|
+
await terminateProcess(c.appArguments.AppDataDirectory, local.toolProcessId, false, async (r) => Number((await serverIdentity(local, c)).pid) === r.pid);
|
|
426
|
+
else
|
|
443
427
|
process.kill(local.pid, 'SIGTERM');
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
}
|
|
449
|
-
local.phase = 'stopped';
|
|
450
|
-
delete local.pid;
|
|
451
|
-
await durable(join(this.root(), 'local.json'), local);
|
|
452
|
-
this.state.child = undefined;
|
|
453
|
-
this.state.initializing = undefined;
|
|
428
|
+
for (let i = 0; i < 100 && live(local.pid); i++)
|
|
429
|
+
await delay(50);
|
|
430
|
+
if (live(local.pid))
|
|
431
|
+
fail('busy', 'Owned server did not stop; its receipt is retained.');
|
|
454
432
|
}
|
|
433
|
+
local.phase = 'stopped';
|
|
434
|
+
delete local.pid;
|
|
435
|
+
await durable(join(directory, 'server', 'local.json'), local);
|
|
455
436
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CommandContext, type CommandDefinition } from '@eyeauras/cli-factory';
|
|
2
|
+
import { ToolInstaller } from './tool-runtime/installer.js';
|
|
3
|
+
import type { Workspace } from './workspace.js';
|
|
4
|
+
export interface ArchiveEntry {
|
|
5
|
+
path: string;
|
|
6
|
+
directory: boolean;
|
|
7
|
+
size: number;
|
|
8
|
+
encrypted: boolean;
|
|
9
|
+
attributes: string;
|
|
10
|
+
}
|
|
11
|
+
/** Technical listing is bounded, not a general line-escaping format. Extraction never trusts native paths. */
|
|
12
|
+
export declare function parseArchiveListing(content: string): ArchiveEntry[];
|
|
13
|
+
export declare function safeArchivePath(path: string): string;
|
|
14
|
+
export declare function sevenzipInstaller(c: CommandContext): ToolInstaller;
|
|
15
|
+
export declare function sevenzipCommands(workspace: (c: CommandContext) => Workspace): CommandDefinition[];
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { command, Permission } from '@eyeauras/cli-factory';
|
|
2
|
+
import { join, resolve, dirname } from 'node:path';
|
|
3
|
+
import { mkdir, lstat } from 'node:fs/promises';
|
|
4
|
+
import { ToolInstaller } from './tool-runtime/installer.js';
|
|
5
|
+
import { defineTool, lifecycleCommands } from './tool-runtime/definition.js';
|
|
6
|
+
import { catalogArtifact } from './tool-runtime/catalog.js';
|
|
7
|
+
import { runTool } from './tool-runtime/run.js';
|
|
8
|
+
import { fail, text, id } from './model.js';
|
|
9
|
+
import { number } from './research.js';
|
|
10
|
+
const archiveSha = '7bb52641f2e0dc9b8f5b180be4b0ab46b6d3127361a4e817938175603850c714';
|
|
11
|
+
/** Technical listing is bounded, not a general line-escaping format. Extraction never trusts native paths. */
|
|
12
|
+
export function parseArchiveListing(content) {
|
|
13
|
+
const entries = [];
|
|
14
|
+
for (const block of content.replaceAll('\r\n', '\n').trim().split(/\n\n+/)) {
|
|
15
|
+
if (!block)
|
|
16
|
+
continue;
|
|
17
|
+
const fields = new Map();
|
|
18
|
+
for (const line of block.split('\n')) {
|
|
19
|
+
const at = line.indexOf(' = ');
|
|
20
|
+
if (at < 1)
|
|
21
|
+
fail('unsupported', 'Archive listing contains a multiline or unsupported field.');
|
|
22
|
+
const key = line.slice(0, at);
|
|
23
|
+
if (fields.has(key))
|
|
24
|
+
fail('unsupported', 'Archive listing contains ambiguous fields.');
|
|
25
|
+
fields.set(key, line.slice(at + 3));
|
|
26
|
+
}
|
|
27
|
+
if (['Symbolic Link', 'Hard Link', 'Reparse'].some(key => fields.has(key)))
|
|
28
|
+
fail('unsupported', 'Archive links are not supported for ordinary-file recovery.');
|
|
29
|
+
const path = fields.get('Path'), size = Number(fields.get('Size'));
|
|
30
|
+
if (!path || !Number.isSafeInteger(size) || size < 0 || !['+', '-'].includes(fields.get('Folder') ?? ''))
|
|
31
|
+
fail('unsupported', 'Archive entry omitted its path, size or kind.');
|
|
32
|
+
if (entries.length >= 10000)
|
|
33
|
+
fail('limit', 'Archive inventory exceeds 10000 entries.');
|
|
34
|
+
entries.push({ path, size, directory: fields.get('Folder') === '+', encrypted: fields.get('Encrypted') === '+', attributes: fields.get('Attributes') ?? '' });
|
|
35
|
+
}
|
|
36
|
+
return entries;
|
|
37
|
+
}
|
|
38
|
+
export function safeArchivePath(path) {
|
|
39
|
+
if (!path || /[\\\x00-\x1f\x7f:]/.test(path) || path.startsWith('/') || path.split('/').some(p => !p || p === '.' || p === '..') || path.length > 2048)
|
|
40
|
+
fail('invalid', 'Archive entry has an unsafe or unsupported output path.');
|
|
41
|
+
return path;
|
|
42
|
+
}
|
|
43
|
+
export function sevenzipInstaller(c) {
|
|
44
|
+
return new ToolInstaller(c, { id: 'sevenzip', primary: 'sevenzip', components: () => {
|
|
45
|
+
if (process.platform !== 'darwin' || !['arm64', 'x64'].includes(process.arch))
|
|
46
|
+
fail('unsupported', 'Managed 7-Zip is currently provided for macOS ARM64/x64; select an external 7zz 26.04 on another host.');
|
|
47
|
+
return { sevenzip: catalogArtifact(archiveSha) };
|
|
48
|
+
}, launch: roots => ({ executable: join(roots.sevenzip, '7zz'), arguments: [], environment: {} }),
|
|
49
|
+
probe: async (launch, context) => {
|
|
50
|
+
const r = await runTool(context, { tool: 'sevenzip', role: 'version', executable: launch.executable, arguments: [...launch.arguments, 'i'], environment: launch.environment, maxOutputBytes: 65536, timeoutMs: 30000 });
|
|
51
|
+
if (!/7-Zip \(z\) 26\.04 /.test(r.stdout))
|
|
52
|
+
fail('configuration', 'The selected executable must provide 7zz 26.04.');
|
|
53
|
+
return { version: '26.04' };
|
|
54
|
+
} });
|
|
55
|
+
}
|
|
56
|
+
export function sevenzipCommands(workspace) {
|
|
57
|
+
const definition = defineTool({ id: 'sevenzip', description: 'Inventory, verify and recover files from containers', components: [{ id: 'sevenzip', version: '26.04', artifacts: [] }], lifecycle: {
|
|
58
|
+
download: (o, c) => sevenzipInstaller(c).download(Boolean(o.offline)), install: (o, c) => sevenzipInstaller(c).install(o), uninstall: (o, c) => sevenzipInstaller(c).uninstall(Boolean(o.purgeCache)), doctor: (_o, c) => sevenzipInstaller(c).doctor(), status: (_o, c) => sevenzipInstaller(c).status()
|
|
59
|
+
} });
|
|
60
|
+
const common = [{ flags: '--target <id>', description: 'Reuse an immutable input target' }, { flags: '--timeout-seconds <seconds>', description: 'Per-process deadline (1–600)', defaultValue: 120 }];
|
|
61
|
+
const operation = (name) => command(name + ' [input]', name === 'list' ? 'Inspect a bounded archive inventory' : name === 'test' ? 'Check container integrity without extracting' : 'Recover regular files into a new ordinary directory', async ({ args, options: o }, c) => {
|
|
62
|
+
if (Boolean(args.input) === Boolean(o.target))
|
|
63
|
+
fail('invalid', 'Supply exactly one input path or --target.');
|
|
64
|
+
const w = workspace(c), target = args.input ? await w.importTarget(resolve(c.cwd, text(args.input, 4096))) : w.target(id(o.target));
|
|
65
|
+
const input = await w.artifacts.verify(target.input), timeoutMs = number(o.timeoutSeconds, 600, 1) * 1000;
|
|
66
|
+
return sevenzipInstaller(c).use(async (selected) => {
|
|
67
|
+
const invoke = (role, parameters, extra = {}) => runTool(c, { tool: 'sevenzip', role, installation: selected.id, executable: selected.executable, arguments: [...selected.arguments, ...parameters], environment: selected.environment, target: target.id, timeoutMs, ...extra });
|
|
68
|
+
if (name === 'test') {
|
|
69
|
+
const result = await invoke('test', ['t', '-bd', '-y', '-p', '--', input]);
|
|
70
|
+
return { state: 'verified', target: target.id, inputSha256: target.binarySha256, process: result.process, elapsedMs: result.elapsedMs, diagnostics: result.diagnostics, content: result.stdout };
|
|
71
|
+
}
|
|
72
|
+
const listing = await invoke('inventory', ['l', '-slt', '-ba', '-sccUTF-8', '-p', '--', input]);
|
|
73
|
+
const entries = parseArchiveListing(listing.stdout);
|
|
74
|
+
const base = { target: target.id, inputSha256: target.binarySha256, process: listing.process, diagnostics: listing.diagnostics, total: entries.length };
|
|
75
|
+
if (name === 'list') {
|
|
76
|
+
const limit = number(o.limit, 100, 1), offset = number(o.offset, 10000, 0);
|
|
77
|
+
return { ...base, items: entries.slice(offset, offset + limit), limit, offset, truncated: offset + limit < entries.length };
|
|
78
|
+
}
|
|
79
|
+
const chosen = o.entry ? entries.filter(e => e.path === text(o.entry, 2048)) : entries;
|
|
80
|
+
if (!chosen.length)
|
|
81
|
+
fail('notFound', 'No matching archive entry.');
|
|
82
|
+
if (chosen.length > 512)
|
|
83
|
+
fail('limit', 'Select an entry; bulk recovery is limited to 512 entries.');
|
|
84
|
+
const paths = new Set();
|
|
85
|
+
let bytes = 0;
|
|
86
|
+
for (const entry of chosen) {
|
|
87
|
+
safeArchivePath(entry.path);
|
|
88
|
+
const key = entry.path.normalize('NFC').toLowerCase();
|
|
89
|
+
if (paths.has(key))
|
|
90
|
+
fail('unsupported', 'Archive output paths collide.');
|
|
91
|
+
paths.add(key);
|
|
92
|
+
if (entry.encrypted)
|
|
93
|
+
fail('unsupported', 'Encrypted recovery is not supported by this adapter.');
|
|
94
|
+
if (entry.size > 64 * 1024 ** 2 || (bytes += entry.size) > 256 * 1024 ** 2)
|
|
95
|
+
fail('limit', 'Recovery exceeds its 64-MiB per-file/256-MiB total bound.');
|
|
96
|
+
if (/(?:^|\s)[bclps][rwx-]{9}/.test(entry.attributes))
|
|
97
|
+
fail('unsupported', 'Only ordinary archive files and directories can be recovered.');
|
|
98
|
+
}
|
|
99
|
+
const output = resolve(c.cwd, text(o.output, 4096));
|
|
100
|
+
await mkdir(dirname(output), { recursive: true, mode: 0o700 });
|
|
101
|
+
await mkdir(output, { mode: 0o700 });
|
|
102
|
+
const files = [];
|
|
103
|
+
for (const entry of chosen) {
|
|
104
|
+
const destination = join(output, entry.path);
|
|
105
|
+
if (entry.directory) {
|
|
106
|
+
await mkdir(destination, { recursive: true, mode: 0o700 });
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
await mkdir(dirname(destination), { recursive: true, mode: 0o700 });
|
|
110
|
+
const result = await invoke('recover', ['x', '-so', '-spd', '-bd', '-y', '-p', '--', input, entry.path], { maxOutputBytes: Math.max(65536, entry.size + 65536), outputFile: destination });
|
|
111
|
+
if ((await lstat(destination)).size !== entry.size)
|
|
112
|
+
fail('binding', 'Recovered file size differs from the inventory; retained partial output requires inspection.');
|
|
113
|
+
files.push({ path: entry.path, size: entry.size, process: result.process });
|
|
114
|
+
}
|
|
115
|
+
return { ...base, state: 'extracted', outputDirectory: output, files, bytes, publication: 'ordinary files; no shared analysis merge' };
|
|
116
|
+
});
|
|
117
|
+
}, { permission: Permission.Update, options: [...common, ...(name === 'list' ? [{ flags: '--limit <count>', description: 'Page size (1–100)', defaultValue: 50 }, { flags: '--offset <count>', description: 'Skip entries', defaultValue: 0 }] : name === 'extract' ? [{ flags: '--entry <path>', description: 'Recover one exact regular entry' }, { flags: '--output <directory>', description: 'New output directory', required: true }] : [])] });
|
|
118
|
+
return [command('sevenzip', definition.description, [...lifecycleCommands(definition), operation('list'), operation('test'), operation('extract')])];
|
|
119
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CommandContext, type CommandDefinition } from '@eyeauras/cli-factory';
|
|
2
|
+
import { ToolInstaller } from './tool-runtime/installer.js';
|
|
3
|
+
import type { Workspace } from './workspace.js';
|
|
4
|
+
export declare function straceInstaller(c: CommandContext): ToolInstaller;
|
|
5
|
+
export declare function stracePlan(o: Record<string, unknown>): {
|
|
6
|
+
events: string[];
|
|
7
|
+
arguments: string[];
|
|
8
|
+
programArguments: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare function straceCommands(workspace: (c: CommandContext) => Workspace): CommandDefinition[];
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { command, Permission } from '@eyeauras/cli-factory';
|
|
2
|
+
import { dirname, join, resolve } from 'node:path';
|
|
3
|
+
import { mkdir, writeFile, open, copyFile, chmod } from 'node:fs/promises';
|
|
4
|
+
import { constants } from 'node:fs';
|
|
5
|
+
import { randomUUID } from 'node:crypto';
|
|
6
|
+
import { ToolInstaller } from './tool-runtime/installer.js';
|
|
7
|
+
import { defineTool, lifecycleCommands } from './tool-runtime/definition.js';
|
|
8
|
+
import { catalogArtifact } from './tool-runtime/catalog.js';
|
|
9
|
+
import { runTool } from './tool-runtime/run.js';
|
|
10
|
+
import { fileSha256 } from './tool-runtime/archives.js';
|
|
11
|
+
import { fail, text, id } from './model.js';
|
|
12
|
+
import { number } from './research.js';
|
|
13
|
+
// Exact binary from the reviewed reproducible Linux source build.
|
|
14
|
+
const archiveSha = '3f01b360952f9c81dee07b640916115f937685df6d3004f5a3227cb0582d8ca3';
|
|
15
|
+
function supported() { if (process.platform !== 'linux' || process.arch !== 'x64')
|
|
16
|
+
fail('unsupported', 'The strace facade requires Linux x64, glibc 2.35+ and permission to trace its owned child.'); }
|
|
17
|
+
export function straceInstaller(c) {
|
|
18
|
+
return new ToolInstaller(c, { id: 'strace', primary: 'strace', components: () => { supported(); return { strace: catalogArtifact(archiveSha) }; }, launch: roots => ({ executable: join(roots.strace, 'bin/strace'), arguments: [], environment: {} }), probe: async (launch, context) => {
|
|
19
|
+
supported();
|
|
20
|
+
const r = await runTool(context, { tool: 'strace', role: 'version', executable: launch.executable, arguments: ['--version'], maxOutputBytes: 65536, timeoutMs: 10000, nativeDeadline: true });
|
|
21
|
+
if (!/strace -- version 7\.2\b/.test(r.stdout + '\n' + r.stderr))
|
|
22
|
+
fail('configuration', 'Select strace 7.2 with --kill-on-exit support.');
|
|
23
|
+
return { version: '7.2', ownedChildOnly: true, killOnExit: true, kernelOwnerDeadline: true };
|
|
24
|
+
} });
|
|
25
|
+
}
|
|
26
|
+
export function stracePlan(o) {
|
|
27
|
+
const requested = text(o.events ?? 'file,process,io', 128).split(','), groups = { file: '%file', process: '%process', network: '%network', io: 'read,write,readv,writev' };
|
|
28
|
+
if (!requested.length || requested.length > 4 || requested.some(x => !groups[x]) || new Set(requested).size !== requested.length)
|
|
29
|
+
fail('invalid', '--events must contain unique file, process, network or io categories.');
|
|
30
|
+
const args = o.arg === undefined ? [] : Array.isArray(o.arg) ? o.arg : [o.arg];
|
|
31
|
+
if (args.length > 64)
|
|
32
|
+
fail('limit', 'At most 64 literal program arguments are supported.');
|
|
33
|
+
return { events: requested, arguments: ['--kill-on-exit', '-f', '-yy', '-s', String(number(o.stringBytes ?? 128, 1024, 1)), '-e', 'trace=' + requested.map(x => groups[x]).join(','), ...(o.path ? ['-P', resolve(text(o.path, 4096))] : [])], programArguments: args.map(v => text(v, 4096)) };
|
|
34
|
+
}
|
|
35
|
+
export function straceCommands(workspace) {
|
|
36
|
+
const definition = defineTool({ id: 'strace', description: 'Observe file, process, I/O and network syscalls in an owned native Linux launch', components: [{ id: 'strace', version: '7.2', artifacts: [] }], lifecycle: { download: (o, c) => straceInstaller(c).download(Boolean(o.offline)), install: (o, c) => straceInstaller(c).install(o), uninstall: (o, c) => straceInstaller(c).uninstall(Boolean(o.purgeCache)), doctor: (_o, c) => straceInstaller(c).doctor(), status: (_o, c) => straceInstaller(c).status() } });
|
|
37
|
+
return [command('strace', definition.description, [...lifecycleCommands(definition), command('trace [input]', 'Run an authorized owned ELF copy and retain bounded syscall observations', async ({ args, options: o }, c) => {
|
|
38
|
+
supported();
|
|
39
|
+
if (Boolean(args.input) === Boolean(o.target))
|
|
40
|
+
fail('invalid', 'Supply exactly one executable input or --target.');
|
|
41
|
+
if (o.path)
|
|
42
|
+
o = { ...o, path: resolve(c.cwd, text(o.path, 4096)) };
|
|
43
|
+
const plan = stracePlan(o), limit = number(o.limit ?? 200, 1000, 1), offset = number(o.offset ?? 0, 1000000), timeoutMs = number(o.timeoutSeconds ?? 30, 600, 1) * 1000;
|
|
44
|
+
const w = workspace(c), target = args.input ? await w.importTarget(resolve(c.cwd, text(args.input, 4096))) : w.target(id(o.target)), input = await w.artifacts.verify(target.input), header = Buffer.alloc(64), handle = await open(input, 'r');
|
|
45
|
+
try {
|
|
46
|
+
const { bytesRead } = await handle.read(header, 0, 64, 0);
|
|
47
|
+
if (bytesRead < 64 || header.subarray(0, 4).toString('hex') !== '7f454c46' || header[4] !== 2 || header[5] !== 1 || header.readUInt16LE(18) !== 62)
|
|
48
|
+
fail('unsupported', 'An owned launch requires a native little-endian x64 ELF executable.');
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
await handle.close();
|
|
52
|
+
}
|
|
53
|
+
const directory = join(c.appArguments.AppDataDirectory, 'runtime/strace/subjects', randomUUID()), subject = join(directory, 'subject');
|
|
54
|
+
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
55
|
+
await copyFile(input, subject, constants.COPYFILE_EXCL);
|
|
56
|
+
await chmod(subject, 0o700);
|
|
57
|
+
if (await fileSha256(subject) !== target.binarySha256)
|
|
58
|
+
fail('binding', 'Owned ELF bytes differ from the immutable target.');
|
|
59
|
+
return straceInstaller(c).use(async (selected) => {
|
|
60
|
+
const result = await runTool(c, { tool: 'strace', role: 'trace', installation: selected.id, executable: selected.executable, arguments: [...plan.arguments, '--', subject, ...plan.programArguments], cwd: c.cwd, target: target.id, timeoutMs, nativeDeadline: true, metadata: { inputSha256: target.binarySha256, events: plan.events } }), lines = result.stderr.trimEnd().split(/\r?\n/);
|
|
61
|
+
const base = { state: 'completed', target: target.id, inputSha256: target.binarySha256, process: result.process, elapsedMs: result.elapsedMs, diagnostics: result.diagnostics, events: plan.events, programStdout: result.stdout, coverage: 'Observed syscalls from one owned launch and its traced descendants. Native trace and program stderr share the stderr stream. Strings and category/path filters are bounded; unobserved operations are unknown. Application side effects require authorization; adjacent executable sidecars are not copied.' };
|
|
62
|
+
if (o.output) {
|
|
63
|
+
const output = resolve(c.cwd, text(o.output, 4096)), content = JSON.stringify({ ...base, lines }, null, 2) + '\n';
|
|
64
|
+
await mkdir(dirname(output), { recursive: true, mode: 0o700 });
|
|
65
|
+
await writeFile(output, content, { flag: 'wx', mode: 0o600 });
|
|
66
|
+
return { ...base, output, bytes: Buffer.byteLength(content), totalLines: lines.length };
|
|
67
|
+
}
|
|
68
|
+
return { ...base, lines: lines.slice(offset, offset + limit), offset, limit, totalLines: lines.length, truncated: offset + limit < lines.length };
|
|
69
|
+
});
|
|
70
|
+
}, { permission: Permission.Update, options: [{ flags: '--target <id>', description: 'Reuse an immutable captured native ELF' }, { flags: '--arg <literal...>', description: 'Literal arguments, without shell expansion' }, { flags: '--events <categories>', description: 'Comma-separated file, process, io or network', defaultValue: 'file,process,io' }, { flags: '--path <path>', description: 'Optional literal path filter; combines with selected categories' }, { flags: '--string-bytes <bytes>', description: 'Maximum native string bytes (1–1024)', defaultValue: 128 }, { flags: '--output <file>', description: 'Save bounded trace and program stdout to a new ordinary JSON file' }, { flags: '--limit <count>', description: 'Maximum trace lines (1–1000)', defaultValue: 200 }, { flags: '--offset <count>', description: 'Skip trace lines', defaultValue: 0 }, { flags: '--timeout-seconds <seconds>', description: 'Owned launch deadline (1–600)', defaultValue: 30 }] })])];
|
|
71
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Public text coordinates are Unicode code points, never native bytes or UTF-16 halves. */
|
|
2
|
+
export declare function textWindow(source: string, limit: number, offset: number, sourceTruncated?: boolean): {
|
|
3
|
+
content: string;
|
|
4
|
+
textSha256: string;
|
|
5
|
+
totalCharacters: number;
|
|
6
|
+
limit: number;
|
|
7
|
+
offset: number;
|
|
8
|
+
sourceTruncated: boolean;
|
|
9
|
+
truncated: boolean;
|
|
10
|
+
coordinates: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
/** Public text coordinates are Unicode code points, never native bytes or UTF-16 halves. */
|
|
3
|
+
export function textWindow(source, limit, offset, sourceTruncated = false) {
|
|
4
|
+
const characters = Array.from(source);
|
|
5
|
+
return { content: characters.slice(offset, offset + limit).join(''), textSha256: createHash('sha256').update(source).digest('hex'), totalCharacters: characters.length, limit, offset, sourceTruncated, truncated: sourceTruncated || offset + limit < characters.length, coordinates: 'Unicode characters in the returned native text; hash binds that text, which may itself be a truncated prefix' };
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ToolArtifact } from './definition.js';
|
|
2
|
+
export declare function fileSha256(path: string, signal?: AbortSignal): Promise<string>;
|
|
3
|
+
export declare function archiveName(name: string): string;
|
|
4
|
+
export declare function extractArchive(file: string, destination: string, format: 'tgz' | 'zip', signal?: AbortSignal): Promise<void>;
|
|
5
|
+
export declare function cacheArtifact(artifact: ToolArtifact, cache: string, fetcher: typeof fetch, signal: AbortSignal, offline?: boolean, vendorDirect?: boolean): Promise<string>;
|
|
6
|
+
/** Consume local input once; extraction never races later edits to the caller's archive. */
|
|
7
|
+
export declare function consumeArchive(path: string, cache: string, artifact: ToolArtifact, checksum?: string, signal?: AbortSignal): Promise<{
|
|
8
|
+
path: string;
|
|
9
|
+
artifact: ToolArtifact;
|
|
10
|
+
}>;
|