Results 1 to 6 of 6

Thread: Phone Number List Generator

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Posts
    28

    Post Phone Number List Generator

    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 =)

  2. #2
    Moderator KMDave's Avatar
    Join Date
    Jan 2010
    Posts
    2,281

    Default

    Just a suggestion, how about expanding it to be able to create phonenumbers for all the countries worldwide? They have different formats and also keep in mind, that they could use different characters for seperation like (- / <space>) or none at all.
    Tiocfaidh ár lá

  3. #3
    Junior Member
    Join Date
    Sep 2007
    Posts
    28

    Default

    Thanks! Great Ideas il work on them and see if i can come up with something =)

  4. #4
    My life is this forum thorin's Avatar
    Join Date
    Jan 2010
    Posts
    2,629

    Default

    If you're serious about keeping on with this I'd also suggest the following:

    1) Allow people to add prefix + wait time character. i.e.: If I wanna dial my cheap long distance carrier's routing number first, 613-555-2300w514-555-0055 (so call the carrier, wait (w) then dial the destination number) (the wait character should be variable, some programs use comma(,), some use pause(p), some use wait(w), I'm sure there are others.
    2) Allow people to do a list of extensions. i.e.:613-555-0123x1234 (where x may also need to be a wait character as outlined above), your script would simply itterate the number after x.

    BTW your original post seems to have an information leak "/home/tgamble/" ..... (Can you tell I haven't had enough coffee yet? )
    I'm a compulsive post editor, you might wanna wait until my post has been online for 5-10 mins before quoting it as it will likely change.

    I know I seem harsh in some of my replies. SORRY! But if you're doing something illegal or posting something that seems to be obvious BS I'm going to call you on it.

  5. #5
    Junior Member
    Join Date
    Sep 2007
    Posts
    28

    Default

    Quote Originally Posted by thorin View Post
    If you're serious about keeping on with this I'd also suggest the following:

    1) Allow people to add prefix + wait time character. i.e.: If I wanna dial my cheap long distance carrier's routing number first, 613-555-2300w514-555-0055 (so call the carrier, wait (w) then dial the destination number) (the wait character should be variable, some programs use comma(,), some use pause(p), some use wait(w), I'm sure there are others.
    2) Allow people to do a list of extensions. i.e.:613-555-0123x1234 (where x may also need to be a wait character as outlined above), your script would simply itterate the number after x.

    BTW your original post seems to have an information leak "/home/tgamble/" ..... (Can you tell I haven't had enough coffee yet? )
    lol yeah. playing around on a fresh fedora install =)

    i see where you are going with this. I am a fulltime employee as well as a full time college student so i have been trying to find little things like this to tinker with in the middle of everything.

    With that said i will post a new version as soon as i can

  6. #6
    My life is this forum thorin's Avatar
    Join Date
    Jan 2010
    Posts
    2,629

    Default

    Don't let me eat up your time. For all I know there's already a tool out there that does all this. I just figured if you were going you may as well make it full featured
    I'm a compulsive post editor, you might wanna wait until my post has been online for 5-10 mins before quoting it as it will likely change.

    I know I seem harsh in some of my replies. SORRY! But if you're doing something illegal or posting something that seems to be obvious BS I'm going to call you on it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •