Hello guys,
I have been looking at a few ways to practice some scripting and i came across a thread on the forums about WPA pentesting and using a list of phone numbers as WPA keys.
That got the gears turning and i saw it as an excellent opportunity to create my first linux script ever.
In a nut shell - this script will create a list of phone numbers based on the inputs that you give.
Code:
Usage: pnlg.sh [ exchange code ] ...
Eample: pnlg.sh 743 744 745
The script will ask you for the area code for which the number is located and then it will go ahead and create a list for each exchange that you passed the script in the beginning. The formats will be as follows..
xxxxxxx - exchange + subscriber number
xxxxxxxxxx - areacode + exchange + subscriber number
xxxxxxxxxxx - 1 + areacode + exchange + subscriber number
The script will place all of these numbers in a line-by-line file that you specify when the script runs. The output will look similar to this.
Code:
[tgamble@Supremous bin]$ pnlg.sh 743 744 745
-- Please enter the Area Code: --
425
-- Setting Area Code to 425 --
==================================
Areacode: 425
NXX1: 743
NXX2: 744
NXX3: 745
NXX4:
NXX5:
NXX6:
NXX7:
NXX8:
NXX9:
==================================
-- Please choose a name for your worldlist file. It will be saved in ~ --
wordlist.lst
-- words will be saved in file /home/tgamble/wordlist.lst --
-- Now Processing group 743 --
-- Processing 7 DIGIT numbers --
-- Done --
-- Processing 10 DIGIT numbers --
-- Done --
-- Processing 11 DIGIT numbers --
-- Done --
-- Now Processing group 744 --
-- Processing 7 DIGIT numbers --
-- Done --
-- Processing 10 DIGIT numbers --
-- Done --
-- Processing 11 DIGIT numbers --
-- Done --
-- Now Processing group 745 --
-- Processing 7 DIGIT numbers --
-- Done --
-- Processing 10 DIGIT numbers --
-- Done --
-- Processing 11 DIGIT numbers --
-- Done --
[tgamble@Supremous bin]$
The script will generate all 9999 possible subscriber numbers for each of the exchange codes that you enter in.
I though something like this could be useful for people who need to quickly create a small word-list of phone numbers for the area that they are pentesting in.
Please use this and let me know what you think!
Here's the source
Code:
#!/bin/bash
# This script will generate a list of phone numbers based on the inputs you give the program.
#
# Written By: Glasskannon
# Version 1.0
#
#
if [ -z "$1" ]; then
echo "*Phone Number List Generator*"
echo "*****************************"
echo "This script will attempt to "
echo "create a list of phone numbers"
echo "based on inputs the script "
echo "recieves "
echo "*****************************"
echo "Usage: pnlg.sh [ nxx code ] ... "
exit
fi
clear
echo
echo "-- Please enter the Area Code: --"
read AREACODE
echo "-- Setting Area Code to $AREACODE --"
# Time to input the NXX numbers in to process.
echo "=================================="
echo "Areacode: $AREACODE"
echo "NXX1: $1"
echo "NXX2: $2"
echo "NXX3: $3"
echo "NXX4: $4"
echo "NXX5: $5"
echo "NXX6: $6"
echo "NXX7: $7"
echo "NXX8: $8"
echo "NXX9: $9"
echo "=================================="
echo "-- Please choose a name for your worldlist file. It will be saved in ~ --"
read FILENAME
echo
echo
echo "-- words will be saved in file $HOME/$FILENAME --"
echo
echo
SUBSCRIBER=0000
#======================START 7 DIGIT NUMBER LOOP===============================
function func_loop7 {
while [ $SUBSCRIBER -lt 10000 ]; do
echo $NXX`printf "%04d" $SUBSCRIBER` >> $HOME/$FILENAME
let SUBSCRIBER=SUBSCRIBER+1
done
}
#======================END 7 DIGIT NUMBER LOOP=================================
#======================START 10 DIGIT NUMBER LOOP==============================
function func_loop10 {
while [ $SUBSCRIBER -lt 10000 ]; do
echo $AREACODE$NXX`printf "%04d" $SUBSCRIBER` >> $HOME/$FILENAME
let SUBSCRIBER=SUBSCRIBER+1
done
}
#======================END 10 DIGIT NUMBER LOOP================================
#======================START 11 DIGIT NUMBER LOOP==============================
function func_loop11 {
while [ $SUBSCRIBER -lt 10000 ]; do
echo 1$AREACODE$NXX`printf "%04d" $SUBSCRIBER` >> $HOME/$FILENAME
let SUBSCRIBER=SUBSCRIBER+1
done
}
#======================END 11 DIGIT NUMBER LOOP================================
#======================MAIN PROGRAM============================================
function func_main {
if [ $NXX != "" ]
then
echo
echo
echo
echo "-- Now Processing group $NXX --"
echo "-- Processing 7 DIGIT numbers --"
func_loop7
SUBSCRIBER=0000
echo "-- Done --"
echo "-- Processing 10 DIGIT numbers --"
func_loop10
SUBSCRIBER=0000
echo "-- Done --"
echo "-- Processing 11 DIGIT numbers --"
func_loop11
SUBSCRIBER=0000
echo "-- Done --"
fi
}
#======================END MAIN PROGRAM=========================================
NXX=1
for NXX in $*; do
if [ $NXX == "" ]; then
echo "No Further exchange codes to process. Goodbye!"
exit
else
func_main
NXX=NXX+1
fi
done
Here is a link to the source file.
If anyone knows a better way of hosting this little file of mine please let me know! this is the first time i have given back 
http://www.mediafire.com/?sharekey=0...4e75f6e8ebb871
Thanks guys for looking at this =)