Skip to content

Instantly share code, notes, and snippets.

@willseward
Last active May 28, 2019 21:59
Show Gist options
  • Save willseward/42129b2f447083e6fed5ee31f3636098 to your computer and use it in GitHub Desktop.
Save willseward/42129b2f447083e6fed5ee31f3636098 to your computer and use it in GitHub Desktop.
Find Docker containers with a NULL root password
#!/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