Help us shape the future of Go! Take the 2026 Go Developer Survey

shellkit

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

README

shellkit

Authorized-use-only offensive WebShell capability. This package lives inside the single capkit module (no separate go.mod); it is imported alongside the benign kits when a host needs WebShell capability.

shellkit/protocol   plain / Behinder / Godzilla codecs (stdlib only)
shellkit/payload    PHP/ASP/ASPX/JSP payload renderer (stdlib only)
shellkit/memshell   Tomcat/Spring/ASP.NET/PHP memory-shell generator + host Deployer
shellkit/tunnel     target-side JSP/PHP SOCKS page generator + host Sink/PageDeployer
shellkit/plan       DeliveryPlan + host-provided DeliverySink/Verifier
shellkit/session    Session + host-provided Executor
shellkit/delivery   pure state machine (pending → delivered → verified → registered → cleaned)

Host boundaries

  • plan.DeliverySink must perform the actual upload. This package has no default HTTP uploader.
  • session.Executor must perform command/file operations. This package has no default command executor.
  • The host must enforce project scope, approval, evidence and cleanup before calling these interfaces.
  • The host must ensure it has explicit authorization for every target.

Rules

  • Never add default targets, credentials, payloads, wordlists, or one-click exploit chains.
  • Keep protocol/payload free of I/O and host dependencies.
  • Do not import benign kits from shellkit or vice versa; both depend on the capkit root contracts only (shellkit subpackages may import each other).

License

Apache-2.0, same as the rest of the capkit module. Use only in authorized security testing and research.

Documentation

Overview

Package shellkit exposes the WebShell/C2 foothold as capkit session tools. It owns no transport itself: the host injects a session.Executor for WebShells and a core.SessionManager, and these tools drive them through the same contract SSH and WinRM use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifest

func Manifest() core.Manifest

Manifest declares the session and delivery tools.

func NewCapability

func NewCapability(deps core.Deps) (core.Capability, error)

NewCapability builds the session capability.

func NewCapabilityWithDeployer

func NewCapabilityWithDeployer(deps core.Deps, deployer WebShellDeployer) (core.Capability, error)

NewCapabilityWithDeployer builds the session capability with a host-supplied delivery channel, which is what enables webshell_deploy. The deployer cannot ride in core.Deps because it is shellkit-specific (the same reason enterprisekit takes its resolver separately).

Types

type Capability

type Capability struct {
	// contains filtered or unexported fields
}

Capability exposes foothold management and session operations as tools. Everything routes through core.SessionManager, so a WebShell, SSH or WinRM session is used identically.

func (*Capability) Call

func (c *Capability) Call(ctx context.Context, call core.Call) (core.Result, error)

Call dispatches the session tools.

func (*Capability) Manifest

func (c *Capability) Manifest() core.Manifest

Manifest implements core.Capability.

type WebShellDeployer

type WebShellDeployer interface {
	Drop(ctx context.Context, req WebShellDrop) (*WebShellDropResult, error)
}

WebShellDeployer is the host boundary for actually placing a shell on the target. The host owns the transport — typically the same gate-aware HTTPDoer it used for the probe that confirmed execution — and must apply its own scope/approval/evidence policy on top of the runtime's.

type WebShellDrop

type WebShellDrop struct {
	TargetURL string
	Method    string
	Dir       string
	Filename  string
	Content   []byte
	SHA256    string
	ShellType string
	CmdParam  string
	PassParam string
	// Password is the connection secret baked into the payload. The host needs
	// it to register the session; it must not be logged or stored in evidence.
	Password string
	Variant  string
	Protocol string
}

WebShellDrop is what the host is handed: the rendered payload plus where it should go. Content is the exact bytes to write; the host decides how.

type WebShellDropResult

type WebShellDropResult struct {
	FileURL string
	// Cleanup is the command that removes the file (e.g. `rm -f /var/www/x.php`).
	Cleanup string
	// CleanupURL, when set, is an URL that removes the file when requested.
	CleanupURL string
}

WebShellDropResult is what the host reports back. FileURL is the URL that serves the dropped shell, and the tool turns it into a session_open spec.

type WebShellOpener

type WebShellOpener struct {
	Executor session.Executor
}

WebShellOpener adapts a host session.Executor into a core.SessionOpener for kind "webshell". Shell parameters (cmd param, password, protocol) travel in SessionSpec.Options so the tool input stays transport-neutral.

func (*WebShellOpener) Open

Open builds a WebShell-backed core.Session.

Directories

Path Synopsis
Package delivery contains the pure delivery state machine.
Package delivery contains the pure delivery state machine.
Package listener is a small Go reverse-shell session manager.
Package listener is a small Go reverse-shell session manager.
Package memshell 内存马注入载荷生成。
Package memshell 内存马注入载荷生成。
Package payload renders minimal, protocol-compatible WebShell payloads.
Package payload renders minimal, protocol-compatible WebShell payloads.
Package plan describes a WebShell delivery without performing it.
Package plan describes a WebShell delivery without performing it.
Package shell WebShell 流量协议层。
Package shell WebShell 流量协议层。
adapter.go bridges the WebShell model (Session + host Executor) to the core.Session contract, so a WebShell foothold gets the same Exec/upload/ download surface as SSH and every downstream kit works against it unchanged.
adapter.go bridges the WebShell model (Session + host Executor) to the core.Session contract, so a WebShell foothold gets the same Exec/upload/ download surface as SSH and every downstream kit works against it unchanged.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL