├── README.md └── big_brother_shodan.sh /README.md: -------------------------------------------------------------------------------- 1 | # big-brother-shodan 2 | Discover cameras running the RTSP protocol with live image and audio from all over the world 3 | 4 | How to run? 5 | ``` 6 | ./big_brother_shodan.sh 7 | ``` 8 | or search by country code with 2 letters such as US, RU, BR, MX, etc. 9 | ``` 10 | ./big_brother_shodan.sh us 11 | ``` 12 | 13 | Must have: 14 | * Shodan account with working [CLI](https://help.shodan.io/command-line-interface/0-installation) and API key 15 | * curl 16 | * gzip 17 | * ffmpeg 18 | * [VLC](https://www.videolan.org/) 19 | 20 | Once it's done you'll have a .m3u list to open with VLC and several screenshots saved in the snapshots folder. 21 | 22 | ![image](https://user-images.githubusercontent.com/12034548/153490600-27295196-df4c-49e5-befd-3e8844f7c922.png) 23 | ![image](https://user-images.githubusercontent.com/12034548/153491050-27f5acbf-1d20-4874-ade4-30c7e55fe57e.png) 24 | ![image](https://user-images.githubusercontent.com/12034548/153492591-d4ac81f6-aee5-4b21-942d-5676ff55f53a.png) 25 | -------------------------------------------------------------------------------- /big_brother_shodan.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | RANDOM_BANNER=$(shuf -i1-3 -n1) 4 | 5 | if [[ $RANDOM_BANNER -eq 1 ]]; then 6 | 7 | cat << "EOF" 8 | . .. . . . . . 9 | . . . . . 10 | . ..xxxxxxxxxx.... . . . 11 | . MWMWMWWMWMWMWMWMWMWMWMWMW . 12 | IIIIMWMWMWMWMWMWMWMWMWMWMWMWMWMttii: . . 13 | . IIYVVXMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWxx... . . 14 | IWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMx.. 15 | IIWMWMWMWMWMWMWMWMWBY%ZACH%AND%OWENMWMWMWMWMWMWMWMWMWMWMWMWMx.. . 16 | ""MWMWMWMWMWM"""""""". .:.. ."""""MWMWMWMWMWMWMWMWMWMWMWMWMWti. 17 | . "" . ` .: . :. : . . :. . . . . """"MWMWMWMWMWMWMWMWMWMWMWMWMti= 18 | . . :` . : . .'.' '....xxxxx...,'. ' ' ."""YWMWMWMWMWMWMWMWMWMW+ 19 | ; . ` . . : . .' : . ..XXXXXXXXXXXXXXXXXXXXx. ` . "YWMWMWMWMWMWMW 20 | . . . . . . . ..XXXXXXXXWWWWWWWWWWWWWWWWXXXX. . . """"""" 21 | ' : : . : . ...XXXXXWWW" W88N88@888888WWWWWXX. . . . . 22 | . ' . . : ...XXXXXXWWW" M88N88GGGGGG888^8M "WMBX. . .. : 23 | : ..XXXXXXXXWWW" M88888WWRWWWMW8oo88M WWMX. . : . 24 | "XXXXXXXXXXXXWW" WN8888WWWWW W8@@@8M BMBRX. . : : 25 | . XXXXXXXX=MMWW": . W8N888WWWWWWWW88888W XRBRXX. . . 26 | .... ""XXXXXMM::::. . W8@889WWWWWM8@8N8W . . :RRXx. . 27 | ``...''' MMM::.:. . W888N89999888@8W . . ::::"RXV . : 28 | . ..''''' MMMm::. . WW888N88888WW . . mmMMMMMRXx 29 | ..' . ""MMmm . . WWWWWWW . :. :,miMM""" : ""` . 30 | . . ""MMMMmm . . . . ._,mMMMM""" : ' . : 31 | . ""MMMMMMMMMMMMM""" . : . ' . . 32 | . . . . . . 33 | . . . . 34 | 35 | ------------------------------------------------ 36 | EOF 37 | fi 38 | 39 | #This ASCII pic can be found at 40 | #https://asciiart.website/index.php?art=people/body%20parts/eyes 41 | 42 | if [[ $RANDOM_BANNER -eq 2 ]]; then 43 | cat << "EOF" 44 | d8888b. d888888b d888b 45 | 88 `8D `88' 88' Y8b 46 | 88oooY' 88 88 47 | 88~~~b. 88 88 ooo 48 | 88 8D .88. 88. ~8~ 49 | Y8888P' Y888888P Y888P 50 | 51 | 52 | d8888b. d8888b. .d88b. d888888b db db d88888b d8888b. 53 | 88 `8D 88 `8D .8P Y8. `~~88~~' 88 88 88' 88 `8D 54 | 88oooY' 88oobY' 88 88 88 88ooo88 88ooooo 88oobY' 55 | 88~~~b. 88`8b 88 88 88 88~~~88 88~~~~~ 88`8b 56 | 88 8D 88 `88. `8b d8' 88 88 88 88. 88 `88. 57 | Y8888P' 88 YD `Y88P' YP YP YP Y88888P 88 YD 58 | 59 | 60 | .d8888. db db .d88b. d8888b. .d8b. d8b db 61 | 88' YP 88 88 .8P Y8. 88 `8D d8' `8b 888o 88 62 | `8bo. 88ooo88 88 88 88 88 88ooo88 88V8o 88 63 | `Y8b. 88~~~88 88 88 88 88 88~~~88 88 V8o88 64 | db 8D 88 88 `8b d8' 88 .8D 88 88 88 V888 65 | `8888Y' YP YP `Y88P' Y8888D' YP YP VP V8P 66 | ------------------------------------------------ 67 | EOF 68 | fi 69 | 70 | if [[ $RANDOM_BANNER -eq 3 ]]; then 71 | cat << "EOF" 72 | ____ 73 | /\ _`\ __ 74 | \ \ \L\ \ /\_\ __ 75 | \ \ _ <'\/\ \ /'_ `\ 76 | \ \ \L\ \\ \ \ /\ \L\ \ 77 | \ \____/ \ \_\\ \____ \ 78 | \/___/ \/_/ \/___L\ \ 79 | /\____/ 80 | \_/__/ 81 | ____ __ __ 82 | /\ _`\ /\ \__ /\ \ 83 | \ \ \L\ \ _ __ ___ \ \ ,_\\ \ \___ __ _ __ 84 | \ \ _ <' /\`'__\/ __`\\ \ \/ \ \ _ `\ /'__`\/\`'__\ 85 | \ \ \L\ \\ \ \//\ \L\ \\ \ \_ \ \ \ \ \ /\ __/\ \ \/ 86 | \ \____/ \ \_\\ \____/ \ \__\ \ \_\ \_\\ \____\\ \_\ 87 | \/___/ \/_/ \/___/ \/__/ \/_/\/_/ \/____/ \/_/ 88 | 89 | 90 | ____ __ __ 91 | /\ _`\ /\ \ /\ \ 92 | \ \,\L\_\\ \ \___ ___ \_\ \ __ ___ 93 | \/_\__ \ \ \ _ `\ / __`\ /'_` \ /'__`\ /' _ `\ 94 | /\ \L\ \\ \ \ \ \ /\ \L\ \/\ \L\ \ /\ \L\.\_ /\ \/\ \ 95 | \ `\____\\ \_\ \_\\ \____/\ \___,_\\ \__/.\_\\ \_\ \_\ 96 | \/_____/ \/_/\/_/ \/___/ \/__,_ / \/__/\/_/ \/_/\/_/ 97 | ------------------------------------------------ 98 | EOF 99 | fi 100 | 101 | rm view_list.m3u ip_list.txt &> /dev/null 102 | mkdir snapshots &> /dev/null 103 | 104 | if [[ $1 != "" ]]; then 105 | shodan download --limit 100 webcams.json.gz "hipcam port:554 screenshot.label:webcam -screenshot.label:login country:$1" 106 | else 107 | shodan download --limit 100 webcams.json.gz "hipcam port:554 screenshot.label:webcam -screenshot.label:login" 108 | fi 109 | 110 | gzip -dfk webcams.json.gz 111 | shodan parse --fields ip_str,port,location.city,location.country_name webcams.json --separator "|" --filters port:554 > ip_list.txt 112 | 113 | echo -e "IP:\t\tWorking\tSpeed" 114 | 115 | cat ip_list.txt | while read LINE 116 | do 117 | IP=$(echo $LINE | cut -d'|' -f1) 118 | CITY=$(echo $LINE | cut -d'|' -f3) 119 | COUNTRY=$(echo $LINE | cut -d'|' -f4) 120 | 121 | HTTP_CODE=$(curl --connect-timeout 3 --max-time 3 --silent -L -o /dev/null -w "%{http_code}" "rtsp://$IP:554/11") 122 | if [[ $HTTP_CODE -eq 200 ]]; then 123 | HTTP_TIME=$(curl --connect-timeout 3 --max-time 3 --silent -L -o /dev/null -w "%{time_starttransfer}" "rtsp://$IP:554/11" | cut -c1-3) 124 | echo -e "$IP\t OK\t $HTTP_TIME" 125 | (timeout 4 ffmpeg -hide_banner -loglevel error -nostats -rtsp_transport tcp -i rtsp://$IP:554/11 -timeout 3 -y -f image2 -vframes 1 -pix_fmt yuvj420p snapshots/$IP.jpeg &> /dev/null) & 126 | echo "#EXTINF:-0, $IP - $CITY - $COUNTRY - $HTTP_TIME" >> view_list.m3u 127 | echo "rtsp://$IP:554/11" >> view_list.m3u 128 | else 129 | echo -e "$IP\t FAIL" 130 | fi 131 | done 132 | 133 | LOADED=$(cat ip_list.txt | grep -oE "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | sort | uniq | wc -l | awk '{print $1}') 134 | ACTIVE=$(cat view_list.m3u | grep -oE "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}" | sort | uniq | wc -l | awk '{print $1}') 135 | 136 | echo "" 137 | echo "Loaded Webcams: $LOADED" 138 | echo "Active Webcams: $ACTIVE" 139 | 140 | #vlc --playlist-autostart view_list.m3u & 141 | --------------------------------------------------------------------------------