Skip to content

kube-hunter

60 commands

Hunts for security weaknesses in Kubernetes clusters from inside or outside, reporting exposed components and known issues. Archived upstream but still informative.

  • Kubernetes
  • penetration testing

Install kube-hunter

pipx install kube-hunter

Basic Execution4

kube-hunter

Runs kube-hunter in interactive mode to select scan types manually.

kube-hunter --list

Lists all available passive and active hunters (plugins) currently supported.

kube-hunter --version

Displays the current version of the kube-hunter tool.

kube-hunter --help

Shows the help menu with all available command-line arguments and flags.

Remote Scanning5

kube-hunter --remote [IP]

Scans a specific remote IP address for Kubernetes vulnerabilities.

Link
kube-hunter --remote [DNS_NAME]

Scans a specific remote domain name for Kubernetes exposure.

Link
kube-hunter --cidr [CIDR_BLOCK]

Performs a scan across an entire network CIDR range to find Kubernetes nodes.

Link
kube-hunter --remote [IP1] --remote [IP2]

Scans multiple distinct remote IP addresses in a single execution.

Link
kube-hunter --url [URL]

Targets a specific Kubernetes API server URL for assessment.

Link

Local Scanning2

kube-hunter --interface

Selects a local network interface to scan via interactive mode.

Link
kube-hunter --network [INTERFACE_TYPE]

Configures the network scanning mode to use the host network interface.

Link

Active Hunting3

kube-hunter --active

Enables active hunting mode to attempt harmless exploitation of found vulnerabilities.

Link
kube-hunter --remote [IP] --active

Performs an active vulnerability scan against a specific remote target.

Link
kube-hunter --cidr [CIDR] --active

Scans a network range and actively verifies vulnerabilities on discovered nodes.

Link

Reporting and Output6

kube-hunter --report json

Outputs the scan results in JSON format for automated parsing.

Link
kube-hunter --report yaml

Outputs the scan results in YAML format for configuration management tools.

Link
kube-hunter --report plain

Outputs the scan results in plain text format for human readability.

Link
kube-hunter --log [LEVEL]

Sets the logging verbosity level to debug for detailed troubleshooting.

Link
kube-hunter --log warn

Reduces logging verbosity to show only warnings and errors.

Link
kube-hunter --statistics

Displays execution statistics at the end of the scan.

Link

Targeted Hunting3

kube-hunter --include-hunters [HUNTER_NAME]

Runs only the specified hunter, skipping all other checks.

Link
kube-hunter --exclude-hunters [HUNTER_NAME]

Runs all hunters except the one specified.

Link
kube-hunter --include-hunters [LIST]

Runs a comma-separated list of specific hunters for a focused audit.

Link

Internal/Pod Mode2

kube-hunter --pod

Flags execution as running inside a pod to leverage internal service discovery.

Link
kube-hunter --quick

Performs a quick scan by limiting subnet ranges and timeouts.

Link

Automation & Integration2

kube-hunter --dispatch stdout

Forces results to standard output, useful for simple pipe operations.

Link
kube-hunter --dispatch http --dispatch-url [URL]

Sends scan reports via HTTP POST to a remote collector URL.

Link

Advanced Configuration2

kube-hunter --mapping

Outputs a mapping of the discovered nodes and cluster topology.

Link
kube-hunter --cidr [CIDR] --mapping

Maps the topology of a specific network range without running full vulnerability checks.

Link

Cloud Security Posture3

kube-hunter --remote [IP] --include-hunters GKEKubeletAnonymous

Checks specifically for anonymous Kubelet access on GKE clusters.

Link
kube-hunter --remote [IP] --include-hunters EKSKubeletAnonymous

Checks specifically for anonymous Kubelet access on EKS clusters.

Link
kube-hunter --remote [IP] --include-hunters AKSKubeletAnonymous

Checks specifically for anonymous Kubelet access on AKS clusters.

Link

Blue Team Validation2

kube-hunter --remote [IP] --report json > scan_results.json

Saves remote scan results to a JSON file for defensive analysis.

Link
kube-hunter --cidr [CIDR] --active --log warn

Runs a low-noise active scan over a large network to identify critical misconfigurations.

Link

Purple Team Simulation2

kube-hunter --active --include-hunters MountServiceToken

Actively attempts to mount and read service account tokens to simulate privilege escalation.

Link
kube-hunter --active --include-hunters AnonymousAccess

Actively tests if anonymous users can access restricted API endpoints.

Link

Incident Response2

kube-hunter --list | grep [KEYWORD]

Filters the hunter list to identify available checks for specific components like etcd.

Link
kube-hunter --remote [IP] --include-hunters EtcdRemoteAccess

Verifies if the etcd service is exposed and accessible remotely.

Link

Advanced Workflow3

kube-hunter --remote [IP] --report json --dispatch http --dispatch-url [URL]

Combines JSON reporting with HTTP dispatch for immediate remote logging.

Link
kube-hunter --pod --active --report yaml

Runs inside a pod in active mode and generates a YAML report for GitOps processing.

Link
kube-hunter --cidr [CIDR] --exclude-hunters [NOISY_HUNTERS]

Scans a network while excluding specific noisy discovery hunters.

Link

Validation & Compliance2

kube-hunter --include-hunters DashboardDiscovery,DashboardProxy

Focuses the audit strictly on Kubernetes Dashboard exposures.

Link
kube-hunter --include-hunters KubeletReadOnlyPorts,KubeletSecurePort

Focuses the audit strictly on Kubelet port configurations.

Link

Active Exploitation1

kube-hunter --active --include-hunters RCE

Attempts to verify Remote Code Execution vulnerabilities in discovered services.

Link

Pipeline Integration1

kube-hunter --cidr [CIDR] --report json --log none

Runs a silent scan outputting only JSON, ideal for parsing in CI pipelines.

Link

Specific Vulnerability1

kube-hunter --include-hunters CVE-2018-1002105

Checks specifically for the critical Kubernetes privilege escalation vulnerability (if supported by version).

Link

Specific Service2

kube-hunter --remote [IP] --include-hunters ProxyDiscovery

Checks specifically for an exposed Kubernetes Proxy service.

Link
kube-hunter --remote [IP] --include-hunters AzureSpnExposure

Checks for exposed Azure Service Principal Names in the cluster.

Link

Network Mapping1

kube-hunter --cidr [CIDR] --quick --report json

Performs a fast network discovery scan and outputs results as JSON.

Link

Full Audit1

kube-hunter --remote [IP] --active --log debug

Runs a comprehensive active audit on a single host with full debug logging.

Link

Containerized Execution3

docker run -it --rm --network host aquasec/kube-hunter

Runs the official kube-hunter container using the host network for visibility.

Link
docker run --rm aquasec/kube-hunter --cidr [CIDR]

Runs the kube-hunter container to scan a specific remote CIDR.

Link
docker run --rm aquasec/kube-hunter --pod

Runs the container in pod mode (useful when deployed as a Job inside K8s).

Link

Complex Workflow1

kube-hunter --cidr [CIDR] --active --dispatch http --dispatch-url [URL] --report json

Maximal command combining range scan, active hunting, JSON reporting, and HTTP dispatch.

Link

Specific Hunter4

kube-hunter --include-hunters ApiServerDiscovery

Limits the scan to identifying if the API server is discoverable.

Link
kube-hunter --include-hunters EtcdDiscovery

Limits the scan to identifying if the Etcd service is discoverable.

Link
kube-hunter --active --include-hunters KubectlClient

Actively checks if an exposed kubectl client configuration can be exploited.

Link
kube-hunter --active --include-hunters HelmDiscovery

Checks for exposed Helm Tiller instances (relevant for older clusters).

Link

Timeout Tuning1

kube-hunter --remote [IP] --request-timeout [SECONDS]

Sets a custom timeout for network requests to handle slow networks.

Link

Cleanup1

pkill -f kube-hunter

Forcefully terminates running kube-hunter processes.

Link