Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # By: Leon Teale
- #
- ## Setting Coloured variables
- red=`echo -e "\033[31m"`
- lcyan=`echo -e "\033[36m"`
- yellow=`echo -e "\033[33m"`
- green=`echo -e "\033[32m"`
- blue=`echo -e "\033[34m"`
- purple=`echo -e "\033[35m"`
- normal=`echo -e "\033[m"`
- ## Check for correct usage
- if (( $# != 1 ))
- then
- echo "Usage: ./skanner.sh listofips.txt"
- echo "Usage: ./skanner.sh ip"
- exit 1
- fi
- clear
- ## Set Variables
- workingdir="skanner_results"
- log="$workingdir/skanner.log"
- #Check working directory
- working_dir () {
- if [ ! -d $workingdir ];
- then
- echo "Working Directory : $red Not Found$normal"
- echo "$yellow..Creating Working Directory$normal"
- mkdir -p $workingdir
- echo "Working Directory : $green Found$normal"
- else
- echo "Working Directory : $green Found$normal"
- fi
- ##Recheck Working Directory
- if [ ! -d $workingdir ];
- then
- echo "$red Unable to create Working Directory: $yellow`pwd`/$workingdir$normal"
- exit 1
- fi
- }
- ##Check if Nmap is installed
- check_nmap () {
- if which nmap | grep nmap > /dev/null
- then
- echo "Nmap : $green Found$normal"
- else
- echo "Nmap : $red Not Found$normal"
- echo "nmap" > $log
- fi
- }
- #Check Hydra is installed
- check_hydra () {
- if which hydra | grep hydra > /dev/null
- then
- echo "Hydra : $green Found$normal"
- else
- echo "Hydra : $red Not Found$normal"
- echo "Hydra" > $log
- fi
- }
- #Check Pre-requisites
- echo "$yellow Checking pre-requisites..$normal"
- working_dir
- check_nmap
- check_hydra
- #Start Skanner
- echo ""
- echo "+---------------------------------------+"
- echo "|$yellow Running Skanner...$normal |"
- echo "|---------------------------------------+"
- for ip in `cat $1`; do
- #Vulns
- status () {
- if
- nmap -n -sn -vv $ip |grep "Host is up" > /dev/null 2>/dev/null
- then
- echo ""
- else
- continue
- fi
- }
- ms08_067 () {
- if
- nmap --script smb-check-vulns.nse -p U:137,T:139 $ip --script-args=unsafe=1 | grep "MS08-067: VULNERABLE" > /dev/null 2>/dev/null
- then
- echo "$red MS08-067$normal"
- fi
- }
- anonftp () {
- if
- nmap -sC -p21 $ip | grep "Anonymous FTP login allowed" > /dev/null 2>/dev/null
- then
- echo "$red Anon FTP$normal"
- fi
- }
- weakvnc () {
- if
- hydra -p password $ip vnc -t 4 | grep "1 valid password found" > /dev/null 2>/dev/null
- then
- vnc="$red VNC Pass = password$normal"
- fi
- }
- #Output
- status
- echo "$yellow Checking:$normal $ip"
- ms08_067
- anonftp
- weakvnc
- done
Advertisement
Add Comment
Please, Sign In to add comment