Skip to content

Latest commit

 

History

History
99 lines (75 loc) · 4.85 KB

1. Get all available numbers.md

File metadata and controls

99 lines (75 loc) · 4.85 KB

Get All Available Numbers

Run all these instructions using bash or compatible.

Prepare to harvest

  1. Use Chrome and open (yes I know it's 404)

    https://www.google.com/voice/b/0/404
  2. Extract your authentication cookies

    1. Open developer tools -> network
    2. Select the 0/ and right click to Save as HAR
    3. Open that file, select all, copy
    4. Open har-to-curl.html and paste
    5. Locate the -H "cookie: gv=... GV_NR=1; ..." part, it's long
    6. Copy between and not including those double quotes
  3. Record those cookies paste below

    mkdir ~/Desktop/GOOGLEVOICE; cd ~/Desktop/GOOGLEVOICE
    URL="https://www.google.com/voice/b/0/setup/searchnew/"
    HEADER="PASTE HERE"
  4. Test that it works

    curl -H $HEADER "${URL}?ac=484&q=484&start=0&country=US"

If you see a brief response (less than 100 lines) with a redirect then you failed.

Here are the available area codes:

curl -H $HEADER "${URL}?ac=[201-999]" | grep -o "+1[0-9]\{3\}" | cut -b3-5 | sort -u > areacodes

Now put the area codes you want into the file to seed it:

echo -e "7472222222\n2122222222" > numbers

Harvest — the public blog way

for a in $(cat areacodes); do echo "${a}0000000"; done > numbers # GET ALL NUMBERS
cut -b1-3 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=0"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers
cut -b1-4 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=0"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers
cut -b1-5 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=0"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers
cut -b1-6 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=0"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers
cut -b1-7 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=0"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers
cut -b1-8 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=0"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers
cut -b1-8 numbers | sort -u | (while read LINE; do curl --cookie "$COOKIES" "${URL}?ac=${LINE:0:3}&q=$LINE[0-9]&start=5"; done) | grep -Pho '\d{10}\b' | sort -u >> numbers

Improvements not posted to blog (Mac + Linux)

DIFS: LOGIN TO SOME SERVER YOU CAN RUN, NOT YOUR LAPTOP! / ssh root@… / screen

curl --cookie "$COOKIES" "${URL}?ac=[201-999]&start=0" | egrep -ho '[0-9]{10}\b' > numbers
cut -b1-3 numbers | sort -u > areacodes
cut -b1-3 numbers | sort -u | sed "s|^\(...\).*|$URL?ac=\1\&q=&[0-9]|" | xargs -P10 -- curl --cookie "$COOKIES" | egrep -o '[0-9]{10}\b' >> numbers
cut -b1-4 numbers | sort -u | sed "s|^\(...\).*|$URL?ac=\1\&q=&[0-9]|" | xargs -P10 -- curl --cookie "$COOKIES" | egrep -o '[0-9]{10}\b' >> numbers
cut -b1-5 numbers | sort -u | sed "s|^\(...\).*|$URL?ac=\1\&q=&[0-9]|" | xargs -P10 -- curl --cookie "$COOKIES" | egrep -o '[0-9]{10}\b' >> numbers
cut -b1-6 numbers | sort -u | sed "s|^\(...\).*|$URL?ac=\1\&q=&[0-9]|" | xargs -P10 -- curl --cookie "$COOKIES" | egrep -o '[0-9]{10}\b' >> numbers
cut -b1-7 numbers | sort -u | sed "s|^\(...\).*|$URL?ac=\1\&q=&[0-9]|" | xargs -P10 -- curl --cookie "$COOKIES" | egrep -o '[0-9]{10}\b' >> numbers
cut -b1-8 numbers | sort -u | sed "s|^\(...\).*|$URL?ac=\1\&q=&[0-9]|" | xargs -P10 -- curl --cookie "$COOKIES" | egrep -o '[0-9]{10}\b' >> numbers
cut -b1-8 numbers | sort -u | sed "s|^\(...\).*|$URL?ac=\1\&q=&[0-9]\&start=5|" | xargs -P10 -- curl --cookie "$COOKIES" | egrep -o '[0-9]{10}\b' | sort -u >> numbers
say done

Crazy new parallel way

Add a bunch of servers you have root access to

NUM2URL=(sed "s|^\(...\).*|$URL?ac=\1\&q=&[0-9]|")
PARALLEL_OPTS=(-n5 --max-procs 2 --sshlogin :,A,B,C,... --eta)
PROGRAM="curl --silent -H \"$HEADER\" {} | grep -o '[0-9]\{10\}\b' | sort -u"
cut -b1-3 numbers | sort -u | $NUM2URL | parallel $PARALLEL_OPTS "$PROGRAM" >> numbers
cut -b1-4 numbers | sort -u | $NUM2URL | parallel $PARALLEL_OPTS "$PROGRAM" >> numbers
cut -b1-4 numbers | sort -u | $NUM2URL | parallel $PARALLEL_OPTS "$PROGRAM" >> numbers
cut -b1-5 numbers | sort -u | $NUM2URL | parallel $PARALLEL_OPTS "$PROGRAM" >> numbers
cut -b1-6 numbers | sort -u | $NUM2URL | parallel $PARALLEL_OPTS "$PROGRAM" >> numbers
cut -b1-7 numbers | sort -u | $NUM2URL | parallel $PARALLEL_OPTS "$PROGRAM" >> numbers
cut -b1-8 numbers | sort -u | $NUM2URL | parallel $PARALLEL_OPTS "$PROGRAM" >> numbers
cut -b1-9 numbers | sort -u | $NUM2URL | parallel $PARALLEL_OPTS "$PROGRAM" >> numbers
cut -b1-9 numbers | sort -u | sed "s|^\(...\).*|$URL?ac=\1\&q=&[0-9]\&start=5|" | parallel $PARALLEL_OPTS "$PROGRAM" >> numbers
say done