mirror of
https://github.com/aquasecurity/kube-hunter.git
synced 2026-05-15 21:57:50 +00:00
Fixed some english mistakes & :-)
This commit is contained in:
@@ -73,7 +73,7 @@ class HostDiscovery(Hunter):
|
||||
|
||||
def get_cloud(self, host):
|
||||
try:
|
||||
logging.debug("Passive hunter is attempting to access azure's cloud")
|
||||
logging.debug("Passive hunter is checking whether the cluster is deployed on azure's cloud")
|
||||
metadata = requests.get("http://www.azurespeed.com/api/region?ipOrUrl={ip}".format(ip=host)).text
|
||||
except requests.ConnectionError as e:
|
||||
logging.info("- unable to check cloud: {0}".format(e))
|
||||
@@ -83,7 +83,7 @@ class HostDiscovery(Hunter):
|
||||
|
||||
def is_azure_pod(self):
|
||||
try:
|
||||
logging.debug("Passive hunter is attempting to access azure's pod")
|
||||
logging.debug("Attempting to access Azure Metadata API")
|
||||
if requests.get("http://169.254.169.254/metadata/instance?api-version=2017-08-01", headers={"Metadata":"true"}, timeout=5).status_code == 200:
|
||||
return True
|
||||
except requests.exceptions.ConnectionError:
|
||||
@@ -114,7 +114,7 @@ class HostDiscovery(Hunter):
|
||||
# for normal scanning
|
||||
def scan_interfaces(self):
|
||||
try:
|
||||
logging.debug("Passive hunter is attempting to scan interfaces")
|
||||
logging.debug("Passive hunter is attempting to get external IP address")
|
||||
external_ip = requests.get("http://canhazip.com").text # getting external ip, to determine if cloud cluster
|
||||
except requests.ConnectionError as e:
|
||||
logging.debug("unable to determine local IP address: {0}".format(e))
|
||||
|
||||
@@ -55,7 +55,7 @@ class KubeletDiscovery(Hunter):
|
||||
self.publish_event(SecureKubeletEvent(secure=True, anonymous_auth=False))
|
||||
|
||||
def ping_kubelet(self):
|
||||
logging.debug("Attempting to ping kubelet")
|
||||
logging.debug("Attempting to get pod info from kubelet")
|
||||
try:
|
||||
return requests.get("https://{host}:{port}/pods".format(host=self.event.host, port=self.event.port), verify=False).status_code
|
||||
except Exception as ex:
|
||||
|
||||
@@ -20,7 +20,7 @@ class PortDiscovery(Hunter):
|
||||
self.port = event.port
|
||||
|
||||
def execute(self):
|
||||
logging.debug("host {0} try reach ports: {1}".format(self.host, default_ports))
|
||||
logging.debug("host {0} try ports: {1}".format(self.host, default_ports))
|
||||
for single_port in default_ports:
|
||||
if self.test_connection(self.host, single_port):
|
||||
logging.debug("Reachable port found: {0}".format(single_port))
|
||||
|
||||
Reference in New Issue
Block a user