Skip to content

Commit d93b97d

Browse files
committed
Add rancher installation docs
1 parent 244c901 commit d93b97d

File tree

2 files changed

+39
-4
lines changed

2 files changed

+39
-4
lines changed

documentation/modules/auxiliary/gather/rancher_authenticated_api_cred_exposure.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,42 @@ version of those sensitive data.
1010

1111
### Install
1212

13-
https://github.com/fe-ax/tf-cve-2021-36782
13+
* Clone the repository from: https://github.com/fe-ax/tf-cve-2021-36782
14+
* Create a Digital Ocean API Token
15+
* Log into Digital Ocean and navigate to: API > Tokens
16+
* Select "Generate New Token"
17+
* Enter a token name and then select either Full Access or Custom Scopes
18+
* If selecting Custom Scopes, use the values provided below
19+
* Back in the `tf-cve-2021-36782`, copy the `example.tfvars` file to `yourown.tfvars`
20+
* Edit `yourown.tfvars` and add the newly generated DO API token as `do_token`
21+
* Optionally set the region for the clusters to one closer to you (e.g. `nyc3`)
22+
* Run `terraform init`
23+
* Run `terraform apply -var-file yourown.tfvars`, this can take about 20 minutes to run
24+
* Take the hostname from the `rancher_admin_url` output from terraform and use that as the `RHOST` value for the module
25+
* Take the password from the `rancher_password` file and use that with the username "admin" for the module
26+
27+
#### Digital Ocean API Token Custom Scopes
28+
It's possible that there are unnecessary privileges contained within the following settings, however it does permit the
29+
test environment to start without a full access token.
30+
31+
* Fully Scoped Access:
32+
* 1click (2): create, read
33+
* account (1): read
34+
* actions (1): read
35+
* billing (1): read
36+
* kubernetes (5): create, read, update, delete, access_cluster
37+
* load_balancer (4): create, read, update, delete
38+
* monitoring (4): create, read, update, delete
39+
* project (4): create, read, update, delete
40+
* regions (1): read
41+
* registry (4): create, read, update, delete
42+
* sizes (1): read
43+
* Create Access:
44+
* app / droplet / firewall / ssh_key
45+
* Read Access:
46+
* app / block_storage / block_storage_action / block_storage_snapshot / cdn / certificate / database / domain / droplet / firewall / function / image / reserved_ip / snapshot / ssh_key / tag / uptime / vpc
47+
* Update Access:
48+
* ssh_key
1449

1550
## Verification Steps
1651

@@ -80,4 +115,4 @@ msf6 auxiliary(gather/rancher_authenticated_api_cred_exposure) > run
80115
[*] Auxiliary module execution completed
81116
```
82117

83-
The [Cluster.Status.ServiceAccountToken](https://jwt.io/#debugger-io?token=eyJhbGciOiJSUzI1NiIsImtpZCI6IndsUHhqR1pxX1dSbkFwVG92SFZ1RWV5WDNjbktDTmhZRVUtOFhWY2gyQ0kifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJjYXR0bGUtc3lzdGVtIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImtvbnRhaW5lci1lbmdpbmUtdG9rZW4taG52eG4iLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoia29udGFpbmVyLWVuZ2luZSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjgyOWZiN2FiLTA0NzItNDA1ZC1iOWI4LTRmNjhjYmZhNDAyMyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpjYXR0bGUtc3lzdGVtOmtvbnRhaW5lci1lbmdpbmUifQ.URiTKnslommru1NDTq-ClcSc9DBsQwr4_eqSCfksoIeGACwYKK3kPCxe0aVixOkWK9saFTcR46bEz7Of4BfMjUShBl89zSmaGHmlNvYd2sLssWMXbcQInC4Y7Ckti49VbBFoU5EWe-LBSiNrhZcNL6NTn00PgMlIT7OFiSugg8ar7k6Q1Suak0pW_ea1Z56bHGWD-WJM8GsYxohXX7HwYh8cyfOSd_jH6HTZ-p6qsZcWAHnREuzNwcdXqycDVxTA48XEZlfLOJDgvbyhNPssedf3os1rcWTQ5vh_NzUjyqpb8PzQOWm427XjMzBQxwSJVyu1a2TYlNXsLX9qCARjng) is actually a JWT token as seen in the link.
118+
The [Cluster.Status.ServiceAccountToken](https://jwt.io/#debugger-io?token=eyJhbGciOiJSUzI1NiIsImtpZCI6IndsUHhqR1pxX1dSbkFwVG92SFZ1RWV5WDNjbktDTmhZRVUtOFhWY2gyQ0kifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJjYXR0bGUtc3lzdGVtIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImtvbnRhaW5lci1lbmdpbmUtdG9rZW4taG52eG4iLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoia29udGFpbmVyLWVuZ2luZSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjgyOWZiN2FiLTA0NzItNDA1ZC1iOWI4LTRmNjhjYmZhNDAyMyIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpjYXR0bGUtc3lzdGVtOmtvbnRhaW5lci1lbmdpbmUifQ.URiTKnslommru1NDTq-ClcSc9DBsQwr4_eqSCfksoIeGACwYKK3kPCxe0aVixOkWK9saFTcR46bEz7Of4BfMjUShBl89zSmaGHmlNvYd2sLssWMXbcQInC4Y7Ckti49VbBFoU5EWe-LBSiNrhZcNL6NTn00PgMlIT7OFiSugg8ar7k6Q1Suak0pW_ea1Z56bHGWD-WJM8GsYxohXX7HwYh8cyfOSd_jH6HTZ-p6qsZcWAHnREuzNwcdXqycDVxTA48XEZlfLOJDgvbyhNPssedf3os1rcWTQ5vh_NzUjyqpb8PzQOWm427XjMzBQxwSJVyu1a2TYlNXsLX9qCARjng) is actually a JWT token as seen in the link.

modules/auxiliary/gather/rancher_authenticated_api_cred_exposure.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ def login
113113
end
114114

115115
def check
116-
return Exploit::CheckCode::Unknown("#{peer} - Could not connect to web service, or doesnt seem to be a rancher website") unless rancher?
116+
return Exploit::CheckCode::Unknown("#{peer} - Could not connect to web service, or does not seem to be a rancher website") unless rancher?
117117

118118
Exploit::CheckCode::Detected('Seems to be rancher, but unable to determine version')
119119
end
120120

121121
def run
122122
vprint_status('Attempting login')
123123
login
124-
vprint_good('login successful, querying APIs')
124+
vprint_good('Login successful, querying APIs')
125125
[
126126
'/v1/management.cattle.io.catalogs',
127127
'/v1/management.cattle.io.clusters',

0 commit comments

Comments
 (0)