Closed anjuls closed 3 years ago
Hi @anjuls Thank you for reporting this issue.
Could you please help me with the below information?
1) Were you able to scan using Target URL instead of choosing from config file? If yes, did it work normally? 2) Please set your server url and Token as below and try curl command and see if you can get a http 200 response
APISERVER='' TOKEN=''
curl $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
3) Is your cluster running on GKE/Azure?
FWIW, that server URL does not look like a standard k8s API server, you wouldn't expect to see a path in the server parameters, just a hostname/IP address and port. Also there's no certificate-authority-data field in cluster, which client apps will usually use to validate the authenticity of the server cert.
So an interesting piece of information that would likely help debug this issue is, what distribution of Kubernetes is in use here?
I am using EKS and that config file works with other Kubernetes clients (like k9s, kubectl) API Endpoint is behind the ELB so you are seeing that kind of URL and user token is used for authentication.
@kubestrike Target URL didn't work, it just came out without any error. And I got HTTP 200.
kubestrike$ curl $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
{
"kind": "APIVersions",
"versions": [
"v1"
],
"serverAddressByClientCIDRs": [
{
"clientCIDR": "0.0.0.0/0",
"serverAddress": "ip-xxxxx.us-west-2.compute.internal:443"
}
]
Hi @anjuls ,
Can you please use "ip-xxxxx.us-west-2.compute.internal:443" as listed above to scan your Target?
Please let me know if you have any issues.
Regards, Vasant
(env) xxx@xxx:~/learning/kubestrike/kubestrike$ curl $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
{
"kind": "APIVersions",
"versions": [
"v1"
],
"serverAddressByClientCIDRs": [
{
"clientCIDR": "0.0.0.0/0",
"serverAddress": "ip-xxxxx.us-west-2.compute.internal:443"
}
]
(env) xxx@xxx:~/learning/kubestrike/kubestrike$ python -m kubestrike
###########################################################################
______ __ __ __ _ __ __
\ \ \ \ / /____ __/ /_ ___ _____/ /______(_) /_____ \ \
\ \ \ \______/ //_/ / / / __ \/ _ \______/ ___/ __/ ___/ / //_/ _ \_____\ \
/ / / /_____/ ,< / /_/ / /_/ / __/_____(__ ) /_/ / / / ,< / __/_____/ /
/_/_/_/ /_/|_|\__,_/_.___/\___/ /____/\__/_/ /_/_/|_|\___/ /_/
########################################################################### v1.0.0
[+] Gearing up Kube-Strike......................................................
Choose one of the below options: (Use arrow keys)
Enter the target K8s Endpoint : ip-xxxx.us-west-2.compute.internal:443
---------------------------------------
< Target is neither reachable nor valid >
---------------------------------------
\ ^__^
\ (oo)\________
(__)\ )\/\
||----W |
|| ||
Hi @anjuls ,
Just tested on a few clusters and it Seems to be working as expected.
You may have to try with the actual Kubernetes cluster EndPoint.
After selecting option 2 (configfile) -> default, it gives me HTTPS URL to select and then it fails. saying input is not valid.