-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.py
295 lines (290 loc) · 14.9 KB
/
utils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
paths = [
"/.well-known/openid-configuration",
"/api",
"/api/v1",
"/apis",
"/apis/",
"/apis/admissionregistration.k8s.io",
"/apis/admissionregistration.k8s.io/v1",
"/apis/admissionregistration.k8s.io/v1beta1",
"/apis/apiextensions.k8s.io",
"/apis/apiextensions.k8s.io/v1",
"/apis/apiextensions.k8s.io/v1beta1",
"/apis/apiregistration.k8s.io",
"/apis/apiregistration.k8s.io/v1",
"/apis/apiregistration.k8s.io/v1beta1",
"/apis/apps",
"/apis/apps.openshift.io",
"/apis/apps.openshift.io/v1",
"/apis/apps/v1",
"/apis/authentication.k8s.io",
"/apis/authentication.k8s.io/v1",
"/apis/authentication.k8s.io/v1beta1",
"/apis/authentication.maistra.io",
"/apis/authentication.maistra.io/v1",
"/apis/authorization.k8s.io",
"/apis/authorization.k8s.io/v1",
"/apis/authorization.k8s.io/v1beta1",
"/apis/authorization.openshift.io",
"/apis/authorization.openshift.io/v1",
"/apis/authorization.openshift.io/v1/rolebindingrestrictions",
"/apis/autoscaling",
"/apis/autoscaling.openshift.io",
"/apis/autoscaling.openshift.io/v1",
"/apis/autoscaling.openshift.io/v1beta1",
"/apis/autoscaling/v1",
"/apis/autoscaling/v2beta1",
"/apis/autoscaling/v2beta2",
"/apis/batch",
"/apis/batch/v1",
"/apis/batch/v1beta1",
"/apis/build.openshift.io",
"/apis/build.openshift.io/v1",
"/apis/certificates.k8s.io",
"/apis/certificates.k8s.io/v1",
"/apis/certificates.k8s.io/v1beta1",
"/apis/cloudcredential.openshift.io",
"/apis/cloudcredential.openshift.io/v1",
"/apis/config.istio.io",
"/apis/config.istio.io/v1alpha2",
"/apis/config.openshift.io",
"/apis/config.openshift.io/v1",
"/apis/console.openshift.io",
"/apis/console.openshift.io/v1",
"/apis/console.openshift.io/v1alpha1",
"/apis/controlplane.operator.openshift.io",
"/apis/controlplane.operator.openshift.io/v1alpha1",
"/apis/coordination.k8s.io",
"/apis/coordination.k8s.io/v1",
"/apis/coordination.k8s.io/v1beta1",
"/apis/discovery.k8s.io",
"/apis/discovery.k8s.io/v1beta1",
"/apis/events.k8s.io",
"/apis/events.k8s.io/v1",
"/apis/events.k8s.io/v1beta1",
"/apis/extensions",
"/apis/extensions/v1beta1",
"/apis/flowcontrol.apiserver.k8s.io",
"/apis/flowcontrol.apiserver.k8s.io/v1alpha1",
"/apis/flowcontrol.apiserver.k8s.io/v1beta1",
"/apis/helm.openshift.io",
"/apis/helm.openshift.io/v1beta1",
"/apis/image.openshift.io",
"/apis/image.openshift.io/v1",
"/apis/imageregistry.operator.openshift.io",
"/apis/imageregistry.operator.openshift.io/v1",
"/apis/ingress.operator.openshift.io",
"/apis/ingress.operator.openshift.io/v1",
"/apis/jaegertracing.io",
"/apis/jaegertracing.io/v1",
"/apis/k8s.cni.cncf.io",
"/apis/k8s.cni.cncf.io/v1",
"/apis/kiali.io",
"/apis/kiali.io/v1alpha1",
"/apis/logging.openshift.io",
"/apis/logging.openshift.io/v1",
"/apis/machine.openshift.io",
"/apis/machine.openshift.io/v1beta1",
"/apis/machineconfiguration.openshift.io",
"/apis/machineconfiguration.openshift.io/v1",
"/apis/maistra.io",
"/apis/maistra.io/v1",
"/apis/maistra.io/v1alpha1",
"/apis/maistra.io/v2",
"/apis/metal3.io",
"/apis/metal3.io/v1alpha1",
"/apis/metrics.k8s.io",
"/apis/metrics.k8s.io/v1beta1",
"/apis/migration.k8s.io",
"/apis/migration.k8s.io/v1alpha1",
"/apis/monitoring.coreos.com",
"/apis/monitoring.coreos.com/v1",
"/apis/monitoring.coreos.com/v1alpha1",
"/apis/monitoring.kiali.io",
"/apis/monitoring.kiali.io/v1alpha1",
"/apis/network.openshift.io",
"/apis/network.openshift.io/v1",
"/apis/network.operator.openshift.io",
"/apis/network.operator.openshift.io/v1",
"/apis/networking.istio.io",
"/apis/networking.istio.io/v1alpha3",
"/apis/networking.istio.io/v1beta1",
"/apis/networking.k8s.io",
"/apis/networking.k8s.io/v1",
"/apis/networking.k8s.io/v1beta1",
"/apis/node.k8s.io",
"/apis/node.k8s.io/v1",
"/apis/node.k8s.io/v1beta1",
"/apis/oauth.openshift.io",
"/apis/oauth.openshift.io/v1",
"/apis/operator.openshift.io",
"/apis/operator.openshift.io/v1",
"/apis/operator.openshift.io/v1alpha1",
"/apis/operators.coreos.com",
"/apis/operators.coreos.com/v1",
"/apis/operators.coreos.com/v1alpha1",
"/apis/operators.coreos.com/v1alpha2",
"/apis/packages.operators.coreos.com",
"/apis/packages.operators.coreos.com/v1",
"/apis/policy",
"/apis/policy/v1beta1",
"/apis/project.openshift.io",
"/apis/project.openshift.io/v1",
"/apis/quota.openshift.io",
"/apis/quota.openshift.io/v1",
"/apis/quota.openshift.io/v1/clusterresourcequotas",
"/apis/rbac.authorization.k8s.io",
"/apis/rbac.authorization.k8s.io/v1",
"/apis/rbac.authorization.k8s.io/v1beta1",
"/apis/rbac.istio.io",
"/apis/rbac.istio.io/v1alpha1",
"/apis/rbac.maistra.io",
"/apis/rbac.maistra.io/v1",
"/apis/route.openshift.io",
"/apis/route.openshift.io/v1",
"/apis/samples.operator.openshift.io",
"/apis/samples.operator.openshift.io/v1",
"/apis/scheduling.k8s.io",
"/apis/scheduling.k8s.io/v1",
"/apis/scheduling.k8s.io/v1beta1",
"/apis/security.internal.openshift.io",
"/apis/security.internal.openshift.io/v1",
"/apis/security.istio.io",
"/apis/security.istio.io/v1beta1",
"/apis/security.openshift.io",
"/apis/security.openshift.io/v1",
"/apis/security.openshift.io/v1/securitycontextconstraints",
"/apis/snapshot.storage.k8s.io",
"/apis/snapshot.storage.k8s.io/v1",
"/apis/snapshot.storage.k8s.io/v1beta1",
"/apis/storage.k8s.io",
"/apis/storage.k8s.io/v1",
"/apis/storage.k8s.io/v1beta1",
"/apis/template.openshift.io",
"/apis/template.openshift.io/v1",
"/apis/tuned.openshift.io",
"/apis/tuned.openshift.io/v1",
"/apis/user.openshift.io",
"/apis/user.openshift.io/v1",
"/apis/whereabouts.cni.cncf.io",
"/apis/whereabouts.cni.cncf.io/v1alpha1",
"/healthz",
"/healthz/autoregister-completion",
"/healthz/etcd",
"/healthz/log",
"/healthz/ping",
"/healthz/poststarthook/aggregator-reload-proxy-client-cert",
"/healthz/poststarthook/apiservice-openapi-controller",
"/healthz/poststarthook/apiservice-registration-controller",
"/healthz/poststarthook/apiservice-status-available-controller",
"/healthz/poststarthook/apiservice-wait-for-first-sync",
"/healthz/poststarthook/bootstrap-controller",
"/healthz/poststarthook/crd-informer-synced",
"/healthz/poststarthook/generic-apiserver-start-informers",
"/healthz/poststarthook/kube-apiserver-autoregistration",
"/healthz/poststarthook/openshift.io-StartOAuthInformers",
"/healthz/poststarthook/openshift.io-TokenTimeoutUpdater",
"/healthz/poststarthook/openshift.io-oauth-apiserver-reachable",
"/healthz/poststarthook/openshift.io-openshift-apiserver-reachable",
"/healthz/poststarthook/openshift.io-startkubeinformers",
"/healthz/poststarthook/priority-and-fairness-config-consumer",
"/healthz/poststarthook/priority-and-fairness-config-producer",
"/healthz/poststarthook/priority-and-fairness-filter",
"/healthz/poststarthook/quota.openshift.io-clusterquotamapping",
"/healthz/poststarthook/rbac/bootstrap-roles",
"/healthz/poststarthook/scheduling/bootstrap-system-priority-classes",
"/healthz/poststarthook/start-apiextensions-controllers",
"/healthz/poststarthook/start-apiextensions-informers",
"/healthz/poststarthook/start-cluster-authentication-info-controller",
"/healthz/poststarthook/start-kube-aggregator-informers",
"/healthz/poststarthook/start-kube-apiserver-admission-initializer",
"/livez",
"/livez/autoregister-completion",
"/livez/etcd",
"/livez/log",
"/livez/ping",
"/livez/poststarthook/aggregator-reload-proxy-client-cert",
"/livez/poststarthook/apiservice-openapi-controller",
"/livez/poststarthook/apiservice-registration-controller",
"/livez/poststarthook/apiservice-status-available-controller",
"/livez/poststarthook/apiservice-wait-for-first-sync",
"/livez/poststarthook/bootstrap-controller",
"/livez/poststarthook/crd-informer-synced",
"/livez/poststarthook/generic-apiserver-start-informers",
"/livez/poststarthook/kube-apiserver-autoregistration",
"/livez/poststarthook/openshift.io-StartOAuthInformers",
"/livez/poststarthook/openshift.io-TokenTimeoutUpdater",
"/livez/poststarthook/openshift.io-oauth-apiserver-reachable",
"/livez/poststarthook/openshift.io-openshift-apiserver-reachable",
"/livez/poststarthook/openshift.io-startkubeinformers",
"/livez/poststarthook/priority-and-fairness-config-consumer",
"/livez/poststarthook/priority-and-fairness-config-producer",
"/livez/poststarthook/priority-and-fairness-filter",
"/livez/poststarthook/quota.openshift.io-clusterquotamapping",
"/livez/poststarthook/rbac/bootstrap-roles",
"/livez/poststarthook/scheduling/bootstrap-system-priority-classes",
"/livez/poststarthook/start-apiextensions-controllers",
"/livez/poststarthook/start-apiextensions-informers",
"/livez/poststarthook/start-cluster-authentication-info-controller",
"/livez/poststarthook/start-kube-aggregator-informers",
"/livez/poststarthook/start-kube-apiserver-admission-initializer",
"/metrics",
"/openapi/v2",
"/openid/v1/jwks",
"/readyz",
"/readyz/api-openshift-apiserver-available",
"/readyz/api-openshift-oauth-apiserver-available",
"/readyz/autoregister-completion",
"/readyz/etcd",
"/readyz/informer-sync",
"/readyz/log",
"/readyz/ping",
"/readyz/poststarthook/aggregator-reload-proxy-client-cert",
"/readyz/poststarthook/apiservice-openapi-controller",
"/readyz/poststarthook/apiservice-registration-controller",
"/readyz/poststarthook/apiservice-status-available-controller",
"/readyz/poststarthook/apiservice-wait-for-first-sync",
"/readyz/poststarthook/bootstrap-controller",
"/readyz/poststarthook/crd-informer-synced",
"/readyz/poststarthook/generic-apiserver-start-informers",
"/readyz/poststarthook/kube-apiserver-autoregistration",
"/readyz/poststarthook/openshift.io-StartOAuthInformers",
"/readyz/poststarthook/openshift.io-TokenTimeoutUpdater",
"/readyz/poststarthook/openshift.io-oauth-apiserver-reachable",
"/readyz/poststarthook/openshift.io-openshift-apiserver-reachable",
"/readyz/poststarthook/openshift.io-startkubeinformers",
"/readyz/poststarthook/priority-and-fairness-config-consumer",
"/readyz/poststarthook/priority-and-fairness-config-producer",
"/readyz/poststarthook/priority-and-fairness-filter",
"/readyz/poststarthook/quota.openshift.io-clusterquotamapping",
"/readyz/poststarthook/rbac/bootstrap-roles",
"/readyz/poststarthook/scheduling/bootstrap-system-priority-classes",
"/readyz/poststarthook/start-apiextensions-controllers",
"/readyz/poststarthook/start-apiextensions-informers",
"/readyz/poststarthook/start-cluster-authentication-info-controller",
"/readyz/poststarthook/start-kube-aggregator-informers",
"/readyz/poststarthook/start-kube-apiserver-admission-initializer",
"/readyz/shutdown",
"/version"
]
usage = """"./runtool.py [-h] [--token [TOKEN]] -targets [TARGETS] [--paths [PATHS]] [--resolve [BOOL]]"""
__author__ = "@rive_n or https://t.me/r1v3ns_life"
logo = r"""
▄████▄ ██▓ ▒█████ █ ██ ▓█████▄ ██▓ ███▄ █ ▄▄▄█████▓▓█████ ██▓ ██▓ ██▓ ▄████ ▓█████ ███▄ █ ▄████▄ ▓█████
▒██▀ ▀█ ▓██▒ ▒██▒ ██▒ ██ ▓██▒▒██▀ ██▌▓██▒ ██ ▀█ █ ▓ ██▒ ▓▒▓█ ▀ ▓██▒ ▓██▒ ▓██▒ ██▒ ▀█▒▓█ ▀ ██ ▀█ █ ▒██▀ ▀█ ▓█ ▀
▒▓█ ▄ ▒██░ ▒██░ ██▒▓██ ▒██░░██ █▌▒██▒▓██ ▀█ ██▒▒ ▓██░ ▒░▒███ ▒██░ ▒██░ ▒██▒▒██░▄▄▄░▒███ ▓██ ▀█ ██▒▒▓█ ▄ ▒███
▒▓▓▄ ▄██▒▒██░ ▒██ ██░▓▓█ ░██░░▓█▄ ▌░██░▓██▒ ▐▌██▒░ ▓██▓ ░ ▒▓█ ▄ ▒██░ ▒██░ ░██░░▓█ ██▓▒▓█ ▄ ▓██▒ ▐▌██▒▒▓▓▄ ▄██▒▒▓█ ▄
▒ ▓███▀ ░░██████▒░ ████▓▒░▒▒█████▓ ░▒████▓ ░██░▒██░ ▓██░ ▒██▒ ░ ░▒████▒░██████▒░██████▒░██░░▒▓███▀▒░▒████▒▒██░ ▓██░▒ ▓███▀ ░░▒████▒
░ ░▒ ▒ ░░ ▒░▓ ░░ ▒░▒░▒░ ░▒▓▒ ▒ ▒ ▒▒▓ ▒ ░▓ ░ ▒░ ▒ ▒ ▒ ░░ ░░ ▒░ ░░ ▒░▓ ░░ ▒░▓ ░░▓ ░▒ ▒ ░░ ▒░ ░░ ▒░ ▒ ▒ ░ ░▒ ▒ ░░░ ▒░ ░
░ ▒ ░ ░ ▒ ░ ░ ▒ ▒░ ░░▒░ ░ ░ ░ ▒ ▒ ▒ ░░ ░░ ░ ▒░ ░ ░ ░ ░░ ░ ▒ ░░ ░ ▒ ░ ▒ ░ ░ ░ ░ ░ ░░ ░░ ░ ▒░ ░ ▒ ░ ░ ░
░ ░ ░ ░ ░ ░ ▒ ░░░ ░ ░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▒ ░░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░ ░
""" + "Author: " + __author__
description = """Kubernetes, also known as K8s, is an open-source system for automating deployment,
scaling, and management of containerized applications. It groups containers that make up an application into logical
units for easy management and discovery. That's really big infrastructure so this tool is created for
security checks. This tool is scanning: most vulnerable and open ports, walking through the RHOCP API.
You don't need to care about methods like: ["shutdown", "drop", "stop", "delete"]. They are not CHECKED for
some reasons. This tool also draws tables with results so you can nicely watch what is done with k8s infro.\n
"""