Shodan save and format IPs list script

Started by Jinx, November 27, 2015, 11:15:35 AM

Previous topic - Next topic

Jinx

This script uses the Shodan API to get a list of IP addresses with their proper formatting.
It saves them in a text file which you later can run through Hydra or something.


First you need the Shodan CLI installed:

easy_install shodan

then to get an API KEY sign up to Shodan, then click here

https://account.shodan.io/

shodan init YOUR_API_KEY





I'm only new to Linux and SH scripting so this version probably a bit buggy
but I intend to make a version which automates the cracking process
(testing for default user/passes for the methods in the above list)
if I can wrap my head around it.


echo "Welcome 2 Shodan Niqqa app"
echo ""
echo "Display search ideas? Y/N"
read ideas
if [ $ideas = y ]
then
echo "Search Ideas:"
echo "|[search] 200 OK|"
echo "|last-modified|"
echo "|last-modified www-authenticate (no encryption|"
echo
echo "| Prismview Player | (Billboards) 'Their site suggests you use a Windows client to update the billboard itself, and the username/password is optional...' |"
echo
echo "| Loxone |('Smart' House) default username/pass admin admin "
echo
echo "| P372 | (USA Automatic Number Plate Recognition: ANPR) - telnet has no password"
echo
echo "| PIPS Technology ALPR Processors | (Alternative to above; not as good)"
echo
echo '| title:"xzeres wind" | (Wind Turbines; MyTurbine, m442+SRt)'
echo "| port:23 country:GB | (Dedicated Micros DVRs)"
echo '| "default 1234" (Banner heads with default creds for routers, ip cams; whatever)'
echo
echo '| title:"Monroe Electronics | root dasdec1 / Admin dasdec'
else
echo "Okay,"
fi
echo "What do you want to search for?"
read search
echo "Searching..." && shodan count $search && echo "Results found for $search"
echo "Would you like to download them to the current folder? (y) or (n)"
read download
if [ $download = y ]
then
echo "Okay downloading.." && set -- $search && mkdir $1 && cd $1 && shodan download $search $1 &&
shodan parse --fields ip_str,port --separator : "$1"".json.gz" | sed s'/.$//' >> $1.txt && nano $1.txt
else
echo "Ok not downloading"
fi