internalnetkit

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package internalnetkit performs internal-network reconnaissance from an established foothold (docs 究极渗透能力包实现方案 §4.10, phase P2).

Everything here runs THROUGH a capkit.Session: host surveys, live-host discovery, port scanning, domain information gathering and SMB share enumeration are all executed on the target side with `Exec`, never from the machine running the kit. Sessions are resolved from capkit.Deps.Sessions, so a WebShell, SSH, WinRM or CLI foothold is used identically.

Output parsing lives in parse.go as pure functions (cheap to test, fail closed: an unparseable command yields an empty result rather than a guess).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifest

func Manifest() capkit.Manifest

Manifest declares the internalnetkit tools.

func NewCapability

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

NewCapability builds the capability.

Types

type ARPEntry

type ARPEntry struct {
	IP    string `json:"ip"`
	MAC   string `json:"mac,omitempty"`
	Iface string `json:"iface,omitempty"`
	Type  string `json:"type,omitempty"`
}

ARPEntry is one neighbour-cache entry (linux `arp -a`, windows `arp -a`).

type Adapter

type Adapter struct {
	Name        string   `json:"name,omitempty"`
	Description string   `json:"description,omitempty"`
	MAC         string   `json:"mac,omitempty"`
	IPv4        []string `json:"ipv4,omitempty"`
	Mask        string   `json:"mask,omitempty"`
	Gateway     string   `json:"gateway,omitempty"`
	DNS         []string `json:"dns,omitempty"`
	DHCP        bool     `json:"dhcp,omitempty"`
}

Adapter is one windows network adapter.

type Capability

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

Capability exposes the internal-network reconnaissance tools.

func (*Capability) Call

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

Call dispatches one tool invocation and normalizes the envelope on every return path (Status/OK/Meta.Tool/Meta.Version/Summary clamp).

func (*Capability) Manifest

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

Manifest implements capkit.Capability.

type DiscoveredHost

type DiscoveredHost struct {
	Host   string `json:"host"`
	Method string `json:"method,omitempty"`
	MAC    string `json:"mac,omitempty"`
}

DiscoveredHost is one live host found through the foothold.

type DomainInfo

type DomainInfo struct {
	Domain string   `json:"domain,omitempty"`
	Users  []string `json:"users,omitempty"`
	Groups []string `json:"groups,omitempty"`
	Trusts []string `json:"trusts,omitempty"`
	DCs    []string `json:"dcs,omitempty"`
}

DomainInfo is the tool payload.

type HostDiscovery

type HostDiscovery struct {
	CIDR      string           `json:"cidr"`
	Method    string           `json:"method"`
	Probed    int              `json:"probed"`
	Truncated bool             `json:"truncated"`
	Hosts     []DiscoveredHost `json:"hosts"`
}

HostDiscovery is the tool payload.

type Ipconfig

type Ipconfig struct {
	Hostname string    `json:"hostname,omitempty"`
	Domain   string    `json:"domain,omitempty"`
	Adapters []Adapter `json:"adapters,omitempty"`
}

Ipconfig is a parsed windows `ipconfig /all`.

type Listener

type Listener struct {
	Proto   string `json:"proto,omitempty"`
	Local   string `json:"local,omitempty"`
	Port    int    `json:"port,omitempty"`
	State   string `json:"state,omitempty"`
	PID     int    `json:"pid,omitempty"`
	Process string `json:"process,omitempty"`
}

Listener is one listening socket (linux `ss -tunlp`, windows `netstat -ano`).

type LocalInfo

type LocalInfo struct {
	OS         string         `json:"os,omitempty"`
	Hostname   string         `json:"hostname,omitempty"`
	User       string         `json:"user,omitempty"`
	Kernel     string         `json:"kernel,omitempty"`
	OSRelease  string         `json:"os_release,omitempty"`
	Interfaces []NetInterface `json:"interfaces,omitempty"`
	Routes     []Route        `json:"routes,omitempty"`
	Users      []string       `json:"users,omitempty"`
	Admins     []string       `json:"admins,omitempty"`
	Logins     []string       `json:"logins,omitempty"`
	ARP        []ARPEntry     `json:"arp,omitempty"`
	Listeners  []Listener     `json:"listeners,omitempty"`
	Processes  []Process      `json:"processes,omitempty"`
	Errors     []string       `json:"errors,omitempty"`
}

LocalInfo is the structured host survey payload.

type NetInterface

type NetInterface struct {
	Name  string   `json:"name,omitempty"`
	MAC   string   `json:"mac,omitempty"`
	IPv4  []string `json:"ipv4,omitempty"`
	IPv6  []string `json:"ipv6,omitempty"`
	Mask  string   `json:"mask,omitempty"`
	State string   `json:"state,omitempty"`
}

NetInterface is one local network interface (linux `ip addr`, windows `ipconfig /all`).

type OpenPort

type OpenPort struct {
	Host    string `json:"host"`
	Port    int    `json:"port"`
	Service string `json:"service,omitempty"`
}

OpenPort is one open port discovered through the foothold.

type PortScan

type PortScan struct {
	ProbedHosts int        `json:"probed_hosts"`
	ProbedPorts int        `json:"probed_ports"`
	Truncated   bool       `json:"truncated"`
	OpenCount   int        `json:"open_count"`
	TotalOpen   int        `json:"total_open"`
	Open        []OpenPort `json:"open"`
}

PortScan is the tool payload.

type Process

type Process struct {
	Name string `json:"name"`
	PID  int    `json:"pid,omitempty"`
}

Process is one running process (windows `tasklist`).

type Route

type Route struct {
	Dest    string `json:"dest"`
	Gateway string `json:"gateway,omitempty"`
	Iface   string `json:"iface,omitempty"`
	Metric  string `json:"metric,omitempty"`
}

Route is one routing-table entry (linux `ip route`, windows `route print`).

type SMBResult

type SMBResult struct {
	Target string  `json:"target"`
	Count  int     `json:"count"`
	Shares []Share `json:"shares"`
}

SMBResult is the tool payload.

type Share

type Share struct {
	Name    string `json:"name"`
	Type    string `json:"type,omitempty"`
	Comment string `json:"comment,omitempty"`
	Access  string `json:"access,omitempty"`
}

Share is one SMB share (windows `net share`/`net view`, linux `smbclient -L`).

Jump to

Keyboard shortcuts

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