Last active
June 20, 2019 02:41
-
-
Save pasknel/bd4cad406b19cc65506c3f028c93887e to your computer and use it in GitHub Desktop.
Search for docker.sock in all containers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import docker | |
client = docker.from_env() | |
for container in client.containers.list(): | |
try: | |
container_id = container.short_id | |
container_name = container.name | |
bits, stat = container.get_archive('/var/run/docker.sock') | |
print "[+] Docker.sock found in container: {0} ({1})".format(container_id, container_name) | |
except: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment