Skip to content

Instantly share code, notes, and snippets.

@ncouture
Last active May 21, 2025 19:43
Show Gist options
  • Save ncouture/31252c347d6dd9aed00b80a76f68fa95 to your computer and use it in GitHub Desktop.
Save ncouture/31252c347d6dd9aed00b80a76f68fa95 to your computer and use it in GitHub Desktop.
Discover publicly exposed Chromecast devices on the Internet... ¯\_(ツ)_/¯
#!/bin/bash #
if [[ $# -ne 2 ]]; then
echo "Usage: "
echo -e "\t$(basename $0) <num-results> <filename>"
exit 1
fi # num-results is results from ZMAP--not--of chromecasts found from ZMAP results.
export results="$1"
export filename="$2"
function scan {
zmap -p 8008 --max-results "$results" -o - 2> /dev/null
}
function get_chromecast_scan_result {
curl -s --max-time 5 -o /dev/null -w "%{http_code} %{remote_ip}\n" http://$1:8008
}
export SHELL=$(type -p bash)
export -f get_chromecast_scan_result
export -f scan
parallel --jobs 50 get_chromecast_scan_result :::: <(scan) | awk '/404/{ print $2 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment