KubeStalk is a tool to discover Kubernetes and related infrastructure based attack surface from a black-box perspective. This tool is a community version of the tool used to probe for unsecured Kubernetes clusters around the internet during Project Resonance – Wave 9.
Usage
The GIF below demonstrates usage of the tool:
Installation
KubeStalk is written in Python and requires the requests
library.
To install the tool, you can clone the repository to any directory:
git clone https://github.com/redhuntlabs/kubestalk
Once cloned, you need to install the requests
library using python3 -m pip install requests
or:
python3 -m pip install -r requirements.txt
Everything is setup and you can use the tool directly.
Command-line Arguments
A list of command line arguments supported by the tool can be displayed using the -h
flag.
<div class="highlight highlight-source-m68k notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ python3 kubestalk.py -h +———————+ | K U B E S T A L K | +———————+ v0.1 [!] KubeStalk by RedHunt Labs – A Modern Attack Surface (ASM) Management Company [!] Author: 0xInfection (RHL Research Team) [!] Continuously Track Your Attack Surface using https://redhuntlabs.com/nvadr. usage: ./kubestalk.py / Required Arguments: urls List of hosts to scan Optional Arguments: -o OUTPUT, –output OUTPUT Output path to write the CSV file to -f SIG_FILE, –sig-dir SIG_FILE Signature directory path to load -t TIMEOUT, –timeout TIMEOUT HTTP timeout value in seconds -ua USER_AGENT, –user-agent USER_AGENT User agent header to set in HTTP requests –concurrency CONCURRENCY No. of hosts to process simultaneously –verify-ssl Verify SSL certificates –version Display the version of KubeStalk and exit.” dir=”auto”>
$ python3 kubestalk.py -h+---------------------+
| K U B E S T A L K |
+---------------------+ v0.1
[!] KubeStalk by RedHunt Labs - A Modern Attack Surface (ASM) Management Company
[!] Author: 0xInfection (RHL Research Team)
[!] Continuously Track Your Attack Surface using https://redhuntlabs.com/nvadr.
usage: ./kubestalk.py <url(s)>/<cidr>
Required Arguments:
urls List of hosts to scan
Optional Arguments:
-o OUTPUT, --output OUTPUT
Output path to write the CSV file to
-f SIG_FILE, --sig-dir SIG_FILE
Signature directory path to load
-t TIMEOUT, --timeout TIMEOUT
HTTP timeout value in seconds
-ua USER_AGENT, --user-agent USER_AGENT
User agent header t o set in HTTP requests
--concurrency CONCURRENCY
No. of hosts to process simultaneously
--verify-ssl Verify SSL certificates
--version Display the version of KubeStalk and exit.