Last active
December 13, 2015 20:48
-
-
Save jesusprubio/4972662 to your computer and use it in GitHub Desktop.
Bash script to scan IP ranges from a text file with sipvicious.
NOTES: http://nicerosniunos.blogspot.com.es/2012/02/scanning-world-with-sipvicious.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Bash script to scan IP ranges from a text file with sipvicious. | |
# | |
# Use: ./scanRange.sh | |
# | |
# Copyright (c) Jesús Pérez | |
# Licensed under GPLv3 - http://www.gnu.org/licenses/gpl-3.0.html | |
SVMAP="/home/baguira/Installed/sipvicious/svmap.py" | |
SVREPORT="/home/baguira/Installed/sipvicious/svreport.py" | |
# just in case "unknown" devices | |
sudo tcpdump udp and dst host 192.168.9.5 -s 65535 -w capture1.pcap & | |
# scan all ranges | |
for RANGE in $(cat ranges1.txt) | |
do | |
RNAME=$(echo $RANGE | awk -F / '{print $1}') | |
EXTIP=$(curl -s icanhazip.com) | |
$SVMAP -p5060-5065 -s $RNAME -x $EXTIP --randomize $RANGE | |
NEXTIP=$(curl -s icanhazip.com) | |
# external ip change check | |
if [ "$EXTIP" != "$NEXTIP" ] | |
then | |
# wait until router finish reboot | |
sleep 180 | |
$SVREPORT delete -s $RNAME | |
EXTIP=$(curl -s icanhazip.com) | |
$SVMAP -p5060-5065 -s $RNAME -x $EXTIP --randomize $RANGE | |
fi | |
$SVREPORT export -s $RNAME -f txt -o $RNAME.txt -n | |
done | |
sudo killall tcpdump > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment