Last active
May 28, 2019 21:59
-
-
Save willseward/42129b2f447083e6fed5ee31f3636098 to your computer and use it in GitHub Desktop.
Find Docker containers with a NULL root password
This file contains 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
#!/bin/bash | |
# https://talosintelligence.com/vulnerability_reports/TALOS-2019-0782 | |
# Finds containers running with the root password set to NULL | |
# William Ward <willseward@sbcglobal.net> | |
cnrs=$(docker ps -q) | |
for id in $cnrs | |
do | |
pwl=$(docker exec -it $id cat /etc/shadow | grep root) | |
if [[ $pwl =~ 'root::' ]]; then | |
echo $(docker ps | grep $id) | |
fi | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment